New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to open another URL of SF after opening login URL on Safari controller #22
Comments
So basically I don't want to use any API rather I want to open URL to show content. Let me know if that's possible and how? |
Hi @NanostuffsTech - not sure I understand what you're trying to do, but it sounds like you are building a web app, not a native iOS app. Is that correct? If so, then it would be better to build your app within Salesforce1. Can you share more details? |
@NanostuffsTech maybe this will help: you can use the "front door" URL (in some cases) to pass a session ID to a web view: https://help.salesforce.com/articleView?id=000193348&language=en_US&type=1 |
Not really, it's native application only. What I'm trying to do is, login to Salesforce using Swiftly Salesforce and then show my own URL of chatter field which we can goto after logging in. But right now what is happening, it's allowing me to login through Safari but when I open my own web view in my controller, it shows me again login page when I try to open chatter field. So what I want is my web view should use same session as of safari. So that other URL which I'm opening wont take me to login page but will directly open chatter field page. Let meknow if you need any more clarificaiton. |
Hi @NanostuffsTech: I don't understand what you mean by "open a Chatter field" - but I believe I understand the larger question, i.e. how to pass a session ID to a web view that's loading a protected Salesforce URL. Is that correct? If so, then this might work:
Does this help? Can you share the URL you're trying to load in the web view? |
Same as login URL, it automatically goes to home page if logged in.
https://kpmg-ceat.cs31.force.com/customers/
…On Sat, Jan 28, 2017 at 9:36 PM, Michael Epstein ***@***.***> wrote:
Hi @NanostuffsTech <https://github.com/NanostuffsTech>: I don't
understand what you mean by "open a Chatter field" - but I believe I
understand the larger question, i.e. how to pass a session ID to a web view
that's loading a protected Salesforce URL. Is that correct? If so, then
this might work:
-
Authenticate user via Swiftly Salesforce - once authenticated, you can
access the current session ID at salesforce.authManager.
authData?.accessToken
-
Redirect the user to your app (don't forget to register the redirect
URL's scheme with iOS
<https://github.com/mike4aday/SwiftlySalesforce/blob/master/README.md#example-register-your-connected-apps-callback-url-scheme-with-ios>
)
-
Use the session ID with the Salesforce 'front door' URL
<https://help.salesforce.com/articleView?id=000193348&language=en_US&type=1>
to load your web view -- note that the web view will have to follow
redirects and store the session cookie provided by Salesforce
Does this help? Can you share the URL you're trying to load in the web
view?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFYBqqjtOomK6zVEhCeeC6odxwmXyqyTks5rW2d_gaJpZM4LvjNV>
.
|
@NanostuffsTech try using the access token as session ID with the 'front door' URL per my earlier post. |
Hello, Thanks. |
Hi @TrupK - in what way is it not working? Here's a related post: http://salesforce.stackexchange.com/questions/50368/how-to-integrate-salesforce-page-to-native-ios-app And note also that your connected app has to allow |
Hi,
I'm using swiftly salesforce to for login to salesforce account from my iPhone app using Swift 3.0. I have followed this SwiftlySalesforce link.
Here swiftly salesforce replaces your rootviewController with SFSafariViewController. Once login is done it will replace safari view controller with your initial rootviewController. I'm able to get all details of user from which I have logged in. Now on my initial view which is my rootview, I want to show chatter page which usually comes after successful login on webview. But I'm getting login page again on webview.
I think this is happening because the login seesion I'm getting from safari View controller is not getting to webview. Or is there any other issue?
If anyone have worked on such requirement, or anyone could help me, please post your answers here. Your help is appritiated.
Thank you,
Ankita
The text was updated successfully, but these errors were encountered: