Facebook iOS9 Different Access Token - ios

After updating my project and respective pods for iOS9 and Swift 2.1, I've been dealing with a few oddities in the Facebook SDK.
I have upgraded to FBSDK 4.9.1 - tried, 4.9.0 and currently running 4.6.0. I have added all the new entries to the plist.
Now, I don't receive most of the common problems other users are having with the new SDK, and can't seem to find someone with a similar issue as mine.
The Facebook authorization process still opens and works on iPhone's 6 and higher it seems (running iOS9 and up)
However on devices such as an iPhone 5s (running iOS9 and up), the dialog shows up, yet the token given back to us from Facebook is different than it used to/should be/other versions of the app, and we use the FB token to authenticate into our app.
What could be missing or wrong?

After sniffing the packets we realized now that Facebook uses the Safari Web View, instead of opening up via App, Facebook was using an old Cached Session from another account on Safari.
Silly mistake - but also an oddity with the new Facebook SDK.
Hope this helps someone else out.

Related

Expo v33 Managed Application - Facebook and Google login not working on deployed iOS

It works on Android as well as on the Simulator and Expo Client but doesn't work when we publish the App on the App Store or manually add .ipa on the iPad.
Have tried most of the solutions
https://blog.expo.io/react-native-google-sign-in-with-expo-d1707579a7ce
https://docs.expo.io/versions/latest/sdk/google-sign-in/
Getting the following error for Facebook:
Tried t operform Facebook login iwth behavior '(null)'
, but no Facebook app id was provided.
Specify app id in Info.plist or switch to 'web' behavior
Google failing as well and not able to get any error for Google.
First of all, since this is a very fresh incident, I inform that this response is not a definitive answer, but rather an educated guess.
I am also facing this issue, and in my case it is working fine on simulator using expo app version 2.13.x but happening while running the expo app (version 2.14.1.107621) on physical iphone.
I haven't tested on android (neither simulator nor real device), but most people say it is happening on iOS only.
I did some research and found that according to expo SDK 36 blog post, the facebook module now has to be initialized with initializeAsync() BEFORE calling logInWithReadPermissionsAsync(). Of course that this should be applicable only to apps using version 36 of expo SDK, but maybe the latest expo-cli (3.11.1) and expo-app (2.14.x) for iOS have issues that prevent them from realizing the legacy behaviour on facebook module of previous SDKs (like mine, version 33), thus producing the error.
Meanwhile, let us see the new replies on this thread of expo forums: https://forums.expo.io/t/facebook-login-promise-rejection-on-ios/30969

Facebook Codeless Event - iOS app does not connect to Events Manager

I'm trying to get Facebook Codeless Event to work, but I can't seem to connect my app to Events Manager.
Followed instruction from this article: https://developers.facebook.com/docs/app-events/codeless-app-events/#ios
After updating Facebook Core SDK to 4.39.1 and even including Marketing SDK just in case. Included I went to Facebook app, and it did have check mark to say that my SDK version is compatible.
Then, the instruction say to open new session and shake the app, but even after vigorous shaking for more than 10 seconds, nothing happens in the app nor in the web browser.
Anybody know what can be done to properly set it up?
I had the same issue, it seems like the FBSDK has a different behaviour for the simulator.
Opening the simulator and executing a "Hardware" -> "Shake Gesture" worked for me.
I was able to get this working by not using Facebook SDK directly from website, but using Carthage to get the frameworks.
By getting 4.40.0 version from Carthage, shaking to connect to the Event Manager worked. There were some error creating events, but this is out of scope for this question, so I will mark this as solved.
Only setting that seems to be needed to connect correctly were: Facebook App Id and bundle id.

Third Party Sign in for IOS11 - GIDSignInButton

