1

I need to integrate Salesforce iOS native library in my iOS native application and I have to show salesforce login screen and flow as mentioned below:

1) I have a HOME screen in my iOS native application.
2) From there I have to navigate to Salesforce login screen.
3) User will enter credentials and Salesforce will validate it.
4) Once logged in success then it will come back to my HOME screen with token/sessionID.
5) That token/sessionID I will use internally in my application. 

To achieve this I have integrated "SalesforceMobileSDK-iOS-Distribution" from the below link

https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Distribution

in my application. But exactly I don't know from where and how to start? which class will give me login screen. I tried something like

[SFUserAccountManager sharedInstance].oauthClientId = strClientID;

[SFUserAccountManager sharedInstance].oauthCompletionUrl = strCallbackURI;

[SFUserAccountManager sharedInstance].scopes = [NSSet setWithObjects:@"api",@"web", nil];

and

[SalesforceSDKManager sharedManager].connectedAppId = strClientID;

[SalesforceSDKManager sharedManager].connectedAppCallbackUri = strCallbackURI; [SalesforceSDKManager sharedManager].authScopes = @[@"web", @"api"]; [[SalesforceSDKManager sharedManager] launch];

but no luck. I have connected app information such as Client ID, Secret code and Redirect URI. How can I proceed? Please help me. Thanks in advance.

1 Answer 1

1

Take a look at this documentation. You basically will be configuring a new entry in the [project]-Info.plist file.

<key>SFDCOAuthLoginHost</key>
<string>mycommunity-developer-edition.na15.force.com/fineapps</string>

http://www.salesforce.com/docs/en/mobile_sdk/Content/communities_login_endpoint.htm

5
  • Thank you for your reply. Can you please tell me How to pass ClientID and CallbackURI? to which class I have to pass these values? I tried with '[SFUserAccountManager sharedInstance].oauthClientId = strClientID; [SFUserAccountManager sharedInstance].oauthCompletionUrl = strCallbackURI; [SFUserAccountManager sharedInstance].scopes = [NSSet setWithObjects:@"api",@"web", nil];' but no luck. Can you please help me. Dec 17, 2014 at 1:48
  • This is not straight forward. many classes are having same properties. See here '[SalesforceSDKManager sharedManager].connectedAppId = strClientID; [SalesforceSDKManager sharedManager].connectedAppCallbackUri = strCallbackURI; [SalesforceSDKManager sharedManager].authScopes = @[@"web", @"api"]; [[SalesforceSDKManager sharedManager] launch];' Can you please help me. Dec 17, 2014 at 1:53
  • @GuturuGanesh You should start a new question with this information, since it is asking a different question. Then you can format the code snippet a little more easily (include the entire init() method to give full context). What you have there looks like it matches the sample code. Dec 17, 2014 at 14:17
  • I'm assuming the code is in the AppDelegate and this is a native app, not a hybrid...hybrid would see that information go into the bootconfig.json. Dec 17, 2014 at 14:19
  • I have described more and edited my question @Michael Welburn please have a look on it. Dec 17, 2014 at 19:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .