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
    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];