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

New login steps #114

Closed
perbrondum opened this issue Mar 29, 2020 · 7 comments
Closed

New login steps #114

perbrondum opened this issue Mar 29, 2020 · 7 comments
Assignees
Labels

Comments

@perbrondum
Copy link

I'm surely missing something. Can't get a login screen to appear. The basic:
let consumerKey = "3MVG..."
let callbackURL = URL(string: "opportunityforce://authorized")!
let connectedApp = ConnectedApp(consumerKey: consumerKey, callbackURL: callbackURL)
salesforce = try? Salesforce(consumerKey: consumerKey, callbackURL: callbackURL)
salesforce.identity()

normally brings up the login screen, but not anymore...
Could you please provide a simplel login example?

@mike4aday
Copy link
Owner

mike4aday commented Mar 29, 2020

Hi @perbrondum - you have to assign the result of salesforce.identity() to a variable that you retain. Let me know if that helps and if not I'll post an example shortly - there are examples in the README that, while not calls to identity(), they illustrate the same point.

@mike4aday mike4aday self-assigned this Mar 29, 2020
@mike4aday
Copy link
Owner

@perbrondum try this:

let subscription = salesforce.identity().sink(receiveCompletion: { (completion) in
    //TODO:
}) { identity in
    //TODO
}

@mike4aday
Copy link
Owner

@perbrondum or this variation:

var subscriptions = Set<AnyCancellable>()
// ...
salesforce.identity().sink(receiveCompletion: { (completion) in
    //TODO:
}) { identity in
    //TODO
}.store(in: &subscriptions)

@perbrondum
Copy link
Author

perbrondum commented Mar 29, 2020 via email

@perbrondum
Copy link
Author

perbrondum commented Mar 29, 2020 via email

@perbrondum
Copy link
Author

perbrondum commented Mar 29, 2020 via email

@mike4aday
Copy link
Owner

Thank you @perbrondum

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