question

xundao2018 avatar image
xundao2018 asked

What is correct way to create a friction free sign up process?

Hi Sir,

When my game starts, there is no login button, I just did a silent guest login with device id. And the player can start playing the game right away.

Now, I want to incorporate Facebook login so players can click this Facebook login button to do the login and on the backend, I can link the Facebook login to the previously created guest account.

However, I am not sure how to link these two accounts. I know there is a API call LinkFacebookAccount. And I saw your code in this post: https://community.playfab.com/questions/7793/linkfacebookaccount-forcelink.html But I am not sure where to put this code in.

And if I did use LinkFacebookAccount to link the Facebook account with the guest account. What should be the flow when player starts the game to login to Facebook?

Looks like we need a clear flow to do these things.

Thanks.

apisAccount Managementfeedback
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

Yes, a zero-friction account creation step as part of your FTUE is our recommendation (https://api.playfab.com/docs/tutorials/landing-players/best-login). There's actually a flow diagram in that tutorial showing the recommended logic for linking something like a Facebook account to the Device ID-created account. One thing, though - we would not recommend using ForceLink by default. Bear in mind that the "core" of the player account - the part with the authentication links - lives at the Publisher ID level, so that your players can have simple, consistent sign-in across all your games (so, logging in using the same Facebook account always gets them to the same PlayFab ID). Using ForceLink would risk removing the Facebook link from an account you didn't intend to unlink.

10 |1200

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

xundao2018 avatar image
xundao2018 answered

Thanks Brendan,

A further question about my implementation:

This the code I used to try to bind Facebook with iOS guest account:

PlayFabClientAPI.LoginWithIOSDeviceID(newLoginWithIOSDeviceIDRequest(){
TitleId =PlayFabSettings.TitleId,
DeviceModel =SystemInfo.deviceModel,
OS =SystemInfo.operatingSystem,
DeviceId =SystemInfo.deviceUniqueIdentifier,
CreateAccount =true,
InfoRequestParameters =InfoRequestParams
},(result)=>{
//StoreIdentityand session
_playFabId=result.PlayFabId;
_sessionTicket=result.SessionTicket;


//checkifwewanttogetthiscallbackdirectlyorsendtoeventsubscribers.
if(callback==null&&OnLoginSuccess !=null)
{


varrequest=newLinkFacebookAccountRequest
{
AccessToken =AuthTicket,
ForceLink =false
};
PlayFabClientAPI.LinkFacebookAccount(request,null,null,null);

//reportloginresultbacktothe subscriber
OnLoginSuccess.Invoke(result);
}elseif(callback !=null)
{
//reportloginresultbacktothe caller
callback.Invoke(result);
}
},(error)=>{
//reporterrrobacktothe subscriber
if(callback==null&&OnPlayFabError !=null){
OnPlayFabError.Invoke(error);
}else{
//makesuretheloopcompletes,callbackwith null
callback.Invoke(null);
//Outputwhatwentwrongtotheconsole.
Debug.LogError(error.GenerateErrorReport());
}
});

But the AuthTicket is empty.

What did I do wrong? I think the article said once logged in with iOS Device ID, use LinkFacebookAccount, but it is not working.

Did I put the code in a wrong place?

Thanks a lot

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.

brendan avatar image brendan commented ·

The AuthTicket is something you have to get from Facebook - we don't control the player's Facebook account. There's a link in our documentation page (https://api.playfab.com/documentation/client/method/LinkFacebookAccount) that points to the Facebook documentation on how to get it.

0 Likes 0 ·
xundao2018 avatar image xundao2018 commented ·

Thanks Brendan. I am now able to get the link features. Cheers.

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.