iOS Facebook login dialog doesn't close for some reasons - ios

I am trying to add Facebook login to my app through Firebase and the Facebook SDK.
I've been spending hours trying to implement it but every time I have the same issue: The login window won't close until I click OK, so the login fails (canceled by user).
I tried to implement it in a clean app with the same Facebook configuration (same FB app, same bundle ID) and TADAA, it works as expected.
I checked the FB configuration 10 times. I removed everything and tried again, but no luck, it's not working.
It is probably due to an external conflict within my iOS app but I have no clue about where to start digging.
I don't even know what code I could post to help you as it's pretty straightforward and the exact same code in a clean app works.
Any idea?

It came from the fact that Firebase swizzles AppDelegate
It worked by changing FirebaseAppDelegateProxyEnabled

Related

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.

Login to Spotify fails when using ad-hoc distribution

I'm using the Spotify SDK in an iOS app and login is working when running in the simulator or running on a device when I've installed the app directly from Xcode. When I distribute an Ad-Hoc build of the app (using Fabric) the method call
[self.player loginWithAccessToken:self.auth.session.accessToken];
fails to complete and the user is never logged in. If following Spotify's own tutorial this method gets called on the main thread and so blocks it, if I wrap it in a dispatch_async call onto a background thread then the UI is not blocked but the user is still not logged in.
I have tried with both a wildcard provisioning profile and an app specific one but that didn't make a difference.
The demo project included with the iOS-beta 25 SDK does work (can login) when distributing an Ad-Hoc build. That is using Spotify's example app, callback and client ID and similar but not identical code.
My question is then what I am not doing for a distributed build that I should be?
For anyone else that has the same problem I have found a solution. It seems the problem was due to not using refresh tokens or at least adding refresh tokens got things working.
I managed to get my app working by following this YouTube tutorial and referring to the code in the demo project found with the Spotify SDK . The ruby app used in the tutorial can be found here.
I hope that helps someone else too, I didn't make detailed notes about what I did so can't give anymore info than that but happy to try and help if you have a question.

iOS Facebook Login "Given URL is not allowed by the Application configuration"

Believe me, I have read all the other questions on this topic. None of them solved my problem (or were even quite the same problem). Facebook login has been working perfectly fine for me for weeks... Until yesterday when suddenly it started breaking and giving me this error.
Before yesterday, when I logged into my app with the Facebook SDK logInWithReadPermissions method, it would say "You've already authorized [app name]!" and be perfectly happy to log me in and move on. Then suddenly it started failing with this error:
Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App's settings. To use this URL you must add a valid native platform in your App's settings.
The weird part is I hadn't changed any of the Facebook app's settings at all. This just suddenly started happening; five minutes before it worked, next build it didn't. Nevertheless, I looked up the error message and found a ton of things people suggested to do on the facebook developer page to fix the problem... Mostly involving the Valid OAuth redirect URIs field, not that I could quite get a clear answer of what you're supposed to put in there for an iOS app... They always said to put your website address. I don't have a website, I have an app... What gives?
So I knew I hadn't made any changes to the Facebook developer area to cause it to break, and I'd tried every change there that I could find on the internet. So I pulled down an old working copy to test that, on the off chance that somehow code I'd written was the problem. Nope; code from a week ago, that worked perfectly fine, still gives me the same message.
If the problem isn't in the code, and changing things on the FB site doesn't do it... I'm out of ideas. If there's something else I need to do on the FB app to fix this, suggest away and I'll give it a try... And if it works that's great, but I'm still not going to understand why it broke in the first place when I didn't make any changes... Anybody able to help me out?
I had exactly the same issue.
Actually you just have to add platform in your app settings
So here are the steps
Open https://developers.facebook.com and select your app
Settings > Basic > Add Platform
3.Now select iOS from the window and add your Bundle ID and rest of the information and click on Save changes
and that's it.
Hope it helps you .. All the best
I had exactly the same issue today.
Same thing Facebook kept saying "You've already authorized [app name]!" in the past. Which I found strange since all my other apps didn't display this message.
In the end I figured that I didn't add an iOS platform for the Facebook app in Settings. I don't understand why it worked before :)
So try to add an iOS platform and don't forget to add your bundle ID.
I hope this works for you :)
Ok, I remember having a similar problem with a website that used Facebook to apply a discount "friend of the business page? get x% off your order" - anyhoo, turns out I needed to add both the www and non-www versions of the website to the settings in the Facebook App (https://developers.facebook.com -> My App -> Settings -> App Domains)
I've revisited this and added "iOS" as a native platform (found at My App -> Settings) # This would be first thing to check. The second thing would be to look at the "Quick Start" section for further assistance, which can be found in the top-right section of that iOS app settings.
Facebook can and will change things willy-nilly so it's unpredictable as to when things break or not.
I'd be interested to know when/if and how you resolve this.

App Not Setup: The developers of this app have not set up this app properly for facebook login even app was released

I developed a game by Unity 4.3 with Facebook Official SDK Plugins for Unity, and the game was released a few weeks ago, and work fine. However, I got a few report that players cannot login to facebook and got this error message. I tried to logout from facebook and login again, but I got this error.
I am very sure that my facebook app is NOT in sandbox mode and the option is YES in status and review, but I still get this error. any idea for me ?
Thanks you !
You have to make sure for below points to be correct:
Is your app submitted in developers.facebook.com
Have you filled correct details of the app in developers.facebook.com.
Is the app made Live for all users in developers.facebook.com.
Please go to Settings tab, and enter the Contact email address. Then the app goes to live, and it will work.
Do This:
Your App is not Live for All User's, so make it Public.
Follow the below steps:
Go to Apps and select your APP.
click on the Status & review.
select "YES" access public.
click confirm button to finished.
Now your app will be public.
Run the code :)
Hope it will help you.

Login with Facebook error on iOS 7 app after permission granted

My app just went live on App Store, but some users are experiencing some weird behavior.
It has a 'Login with Facebook' button provided by Facebook SDK for iOS and asks for dozens of permissions.
After tapping OK button, it doesn't do anything and stays logged out.
This never happened to me or beta testers, and I know others that downloaded the app from App Store that don't have any problems.
Does anyone have any idea? And why is it user specific error?
I'll post some codes later if there is a need for it.
I properly set the delegate and provide delegate methods!
Thanks For Help!
So I figured out the problem.
Turns out some users didn't have their current password in iOS Settings for Facebook account.
After updating Settings->Facebook->UserAccount->Password with the current one, they all were able to log in in my app!
Just in case if anyone encounters this.

Resources