I am testing for IOS 11 updates and notice that my Firebase Auth using Google Sign in does not work
I get an error
A problem repeatedly occurred on https://accounts.google.com/signin/oauth? client_id nosignup pproval_state=???? passive=????
I can see many press reports about Apple removing part of the social media integration Apple to stop third party login on apps through social media in iOS 11
But I cannot find anything aimed at developers on what we should do about this.
Google sign in web page does not mention anything that I can see about IOS11 Google Sign-In for iOS
Nor does Firebase
Could anyone provide clarification on whether these libraries will still be relevant going forward in IOS11, or provide links where these issues have been discussed.
------ adding link to Firebase sample app -----------
Firebase sample app also fails for the Google login, I have not tested all others
https://github.com/firebase/quickstart-ios/authentication/AuthenticationExampleSwift
It is true that Apple has removed the special handling of certain 3rd party social networking sites (FB, Flickr, Twitter), but Google was never among that list. So, your error should not be related to that.
The library you are using relies on a well adopted mechanism for providing in-app out-of-context OAuth signin. Basically, the app presents a SFSafariViewController with the OAuth page, then once authorization has completed it opens a special URL which gets forwarded back to the application which then dismisses the SFSafariViewController. Google and FB I know for sure do it this way in their SDKs.
In iOS 11, Apple is providing a new mechanism to do this workflow. It is called SFAuthenticationSession. They aren't deprecating the currently supported method, and you will likely see the libraries you use migrate to this new mechanism for iOS 11 devices.
The answer to your question is that these libraries are still relevant and you should continue to investigate your error (make sure you're not getting the error on iOS 10, obviously)
Update
In response to further questioning, I fired up a sample project from the link provided. I ran into the same problem on the simulator, but when I ran it on my old iPhone 6 with iOS 11 beta 3 it worked fine. So, at the movement, this seems like a simulator bug. One theory may be simulator's reliance on the host operating system for certain libraries, so it's possible that if you were running High Sierra you might not experience this problem.
I tried fiddling with all sorts of switches in settings to get the page to load correctly to no avail. It looks like the course of action is:
File a feedback
Test on the device until the simulator is fixed (this is beta software after all)
Update #2
The simulator issue seems to be fixed in Xcode 9 beta 4. 🎉

iOS Facebook SDK Not Redirecting After Authentication on Device

I recently followed a tutorial (http://www.brianjcoleman.com/tutorial-how-to-use-login-in-facebook-sdk-4-0-for-swift/) which outlines how to use the Facebook iOS SDK in Swift to create a login view.
Everything works fine when I test in the iOS Simulator, but when I load my application (and the sample app provided by the tutorial author) on an actual iOS device, the application attempts to open the Facebook app installed on my device and leaves me with a blank screen with a cancel button in the top left corner.
I know that this at least partially works on a device as if I remove my bundle identifier from the Facebook developer page, I get an error that states I must add it back in.
I get the feeling I'm missing some sort of redirect that's necessary to hand off the authorization process from the Facebook app back to my app, but any advice anyone has would be awesome.
Also, I'm running XCode 6.4 targeting iOS 8.3, but I'm testing on a device running iOS 9. Everything seems to be running fine, but maybe this is part of the problem?
The clue on your question is iOS 9, I highly recommend checking out this documentation: https://developers.facebook.com/docs/ios/ios9 you're most likely missing many important steps as well as the latest Facebook iOS SDK.

FBLoginView works on iPhone Simulator, but not on actual device

I have created an app that allows a user to login using facebook via the FacebookSDK. I can successfully login while running the app on the iPhone Simulator as an iPhone 5 or 5S (i haven't tried any other devices). But, when I run the app on my iPhone 5 the FBLoginView doesn't work. More specifically, when I tap the view (the 'Log In' button) the color changes to a slightly darker blue to acknowledge that the touch was received, but nothing else happens. Normally, a browser would open and request my Facebook credentials, but that does not happen.
Any ideas on what the problem might be?
FYI, I am using XCode 6 Beta 5.
Update:
I took John's advice in the comments below and uninstalled the Facebook app and I also deleted the OS Facebook account. This worked for me. My app correctly received the callback from Safari. I re-installed the Facebook and tried it again and my app still worked (receiving the callback from the Facebook app).But, when I logged back into the OS Facebook account my app no longer received the callback.
I am currently using the supplied FBLoginView. I think from this point I will implement a custom login view for Facebook so that I can apply breakpoints on each of the functions.
I am wondering at this point if this isn't an issue with the Beta version of iOS 8. I am not entirely convinced that it is because I have been unable to find mention of other developers having this same issue. Just a thought
If you're using the Facebook SDK, login events are handled differently depending on the environment. You may want to check all callbacks as the Facebook SDK can use the settings fb credentials, pages app, Facebook app, or web view to log in...
The issues cleared themselves up. They appear to have been related to the beta release of Xcode or the Swift language.

Resources