Facebook user id different on test app - facebook

I am using the Facebook API to enable users to register using Facebook. I store their user ID to check whether a user has already registered using Facebook. I have a development environment, a staging environment and a production environment. The development environment and staging environment use a testversion of the actual Facebook App.
Now here's the problem. Even though Facebook says that test apps share the same app-scoped user ids, I get different ID's for the same person, thus disabling users that registered on one environment, to login on another.
How can I solve this problem?
Thanks!

I can verify this behaviour in the case if you production app was created before the introduction of the Graph API v2.0, but created a test app thereafter.
https://developers.facebook.com/docs/apps/test-apps/ states that
Test Apps share the same app-scoped User ID namespace as your
production app making it simpler to debug issues with app-scoped IDs,
or in cases where you use a copy of your production database for
development.
I guess it's something else if the production app doesn't use Graph API >=v2.0. Maybe it would make sense to open a bug with Facebook to verify this behaviour.

Related

How to provide an Facebook app review screencast for an app with no UI?

I’m trying to automate creation of ad accounts for my own business, and then upload custom audiences into these ad accounts. I wish to do this using a system user.
I have written some scripts to automate this process, but I am unsure how to receive the appropriate permissions from Facebook as I can not create a screencast, as my scripts has no UI. It’s just a collection of scripts.
Some research has a said that if apps only talk to a small number of accounts, you can just leave apps in dev mode to avoid going through app review, but I don’t think that’s possible in this case for the following reasons.
When my app is in dev mode, and I try to POST to https://graph.facebook.com/v7.0/<my-business-id>/adaccount to create a new ad account in my business, I get the error: "(#270) Development access is not allowed to access business API post:Business/adaccount.” OK. So my app has to be live for me to use this end point. If I set my app to Live, and then try to hit this end point, I get this error "(#294) Managing advertisements requires an access token with the extended permission for ads_management”
Then, looking at the permissions screen in my app, it appears I need to submit an app review with a screencast to be able to use the ads_management permission.
Additionally, if I want to use a system user, I can only approve permissions that have been approved by the app review process.
Given that my app has no UI (and nothing to screencast) how should I proceed? Or am I missing a way to do this without going through the app review process?
Facebook as provided instructions on how to submit those kinds of apps here, https://developers.facebook.com/docs/apps/review/server-to-server-apps:
If your app has no user interface because it exchanges data directly with our APIs, refer to this guide when configuring your app's Basic Settings, and when completing App Review.

Can I Migrate To a Different Facebook App

I've inherited a web app has Facebook oAuth integration with Facebook. It uses Facebook for login as well as making API calls to graph for other purposes.
The original developers set up multiple apps per environment instead of making one parent app and using child testing apps. However, I cannot fund the production app. That is, I have the app ID and the secret, but can't find the actual app. I made some API calls to get the user ID of the person who set it up but he does not respond to my requests.
What are my options? Can I somehow migrate production to a new app? The facebook IDs the app use are app-scoped, so what I'd like to do is make the production app the one app both development/staging etc. use.
Besides for needing control over the production app, if I switch to use a different app for production, each users' facebook ID will be different and thus each existing user will be seen as a new, distinct user even if the user has already registered.

Testing a Facebook Group App with the new permissions

Before the data breach at Facebook I had an app that was approved for the user_managed_groups permission. When they changed things my app became useless due to the restrictions on getting the user data from the comments.
I'm seeing now that Facebook has updated the API to allow apps to get that data provided each user of the group provides consent via graph login. I can easily add this to my workflow and provide the group admin a link for their users to consent.
The issue I am facing now is that the group admin must install the app into the group (see this help article for how this is accomplished), but apps cannot be installed unless they are approved by Facebook. This workflow seems like a catch 22: I can't test unless the app is installed but the app can't be installed unless it's approved.
How do I test my app if it can't be installed to the groups?
Test it with a group your app admin is an admin of, and a comment also made by that app admin user, that seems to work for me, according to a quick test in Graph API Explorer. (Comments made by other people with a role in the app probably work, too.)
The app must be in dev mode though, in live mode you will just get the error message saying the app must be installed in the group. If your app is currently in live mode and you can’t set it to dev mode, because you have other features that are in production already, then create a test app version of your app, https://developers.facebook.com/docs/apps/test-apps

Facebook Test User unable to access my web page

I am trying to test the Facebook login feature for a website staging environment, but when logging in with a test user I see this error message:
Error
User is not allowed to see the application.: The user is not allowed to see this application per the developer set configuration.
I have set App Domain to http://www.mysite-stage.com/. I've also added a Website platform for my app and set the site URL to http://www.mysite-stage.com/.
The website http://www.mysite-stage.com is actually accessible to everybody on the web, so there should be no issues there.
This method of testing Facebook integration for the site was working up to about 1-2 months ago, so I'm a little confused as to why it's not working anymore.
Are you sure you created the test user for that application?
Facebook won't let you login as a test user that was created under a different app than the one you are trying to sign in with.
Facebook test users are app-specific.
Yo can also create test users through the facebook developers site:
http://developers.facebook.com/apps/
- Select your app
- Roles
- Test Users
Since I can't add a comment yet, the problem is with you having made your app available to the public but you are trying to sign in with a test account.
Have you tried using the
installed=true
parameter once you use
POST /{app-id}/accounts/test-users
to create the Test Users? See https://developers.facebook.com/docs/graph-api/reference/app/accounts/test-users#publish

Facebook Log in Issue

I'm using Unity and prime31 plug in to access Facebook via my iPhone. I'm trying to test requests via my app by sending a request to a second test Facebook account on my iPhone (so I have my primary Facebook account and I've created a second one for the purposes of testing).
The problem I'm coming across is that I'm logging out of my normal Facebook account on the Facebook app and then logging into my test account. I'm then running my own app to test the requests. However, when I execute a 'me' graphrequest, it's still returning the details of my primary account (even though I logged into my test Facebook account before running my app).
I don't quite understand why it's doing this - I understand that there is a facebook settings page within iOS settings, but I'm not sure if this has anything to do with it?
Can anyone point out where I'm going wrong?
Thanks in advance!