question

Planet 316 avatar image
Planet 316 asked

Facebook country restriction and PlayFab LoginWithFacebook

Using the Unity SDK for PlayFab, the current game does a call to LoginWithFacebook.

On our webGL Canvas game, we tried to set the country Restricted setting to release in only a certain country to start out. However, when doing the LoginWithFacebook call, the game would stall and an account was never created.

Once we removed country restricted, the call worked perfectly fine.

I'm just curious as to if anybody else has any insight into why this might be happening. I don't think it's PlayFab, since it seems to fix when the switch is turned off, but just trying to see if I can get some info on this issue.

Thank you for any help provided.

10 |1200

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

brendan avatar image
brendan answered

What are the details of the response message you get back from PlayFab when you call LoginWithFacebook with the restriction enabled? You can run this test in Postman as a quick way to test, if you're not in a good build state.

10 |1200

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

Planet 316 avatar image
Planet 316 answered

Thanks. I'm not familiar with Postman myself, so I'll have to look into it sometime.

I tried to reproduce the issue but I'm having a difficult time doing so. It only seemed to happen when we set the country restricted setting in Facebook for the live game and someone from one of the allowed countries would try to go play the game. It would freeze when it made the loginwithfacebook call.

We had noticed that no Playfab accounts were being created and yet Facebook was claiming people were going to the game. Further testing with a contact in another Country at least confirmed that it was not going past the point of where it was suppose to be creating the account.

Once we turned off country restricted, suddenly accounts started being created without problem. Asking on Facebook, they say there isn't a reason the switch should create issues.

I'll be trying to run another test to see if I can reproduce the exact conditions (my first attempt didn't seem to create an issue).

1 comment
10 |1200

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

brendan avatar image brendan commented ·

Thanks - if you can get us details of the error message you get back, that would help to track down the issue.

0 Likes 0 ·
Dev Lumo avatar image
Dev Lumo answered

Writing to this old thread, since I didn't find another discussions about this. But we have this exactly same problem.


We are using Unity, Playfab and making game to Facebook canvas. If we set our Facebook app country restriction on, PlayFabClientAPI.LoginWithFacebook call returns "FacebookAPIError" and new user account is not created to Playfab.


When turning country restriction off in Facebook, new accounts are created without any problem. Also, login with Facebook works well even when country restriction is on, if user already have account in Playfab. So this only happens when trying to create new account to Playfab.

5 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.

brendan avatar image brendan commented ·

Can you please provide the complete error response? There will be an errorMessage member of the response with additional details.

The Facebook login requires requesting information on the user from Facebook, via the AccessToken. And because Facebook provides a different Facebook ID on a per-app basis, we use the Facebook business lookup logic (which allows us to get all Facebook IDs for the player across all your apps) to see if the player has a different Facebook ID for another of your games. It sounds like that request to Facebook is being rejected if you turn on the country restriction, but the errorMessage may provide more insight.

0 Likes 0 ·
Dev Lumo avatar image Dev Lumo brendan commented ·

Sure. Can't get this happening in test environment, so getting additional debug is a bit slow. This is pretty much all I can get, I hope this helps:

playfabError.Error = FacebookAPIError
playfabError.CustomData = (empty or null)
playfabError.HttpCode = 400
playfabError.HttpStatus = BadRequest
playfabError.ErrorMessage = (GraphMethodException - #100) Unsupported get request.

0 Likes 0 ·
brendan avatar image brendan Dev Lumo commented ·

Yes, that's the standard Facebook response for when calls to their service have been blocked by the configuration settings (you'd also get this if the player increased their privacy settings to block sharing any info). That would imply that you are blocking either the user or the service. What are the specifics of the country restriction you're setting?

0 Likes 0 ·
Show more comments

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.