question

mlazowski avatar image
mlazowski asked

Facebook login "Given URL is not allowed by the Application configuration"

Hello.

I'm trying to implement linking accounts to Facebook and LoginWithFacebook.

In my use case a user is always silently logged in, then can link their account to facebook and continue with LoginWithFacebook.

I have followed both your documentaion, written guides and your video guide on youtube and I'm having two issues.

1) When I launch the app on an Android device, whenever I call

FB.LogInWithReadPermissions(newList<string>(){"public_profile","email"},OnLoginHandleFBResult);

facebook opens and shows me an error message : "Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings."

I have added facebook login to my app and have in configured exactly like in this guide:

https://api.playfab.com/docs/tutorials/landing-players/facebook-unity

Therefore, I don't know what may be causing it.

2) When I test my functionality in Unity, I can succesfully link my playfab account to facebook and then login with facebook. But, on next run, when I check that the last authentication method was with facebook and then call FB.Init to receive an Auth ticket - it is always null, forcing me to use a debug token everytime. Is that intended behaviour for the Unity Editor or not?

if (AccessToken.CurrentAccessToken != null) //user was already linked
        {
         _AuthService.FBAuthTicket = AccessToken.CurrentAccessToken.TokenString;
            Debug.Log("FB Ticket: " + _AuthService.FBAuthTicket);
            _AuthService.Authenticate(Authtypes.Facebook);
        }

I'd appreciate help with this, so far working with Playfab was a blast and we have a game in late development.

Authentication
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
1807605288 avatar image
1807605288 answered

Hi, my name is Paul, and I'll use my limited knowledge to try to point you in the right direction today. If you are still stuck after my post, let me know and I'll loop in one of the engineers who is more familiar with this.

Here's some reference links:
https://github.com/PlayFab/UnicornBattle/blob/master/UnicornBattle/Assets/Scripts/Dialogs/FacebookHelperClass.cs
https://github.com/PlayFab/UnicornBattle/blob/master/UnicornBattle/Assets/Scripts/PF_StaticsAndHelpers/PF_Authentication.cs#L65

UnicornBattle is our oldest GDC demo app, and it was successfully integrated with Facebook logins back when it was made. The link above is the code for the Facebook interface from that time, and was demonstrated as working at the time. (I don't suggest trying to download & build the whole UnicornBattle app, I don't think it's working at present)

If I remember correctly, in UnicornBattle, you have to type the Dev-token on the PC every time you log in from the PC. HOWEVER, the Facebook login on the mobile devices worked as expected, if all the dependencies were set up correctly.

So, before you give up, please deploy it to a phone, and test it out on the device, as I think it works much better there. You could also try saving the dev token in unity game data or a local file as a stopgap.

I hope this gets you unblocked. Sorry that it's not a complete answer. And again, if you're still stuck after this post, I'll go grab the engineer who is more familiar with this, and get a more detailed answer from them. Thanks!

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mlazowski avatar image mlazowski commented ·

I appreciate your very fast and extensive answer @Paul Gilmore !

I've changed my code a bit and now have no problems testing in the editor.

It also turned out that I didn't finish setting up the app in the facebook developers console - my bad.

It works great now, both linking and login in.

I've tested it on Android and it works great, but I've encountered a problem on iOS. I know this is caused by Playfab in any way, but still some advice would be appreciated.

Whenever I call LogInWithReadPermissions on iOS I get a web page with a message "App not set up: This app is still in development mode, and you don't have access to it. Switch to a registered user or ask an app admin for permissions".

I've added the user to app testers, but this message is shown before any user is logged into facebook. Do you know what do I have to setup in order for it to work? As I've said, it works without needing to be a registered tester on android.

Thank you for your time.

0 Likes 0 ·
1807605288 avatar image 1807605288 ♦ mlazowski commented ·

I apologize, but unfortunately I don't know anything about that error.

The only answers I found were about Android, but maybe it will help?:
https://stackoverflow.com/questions/30085246/app-not-setup-this-app-is-still-in-development-mode

At any rate, it sounds like a Facebook SDK setup problem, not a PlayFab SDK thing.

Good luck!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.