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

Callback not called #30

Closed
Alex293 opened this issue Nov 12, 2016 · 6 comments
Closed

Callback not called #30

Alex293 opened this issue Nov 12, 2016 · 6 comments

Comments

@Alex293
Copy link

Alex293 commented Nov 12, 2016

Hi, when the user press the Done button at the top of the safari view the simplicity callback is not called. I think it should be because now the code can't have any clue if the safari view is cancelled like this.

@edjiang
Copy link
Member

edjiang commented Nov 14, 2016

Yes, that's correct. If the user "cancels" the login, it's not called. I'd be open to having it call back with an error; is there a specific use case you're looking for, where you need that information?

@Alex293
Copy link
Author

Alex293 commented Nov 14, 2016

Nothing specific I just want to be called when its cancelled. I'm modifying the status bar style before opening the modal and I'd like to restaure it after closing as I do when the user accept or deny the login.

I think it would be great if you use the same callback with an additional error type for this kind of cancel because someone could use that info. It's still different than denying the login.

@edjiang
Copy link
Member

edjiang commented Nov 18, 2016

OK, I looked into this more today, and determined that it may not be a good thing to return it in the regular callback, since the callback is designed to be kind of "fool proof". If you're a lazy developer, you can just make an UIAlertView if error is not nil, and print out the error's description. Having a dialog saying "Error: you cancelled the login" would not make sense in normal circumstances.

Any ideas for how I can incorporate this without introducing undesired behavior?

I think earlier someone asked to get the Safari object from Simplicity so they can "present" it themselves; if that's the case you could attach to the delegate yourself. Or, I can modify Simplicity to just give you the URL, and have you initiate the Safari / app:openURL flow.

@Alex293
Copy link
Author

Alex293 commented Nov 18, 2016

The why not another optional callback? I think it's nice to have the safari view inside the lib it provide a cleaner usability for the lib users

@smahajan28
Copy link

Any updates?

@edjiang
Copy link
Member

edjiang commented Jun 2, 2017

We can add an optional callback; feel free to submit a pull request :)

@Alex293 Alex293 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants