Facebook AccessToken from iOS doesn't have access to email permission - ios

My app supports Facebook login and will be released to Apple Appstore real soon. I was testing the Facebook login for a while and it seemed to work all the time until now. When I login, the access token return by Facebook does not have email as one of the permission and I do need email for registering with my app. On developer.facebook.com under settings for my app, I have the following setup
User & Friend Permissions: email user_about_me user_birthday
Extended Permissions: read_friendlists
I also got the accessToken from my device and used https://developers.facebook.com/tools/debug/ and pasted my access token in there but it doesn't have email as one of the scope (the only scope listed is user_friends).
The app on Facebook is set to live (non-sandbox) so everyone can access it. Also on iOS, I do not have my app listed under Settings->Privacy->Facebook even after I give my app access to Facebook by successfully signed into Facebook. When I press login with Facebook, it opens Facebook website and says the following "'My App' will receive the following info: your public profile and friend list." and it doesn't mention email in there.
I have removed Facebook app from iOS, logged out of Facebook account from iOS settings, restarted the device and also removed my app and installed again and nothing seems to be working for iOS. We do have an Android version of our app, and that is working (able to get email) without any problem.
Any help is appreciated.
Edited:
Also on Facebook it says that my app accessed email (for my profile) on Oct 25th. So it was able to access email on that day.

However you are requesting the login you have to manually request the e-mail on top of basic permissions. You do so by putting under the readPermissions an array that contains the string email, like so...
fbLoginView.readPermissions = #[#"email"]
Or in openActiveSessionWithReadPermissions:allowLoginUI:completionHandler put the first argument as #[#"email"].
Weirdly, I've found that the app permissions do not often correlate the permissions that the app grabs.

Related

iOS - Facebook won't authenticate old users (Incorrect value)

We are using Django framework called "AllAuth" to authenticate our users through Facebook and Twitter.
For unknown reason some of our users get "Incorrect value" error when they try to login again in our app. This is not happening for new users.
I manage to troubleshoot it and I noticed that if I change the permissions (eg. added permission for "Location") in iOS SDK or if I delete our app from Facebook Apps I was able to connect successfully. So I guess it has to be something with the token for our old users. Unfortunately I can't reproduce the error now but some of our clients still can't login.
Is there any way to "re-request" user's permission from iOS SDK?
Update:
The error is
The access token is invalid since the user hasn't engaged the app in
longer than 90 days
It's a know issue of Facebook and there is an open ticket for that!

ios - multi facebook account on one device

I'm having an iOS app, need Facebook login to share something to wall. Everything is ok until I received new feedback from customer. Let me describe this case.
Apple have integrated Facebook into iOS system, user just needs to login via Setting, it is so easy for user. But my customer does not want to do that, they want user to login Facebook inside app and use it instead of Facebook of iOS system. Problem is here, there is a case: user has already logged in Facebook account A via iOS system, then user opens app and login Facebook inside app with other Facebook account B. After that, user shares a picture. Requiment is this picture should be shared on wall of Facebook account B (of app), but this picture appeared on wall of Facebook account A(of iOS system).
I just wonder do we have any solutions to resolve this case? Please give me any ideas you all have in mind after reading.
Thanks,
Ryan
I faced the same problem with Facebook SDK whenever a user login from any app using Facebook it change userid returned with the token which leads to share on the latest opened account.
if you open Facebook from a browser you will get this message from Facebook " we got confused please re-login "
so i took the same approach i saved user-id User(A) and whenever user share i check id coming with token if it changed i show " Facebook account changed please relogin " & i log all users out.
check this link may be helpful: https://www.facebook.com/help/community/question/?id=10205949056147843

Facebook login error "User is not allowed to see the application."

Hi: I have submitted my app to the App Store. I have Facebook login feature in my app. When I try to login to Facebook from devices I have I am able to do it seamlessly. However Apple has rejected my app saying " When we tap the Facebook icon to sign up we are taken to mobile Safari where we receive a message that states :
User is not allowed to see the application.: The user is not allowed to see this application per the developer set configuration.
Not sure how will I be able recreate this issue. I installed my app on 3 different devices and was able to login without any errors. I checked my app setting on Facebook Status and Review section of Facebook and I have enabled my general public. Not sure what else I am missing. I just feel very dejected. Can anyone please help me figure this out? I am using parse as my backend service and logging users using parse Facebook login.
Thank you very much!
Another reason this will happen is if you are logged in as a test user from a different app than the one you are trying to sign in to. Facebook test users are app-specific.
Sign out of Facebook and back in with a test user from the correct app.
Go to Safari > http://m.facebook.com > logout
In cases where app sign in with safariviewcontroller, sometimes it contains test user of different app
In my case, I was using wrong facebook application id in the code. So added the correct id & it worked for me.
This issue occurs because Apple testers used the same Facebook test account which was created to test any other app and they did not logged out from that account(forgotten to log out) and that facebook test account doesn't have the permission for the current app in review which is why this issue occurs,
You can follow the given link to replicate the issue by creating an an test account.
http://samwize.com/2014/07/23/error-with-facebook-login-using-test-users/
Steps to create Facebook test account
https://developers.facebook.com/docs/apps/test-users#managetool
We had this problem, and it turned out that the problem app didn't have a namespace set up in the Settings > Basic tab. Creating one is the solution to this.
Recently I have faced this same issue. Presently Facebook doesn't allow you to login from any Facebook id as you app is in development mode. There are 3 possible solutions that work for me:
Use only that id for Facebook Log In Testing with which you are working in Facebook for developer.
In Facebook for Developer-> Login to your Account-> Open app->Roles-> Test Users-> Add->Submit-> Edit on newly created random tester account->"Change Name and Password for this Test User"-> Provide a Name and handy password for testing.->Submit.(Use the given random generated mail id and password for testing Facebook login through your app.
3)In Facebook for Developer-> Login to your Account-> Open app->Roles->Roles->Testers->Add Testers->Provide Facebook Id for the user you want to add as tester->Submit
To get Facebook Id for a valid user. Login to Facebook with the Id you want to make as facebook tester in your development process.Then goto profile and in URL of browser you see id=(some_random_number). Copy that Id and paste it into Add Tester section of Developer account. It will be in pending state until the valid user accept the inviation.
I had something similar when validating to apple too,
I still don't get it now but for some reason the facebook secret id had been erased from the parse configuration.
You must check that point too
I don't know if that was the reason or not but for me this happened only after I signed the application with a release key, so I made the app 'public'. Probably the test users doesn't work for public applications.
We had this problem, and the solution is to use the same FB test accounts that was created from the same FB App. So if the App get rejected from App, then you should send to Apple a FB test account with password.
my side
I was using wrong facebook application id in the code. So added the correct id & it worked for me.

How to get back to the app after registering with facebook account?

I am trying to build an app that requires facebook authentication like registering users through their facebook account. Problem is after user logs into facebook am not able to get back into my app
In the Info section or info.plist of the project, there is a tab of URL types. In URL Types section you have to enter your facebook id that you got by creating facebook developer's account with 'fb' in prefix. Also identifier needs to be entered so that the OS knows which app to get back again

Facebook login process for iOS apps made in Flash AIR?

I'm getting my head around using Facebook login on iOS apps made in AIR. I have a class I bought, which takes care of Facebook auth stuff, and have got it working, but I'm concerned about the safety of it.
I also have a web app that successfully uses FB login. I store the user's FB id in my database so that when they log in, I can connect them to their user data on my site, just as I would if they used a username/pass.
Comparing my web app Facebook login process to iOS:
WEB APP:
User clicks 'log in with Facebook'.
Facebook tells my server the user is indeed logged in, and returns their Facebook ID, which I search for in my system, and if found, log them into my site - all secure as it's server-side.
iOS:
User clicks 'log in with Facebook'.
Facebook tells my app the user is logged in, and returns their Facebook ID (no longer server-side)
My app sends my server the user's Facebook ID, my server searches for it in my system, and if found, logs them in
The iOS way seems vulnerable to someone hacking your app and sending you any old Facebook ID to log into your system with, which can't really happen with the web app login process above.
Your thoughts? How should FB login be done on iOS?
Thanks for taking a look.

Resources