question

wayneprim90 avatar image
wayneprim90 asked

LoginWithFacebook keeps displaying facebook window

I am implementing LoginWithFacebook. Is there a way to check if the user has previously logged in with facebook and if so doesn't have to go through the login with facebook window every time they open the app?

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

·
pfnathan avatar image
pfnathan answered

You can do this, but you need to know your player’s playfab ID

https://api.playfab.com/documentation/client/method/GetAccountInfo

the Object returns;

https://api.playfab.com/documentation/Client/datatype/PlayFab.Client.Models/PlayFab.Client.Models.UserAccountInfo it has a Facebook account attribute, which is only set if your players had previously logged in with Facebook and since this is a mobile app, you could do loginwithandroid -> which makes or loads a profile and gets them an auth token -> check for a Facebook account or loginwithIOS

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

wayneprim90 avatar image wayneprim90 commented ·

Wait, so what would my auth flow look like? Also, do I just store the Playfab ID in a PlayerPref or something?

0 Likes 0 ·
wayneprim90 avatar image wayneprim90 commented ·

I think i know what you are saying, basically I just perform login with IOS device and check if the user is connected to facebook... if not I take them to a page that makes them connect with it. If they are I can just log them in and get their info? What happens if the user decides to sell their device? If another person who bought the device downloads our game and then we log them in with that device id, wouldn't their account be linked to the other persons facebook?

0 Likes 0 ·
pfnathan avatar image pfnathan ♦ wayneprim90 commented ·

The app "install" itself can make a CustomID too, that’s how other title does it. You install, it makes an install-specific ID, then you log later and associate that with CustomID with your login. So if you reinstall the app, you need to log-in again to re-associate the account but that is it, and you save the ID in the local storage.

0 Likes 0 ·
brendan avatar image brendan wayneprim90 commented ·

Also, it's worth noting that the app will be getting a different ID for the device in the iOS case (since you're not getting the actual device ID, but a generated one that was made when the first of your apps was installed - that's why, if you uninstall all your apps and install a new one, you'll have a new ID).

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.