Sign In Register

How can we help you today?

Start a new topic
Answered

Merging accounts

Hello, 


We have recently been looking through several  MBaaS and in the end decided that GameSparks has the right tools for our team. In our upcoming game, I would like to make the registration process for the player as streamlined as possible, by this I mean that I don't want the player to take time filling account information or having to wait for my game to link his account to FB/G+. 


After reading through the Docs, it seemed that DeviceAuthenticationRequest does what I need, but it created an anonymous account that can be linked to FB and I suppose G+. The problem there is that DeviceAuthenticationRequest seems to not be mergable with RegistrationRequest as stated in the docs because both create separate accounts. Additionally I would like to let the player link/unlink accounts as needed. I did read through an older topic about unlinking and it seemed that its not possible currently, is that still the case?


Now my question is, is it possible to create an account with DeviceAuthenticationRequest and then let the player decide wither he/she would like to " create " an account or link it to FB/G+ and vice versa. Please provide more information/examples/etc on this subject, thanks in advance.


Ali Abdul-Karim

Marimo Games


Best Answer

Hi Ali,


The ability to merge a Registered account with a Device Registered account is coming in the next release of features along with the ability to unlink a social account, that should be next week at some point.


We do however already support linking Google+ accounts to user accounts, you can find out more information about that at GooglePlusConnectRequest and a quick tutorial on how to set it up is available: How to authenticate a player using their Google+ account


Shane


On our side we simply call the following code on the click callback of a "link account to Facebook" button:

  

        public void Login (LoginCallback succesCallback)
        {
            if (!FB.IsLoggedIn) {  
                FB.Login ("email,publish_actions,user_friends", delegate(FBResult result) {
                    if (result.Error != null) {
                        DebugLog.AddEntry ("Login result.Error : " + result.Error);
                    }
                    if (FB.IsLoggedIn) {
                        LinkCloudAccountToFacebook (FB.AccessToken, delegate() {
                                succesCallback ();
                        });
                    }                                                                                      
                }); 
            } else {
                LinkGSAccountToFacebook (FB.AccessToken, delegate() {
                        succesCallback ();
                });
            }
        }
        
        private void LinkGSAccountToFacebook (string accessToken, LinkGSAccountToFacebookCallback callback)
        {
            new FacebookConnectRequest ().SetAccessToken (accessToken).Send ((response) => {
                if (response.HasErrors) {
                    string at = response.Errors.GetString ("accessToken");
                    if (at != null && at.Equals ("ACCOUNT_ALREADY_LINKED")) {
                        callback ();
                    } else {
                        Debug.LogWarning ("Unable to link gs account with Facebook. Response : " + response.ToString ());
                    }
                } else {
                    callback ();
                } });
        }

  

Thats nice, but what about linking an acount created by DeviceAuthenticationRequest to an account where the player specifies the username and password themself ? Additionally I suppose you guys have similar functions for linking accounts to a google accounts for players ? Thnaks for your time.


-Ali

Answer

Hi Ali,


The ability to merge a Registered account with a Device Registered account is coming in the next release of features along with the ability to unlink a social account, that should be next week at some point.


We do however already support linking Google+ accounts to user accounts, you can find out more information about that at GooglePlusConnectRequest and a quick tutorial on how to set it up is available: How to authenticate a player using their Google+ account


Shane

Hello Shane,


well this essentially answered all my questions, I can't wait for next weeks update :D.


-Ali

I have just been looking for this information and glad to hear it's upcoming. We are going to be providing the same flow in-game and we definitely won't be using facebook/G+ to start with.


Has this functionality been released yet? I see from the thread that it's been several weeks since the original answer.


Thanks,

- Toby

Hi Toby,


We still currently do not support merging a Device Account with a Registered Account. However, both types of account can be used in conjunction with Facebook, Google or Twitter when the time comes that you do wish to integrate social features to your game.


A user who authenticates with their Facebook account can also link a Google or Twitter account without problem. If a user want's to disconnect a social service from their account you can call for a SocialDisconnectRequest .which looks like


 

{
 "@class": ".SocialDisconnectRequest",
 "systemId": "systemId"
}

 

With systemId being "FB" for Facebook, "TW" for Twitter and "GP" for Google+.


Shane


Any update on the account merging?

If not available yet, could be possible, instead, to create a registered account with a temp username and password and later change these data?

I could store username and password in an encrypted form and login automatically the user until the user will decide to create a proper account.

Thanks.

We now support "upgrading" of an account that has DeviceAuthenticationRequest set on it. This is achieved by doing a ChangeUserDetailsRequest assigning the user new userName and password, however this change is one way, meaning from then on, the user can use AuthenticationRequest but not DeviceAuthenticationRequest.


Mantas

Login to post a comment