You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

Robert S.138's avatar
Robert S.138
Helpful | Level 7
8 months ago

Objective-C Dropbox SDK warnings with iOS 12 as deployment target

After updating the Xcode deployment target in my iOS app to iOS 12, several warnings appeared in the Dropbox code. Updating through Cocoapods did not seem to change anything. The source files are all still dated 11-3-2020. I looked in the GitHub repository and the problematic code is still there. Here is one of them.

In DBSDKKeychain.m in the function v1TokensDataIOSCore we see:

 

 

 

 

NSDictionary *unarchivedFoundData = [NSKeyedUnarchiver unarchiveObjectWithData:foundData];

 

 

 

 


The warning is that this function is deprecated starting with iOS 12.0. Following the suggestion in Xcode I edited the code to:

 

 

 

 

 

NSDictionary *unarchivedFoundData = [NSKeyedUnarchiver unarchivedObjectOfClass:[NSDictionary class] fromData:foundData error:NULL];

 

 

 

 

 

 

I am just guessing that [NSDictionary class] is the right class to use here.

So, will this work? And why hasn't it already been done? After all, iOS12 came out 6 years ago.

 

 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Thanks for the report! I'll ask the team to look into this and update it accordingly.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,888 PostsLatest Activity: 7 hours ago
326 Following

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 or Facebook.

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!