lynnew82

How to license app at standard level through ArcGISOnline

Discussion created by lynnew82 on Mar 28, 2014
Latest reply on Mar 28, 2014 by DGoyal-esristaff
hi,
    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:@"http://www.arcgis.com"];                
        AGSCredential *credential = [[AGSCredential alloc] initWithUser:@"redMage1" password:@"qulanzhou"];
         credential.authType = AGSAuthenticationTypeToken;
         credential.tokenUrl = [NSURL URLWithString:@"https://www.arcgis.com/sharing/rest/generateToken"];
        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];
}

Outcomes