function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
HussHuss 

iOS try to use token after first login

Using the Salesforce Mobile SDK for iOS (here), i am able to login and retrieve the data correctly. Now I am trying to store the oauth token to allow the user not to have to login again (unless the token expires). How would I go about using the token to login automatically the second time the app starts? I don't see anywhere to pass the token and the instance url.

HussHuss

Ok, so after playing around with this a little I have determined that with database.com it will remember my login and token and then automatically login, but pointing to a salesforce org it will not automatically do that.

 

Using the consumer key and login domain of login.salesforce.com i get the following message:

SFOAuthCoordinator:authenticate: authenticating with refresh token on 'https://login.salesforce.com' ...

 

and it logs in automatically, but if i change the consumer key to a development salesforce org and login domain to test.salesforce.com it does not automatically login (after a successful login)

 

Any thoughts as to why the database.com works one way and salesforce.com works another? or does it have to do with sandbox versus production org (database.com)?