Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

Keith B.7's avatar
Keith B.7
Helpful | Level 7
9 years ago
Solved

How get app key in API 2?

In API 1, I could get the app key like this:

 

NSString *cachedAppKey = ...
MPOAuthCredentialConcreteStore *store = [[DBSession sharedSession] credentialStoreForUserId:nil];
if (cachedAppKey == nil || [cachedAppKey isEqualToString:store.consumerKey] == NO)
{
    NSLog (@"App key changed since last use!", nil);
}

Is there a way of doing this in API 2?

 

The reason I do this is to check that the app hasn't had to change its app key for some reason, which would mess up delta keys for -listFolderContinue:. It's a bit of an edge-case, and the code is really only there because I had to switch between an app folder key and a full access key during beta-testing, so had to ensure an invalid delta value wasn't used after the change-over.

 

Thanks,

Keith

 

EDIT: Actually, I suppose I can just get it from the info.plist file directly, removing the "db-" prefix.

  • Yea, I don't believe the API v2 Objective-C SDK stores the app key in the credential store/keychain like the API v1 Core SDK does.

2 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago

    Yea, I don't believe the API v2 Objective-C SDK stores the app key in the credential store/keychain like the API v1 Core SDK does.

  • Keith B.7's avatar
    Keith B.7
    Helpful | Level 7
    9 years ago

    Okay, thanks - I'll just grab it directly from the info.plist file, then.

     

    All the best,
    Keith

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!