Facebook SDK Login - Application Unavailable: The application you're trying to use is either no longer available or access is restricted - facebook

A user tried to login to my app using Facebook login and they encountered the following error after being redirected to their native Facebook app: "Application Unavailable: The application you're trying to use is either no longer available or access is restricted".
I'm not able to reproduce it and I haven't found much online. The app is available since it's live under Facebook apps and it's being used by existing users. The only option would be that the access is restricted but I'm not sure why. I do know that Facebook launched a security update in March to "Use Strict Mode for Redirect URIs" by default, but this update does not apply to the Facebook SDK according to what I read.

I had the same error message on Android devices which was caused by setting only development key hashes solved it by adding release key hash, following these instructions: Setting a Release Key Hash on facebook

This error is also produced if you try to sign up with recently created account. It seems like Facebook has some approval process which takes time. For me new account produced an error one day and worked perfectly on the next one.
To test sign up immediately you should create a test user in Facebook App Dashboard under Roles.

Related

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

Windows Phone Facebook app not returning access token after V 8.3.1.0 Update

I allow my windows phone app users to login using their Facebook account. To authenticate the user and get the access token, I follow the steps provided in this link. It opens up the installed Facebook app on windows phone, authenticates the user and returns an access token. This was working until Facebook recevied V 8.3.1.0 update. Now it opens up the facebook app and comes back with following error:
/Protocol?encodedLaunchUri=msft-<my_app_id>://authorize?error=&error_code=2005&error_description=Calling+app's+ID+doesn't+match+the+ID+sent+by+the+calling+app&error_reason=Calling+app's+ID+doesn't+match+the+ID+sent+by+the+calling+app&state="
What went wrong here? Any deep link changes by facebook?
Found a solution.
When we create a Windows Phone project in Visual Studio, it would assign a Product Id to our app. That Id will change once the app is published on the store.
When we define custom Uri scheme in WMAppManifest.xml file, we have to always specify the published app id. Otherwise facebook authentication would fail.
This new facebook app is expecting the calling app's product id to be same as published app id that is mentioned in the custom uri scheme. Since it won't match in our local app, it is returning the error stated above. I changed the Product id to published app id and everything works fine.
This might help if someone is facing similar issue.

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

Login using Facebook Authentication - FBApp Installed

I am following the Scrumptious sample that is on the FB Developers site (https://developers.facebook.com/docs/tutorials/androidsdk/3.0/scrumptious/authenticate/) I successfully implemented everything up to the end of step 2 without any errors.
But i noticed that if i have the Android FB Application installed on my device then it does not log in.
It asks permission to access my public profile and friend list (to which i reply OK). After that it execute onSessionStateChange() but state = CLOSED_LOGIN_FAILED.
I did verify that:
My app is listed on https://developers.facebook.com/apps
I checked and my Native Android App option is ticked
i also have my Package Name, Hash Key entered.
The Facebook Login option is also enabled.
Please can someone help me to get this working :-( i am
struggling with this for 2 days already and no luck.
Thanks.
Problem has been resolved. After i generated the HashKey using the KeyTool.exe and entered the password as android it gave me a different key. I copied this to the dashBoard on Facebook and it worked. Sorry for wasting your time

Facebook C# SDK throwing Exceptions on ParseCookieValue

We're using Facebook connect in an application outside of Facebook, quite regularly the C# Facebook SDK is throwing an exception with this message "Precondition failed: !cookieValue.Contains(",") Session value must not contain a comma."
After doing some research it seems linked to the fact that we're using the JavaScript SDK (for Facebook Connect) and the C# SDK at the same time. As I'm unable to replicate the issue myself I don't have much clue.
UPDATE: In fact the exceptions are happening in prod to "real" users. THE SDK is throwing a hundred of them a day.
Yeah - getting this as well - also using c# SDK and Javascript SDK.
It seems to have happened ONLY to my FB account - when testing my application - and it happened after I had used the wrong app secret in my Oath settings.
It seems that Facebook had TWO access tokens for my personal account - and was trying to store them both in the cookie. I tried using the SDK deleteauthcookie() method, I deleted ALL of Facebook cookies in my browser. No Luck.
The only solution was to remove ALL of the cookies in my browser....
It seems Facebook SOMETIMES tries to store two access tokens in a cookie - separating them with a comma - and c# SDK doesn't like that.
This was a bug in the Facebook C# SDK: http://facebooksdk.codeplex.com/discussions/273578/
Could you remove the following line of code from ParseCookieValue
method.
Contract.Requires(!cookieValue.Contains(","), "Session value must not
contain a comma.");
This has already been fixed in the latest v5.3.1beta
(http://facebooksdk.codeplex.com/releases/view/75790)