SimplicityMobile / Simplicity

A simple way to implement Facebook and Google login in your iOS apps.
Apache License 2.0
681 stars 66 forks source link

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

Open Vinzius opened 6 years ago

Vinzius commented 6 years ago

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 commented 6 years ago

Sure, go for it!

Vinzius commented 6 years ago

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

edjiang commented 6 years ago

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 commented 6 years ago

Hey @edjiang

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

Cheers