GameSalad & Playfab: Facebook Linking

Posted by

I like Facebook linking for two reasons:

  1. I can get a usable display name that I don’t have to check for inappropriate words.
  2. It allows players to move their game progress from one device to another. Even when the devices are not the same eco-system.

Of course, the integration file (attached) only calls Facebook when you call it. It is completely optional.

  1. First, add Facebook to your Cordova project by navigating to the project and typing the add plugin command. Please fill the appropriate values for “app id” and “name of app.” Do not include the less/more than symbols when you type the appropriate info.
    • cordova plugin add cordova-plugin-facebook4 –save –variable APP_ID=”<app id>” –variable APP_NAME=”<name of app>”

  2. In GameSalad, create a table named “facebook.” For now, it needs to be at least one column, but the number of rows does not matter. The data in the picture is for illustration purposes only. The integration will clear these rows out.
    • Screen Shot 2020-04-15 at 10.49.43 PM
  3. After you have called Playfab request, you can link the Facebook request at any time. In my app, I added an icon to the bar at the top, and when a person touches, they log into Facebook. I call “Post Score” with the Facebook table.
    • Screen Shot 2020-04-15 at 11.01.25 PM
  4. In the future, I will expand what I record from Facebook. Currently, I populate the table with connection status, access token, and short name (that I use as the display name).

Here is what it looks like from within the app.

Screen Shot 2020-04-15 at 10.53.35 PM

And you get an extra box in Playfab:

Screen Shot 2020-04-15 at 11.14.04 PM

Always open to questions or comments.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.