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

App will crash if the fb scheme isn't first in CFBundleURLSchemes #38

Open
Vinzius opened this issue Aug 31, 2017 · 4 comments
Open

App will crash if the fb scheme isn't first in CFBundleURLSchemes #38

Vinzius opened this issue Aug 31, 2017 · 4 comments

Comments

@Vinzius
Copy link

Vinzius commented Aug 31, 2017

Hey !

First, thanks for your lib 👍

I noticed that if you don't put the fb scheme in the CFBundleURLSchemes list, then the app will produce an error / crash (at least it'll go to preconditionFailure).

Reason if that at this line let urlSchemes = urlTypes.flatMap({($0["CFBundleURLSchemes"] as? [String])?.first }) you take .first, instead you could do a reduce instead of the flatMap.

Would you merge a PR if I were to submit one?

Thanks,
Vincent

@edjiang
Copy link
Member

edjiang commented Aug 31, 2017

Sure, go for it!

@Vinzius
Copy link
Author

Vinzius commented Sep 4, 2017

Thanks, I'll do that this week! :-)

@edjiang
Copy link
Member

edjiang commented Sep 7, 2017

There's probably some maintenance needed for this project for iOS 11 as well... converting to Swift 3.2/4, and using the new SFAuthenticationSession now that SFVC is no longer persisting auth data across apps.

https://developer.apple.com/documentation/safariservices/sfauthenticationsession

@Vinzius
Copy link
Author

Vinzius commented Apr 3, 2018

Hey @edjiang

I'm a bit late, but I'll soon submit a PR for Swift 4.1 + iOS 11.

  • Solved the initial issue with url schemes
  • Try using SFAuthenticationSession if iOS 11+ (but I only tried with FB)
  • Trick to have the button "connect via fb native app"

Cheers

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

2 participants