Skip to content
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

Login screen not being shown with SwiftUI #112

Closed
victor-takai opened this issue Jan 30, 2020 · 5 comments
Closed

Login screen not being shown with SwiftUI #112

victor-takai opened this issue Jan 30, 2020 · 5 comments
Assignees
Labels

Comments

@victor-takai
Copy link

Hi, I just found out this repo as an alternative to the iOS salesforce sdk, I followed the setup example and didn't succeed.
My question is: should the library be calling the login screen (webview) at any moment after setting the the salesforce variable?
Is there any way to use it without SwiftUI?

@mike4aday mike4aday self-assigned this Jan 31, 2020
@mike4aday
Copy link
Owner

@KalivosGG Swiftly Salesforce should work with and without SwiftUI. You don't have to display the login screen explicitly; it will appear automatically if the framework can't retrieve an access token from the local keychain, or refresh it from Salesforce. Would you post some representative code that will help me identify what might be going wrong?

@victor-takai
Copy link
Author

victor-takai commented Feb 3, 2020

@mike4aday Hey I finally managed to work it out, I was trying to retrieve data right after setting salesforce and I was getting no error or messages at all. I added a delay to retrieve some records and it worked!

Now I'm getting "server cannot be found" when trying to login.
Edit: Is there any way to debug the authentication view/webview?

@mike4aday
Copy link
Owner

Hi @KalivosGG - the login sequence uses Apple's prescribed ASWebAuthenticationSession. You could add a debug breakpoint in the authenticator method in the UserAgentFlow class.

You shouldn't need to add a delay to retrieve records. Once you call a method on the salesforce instance and attach a Combine subscriber, the subscriber's closure will be called when the results are returned.

@victor-takai
Copy link
Author

@mike4aday thank you very much, I'll look into it.

@mike4aday
Copy link
Owner

Hi @KalivosGG I'll close this issue for now. If you have more questions or it's not resolved, please re-open or create a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants