cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Objective-C SDK crash

Objective-C SDK crash

Samnis
Explorer | Level 4

 

Hi,

in my project I am using the Objective-C SDK: I am updating the app to use scopes and short lived tokens. I added the SDK to the project by manually copying all the classes.

I am getting a really strange crash I have never seen before. The crash occurs when I try to connect my app to Dropbox. When my app is called back after the authorization flow it always crashes. For what I understand, the problem is within the method "+ (DBTransportDefaultConfig *)transportConfig" of the class "DBClientsManager". At runtime the returned instance is of a different type, and is not of the type "DBTransportDefaultConfig". So when you use it within the private method "db_addAuthorizedClientWithToken", the app crashes. With the debugger I can see the instance is of the right class ("DBTransportDefaultConfig") when it is saved with the method "+ (void)setTransportConfig:", so it is really strange. Also, if I run the app again (after the crash) it doesn't crash anymore and it is connected to Dropbox.

 

The crash occurs on Xcode 12.2 and 12.3, with iOS 14.2 and 14.3. I have updated all the classes to the latest version (commit 500).

 

Thank you and best regards,

Mario

 

 

Screenshot 03.png

 

Screenshot 01.png

 

Screenshot 02.png

 

 

 

13 Replies 13

Greg-DB
Dropbox Staff

Any users using old versions of your app will continue to be able to use it without issue for now. Once you switch the  "Access token expiration" setting for your app on the App Console to "Short-lived", or on September 30, 2021, whichever comes first, users using old versions of your app should still be able to use it, but they'll start receiving short-lived access tokens when they process the app authorization flow, instead of long-lived access tokens. Short-lived access tokens only last for four hours, at which point further API calls will fail, and the app will receive an DBAUTHAuthError (like it would currently if the user unlinks the app from their account). Exactly how your app handles that error depends on how you've programmed it. E.g., it may prompt the user to re-authorize the app.

Samnis
Explorer | Level 4

Hi Greg,

please tell me if I am wrong.

I have updated the code of the app to use short-lived tokens, and I will release the update on the App Store in a few days.

But I haven't updated the app on the console of my Dropbox account. If so, users who update the app can connect it to Dropbox, or I need to updated the app on the console and set the "Access token expiration" to "Short-lived"? To recap, I would release the updated app on the App Store with the code using short-lived tokens, but without setting the "Access token expiration" to "Short-lived" on the console. There is something wrong about it? Or I need to set the "Access token expiration" to "Short-lived" before releasing the app update on the App Store? Is this mandatory?

 

Thank you very much,

    Mario

 

 

 

Greg-DB
Dropbox Staff

You are not required to change the  "Access token expiration" setting for your app. If you do not change it, existing users on old versions of your app will continue using the old flow, and users on the updated version of the app will use the new flow. If you do not change it, nothing will change for old versions of your app until September 30th, 2021.

Samnis
Explorer | Level 4

Ok, thank you very much Greg.

I'll leave the setting as is, and I only publish the new version of the app. This seems the best approach to me.

 

Thank you again,

    Mario

 

 

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Samnis Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?