How to license app at standard level through ArcGISOnline

03-28-2014 08:19 AM
New Contributor II
    I am a ArcGISonline subscription user.I want to use the offline editing in my app, so I need the app license at standard level.
    But when I get the license use codes below and create a feature in a local database, the sdk told me that "Licensed for basic use only".
    Is there some thing wrong with my codes??

         NSURL *url = [NSURL URLWithString:@""];                
        AGSCredential *credential = [[AGSCredential alloc] initWithUser:@"redMage1" password:@"qulanzhou"];
         credential.authType = AGSAuthenticationTypeToken;
         credential.tokenUrl = [NSURL URLWithString:@""];
        self.portal = [[AGSPortal alloc] initWithURL:url credential:credential];

-(void) portalDidLoad:(AGSPortal *)portal{
    // Get license info from the portal
    AGSLicenseInfo *licenseInfo = [[AGSLicenseInfo alloc] initWithPortalInfo:portal.portalInfo];
    // Set the license
    AGSLicenseResult licenseResult = [[AGSRuntimeEnvironment license] setLicenseInfo:licenseInfo];
0 Kudos
1 Reply
Esri Regular Contributor
Check out this sample -
It shows you how to license the app based on the login, and then save the license to the keychain so that you can still use Standard license for upto 30 days when the app is restarted without network connectivity.
0 Kudos