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:
- I have a HOME screen in my iOS native application.
- From there I have to navigate to Salesforce login screen.
- User will enter credentials and Salesforce will validate it.
- Once logged in success then it will back to my HOME screen with token/sessionID.
- That token/sessionID I will use internally in my application.
To achieve this I have integrated "SalesforceMobileSDK-iOS-Distribution" from below link https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Distribution in my application. But exactly I don't know from where to and how to start? which class will give me login screen of Salesforce. 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];
I have connected app information such as Client ID, Secret code and Redirect URI. How can I proceed?
If I use zkSforce
library from this link https://github.com/superfell/zkSforce
Does it achieve my requirement?
Please help me. Thanks in advance.
Finally I achieved it and the good answer for this question is
"SalesforceMobileSDK-iOS-Distribution"
from below link https://github.com/forcedotcom/SalesforceMobileSDK-iOS-Distribution ."$(SRCROOT)/your app name/your library name"
and choose "recursive"."SFUserAccountManager.h", "SFAuthenticationManager.h" and "SFIdentityData.h"
files.Add below code snippet to your login action
hope it would helpful to you.
Note: According to me the "Call back URI" should not start with either "http" or "https".