I have been using Oflline map in my Application. After the migration to new web portal am able to create new webmap and offline region but sharing options are only (Owner , Organization).
In the application am trying to load my offline area but it always return empty list. I am setting a API int the global context.
ArcGISPortal portal = await ArcGISPortal.CreateAsync();
PortalItem webMapItem = await PortalItem.CreateAsync(portal, PortalItemId);
_originalMap = new Esri.ArcGISRuntime.Mapping.Map(webMapItem);
for the web map item.
_offlineMapTask = await OfflineMapTask.CreateAsync(webMapItem);
IReadOnlyList<PreplannedMapArea> preplannedAreas = await _offlineMapTask.GetPreplannedMapAreasAsync(); // returns empty list
currently my plan is lite with pay as you go. do i need to update my plan to have access or i am missing some permissions.
Thanks for reaching out with your query.
Although the question could benefit from more details, I'll do my best to assist you with troubleshooting.
Troubleshooting Steps
Typically, if there are licensing limitations, an exception will be thrown. You might also consider running your application in developer mode, which enables all features, to see if this resolves the issue.
Thank you for your Reply.
I have cross checked all the settings.
I have tested with setting API key globally (App.xaml.cs).
I have also tried to authentificate with clientID and Secret. i used the following code for user authentification (code is taken from the example).
public static void SetChallengeHandler()
{
// Define the server information for ArcGIS Online
ServerInfo portalServerInfo = new ServerInfo(new Uri(ArcGISOnlineUrl))
{
OAuthClientInfo = new OAuthClientInfo(AppClientId, new Uri(OAuthRedirectUrl))
};
// If a client secret has been configured, set the authentication type to OAuth client credentials.
if (!string.IsNullOrEmpty(ClientSecret))
{
// If a client secret is specified then use the TokenAuthenticationType.OAuthClientCredentials type.
portalServerInfo.TokenAuthenticationType = TokenAuthenticationType.OAuthClientCredentials;
portalServerInfo.OAuthClientInfo.ClientSecret = ClientSecret;
}
// Register this server with AuthenticationManager.
AuthenticationManager.Current.RegisterServer(portalServerInfo);
// Use a function in this class to challenge for credentials.
AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(PromptCredentialAsync);
}