Link facebook account-Facebook sdk

0 votes
Hi All

My questions:

1-I want to link my facebook account to userservice account. Do I have to use facebook sdk for this? I am asking because someone from shephertz said me no need facebook sdk while I was working with appwarp. I am a bit confused.

2- I managed to logged in with facebook sdk. Where is the access token? I cannot find. Also, as far as I learned access token is temporary. So should I handle this somehow?

3- linkUserFacebookAccount(username,Accesstoken). username is the name of player which we already created right? I mean not facebook userId. here http://api.shephertz.com/tutorial/Integrating-Facebook/?index=social-fb it says username is facebook UserId!!!

4-  I also want my google plus account. There are some topics and answer for this. But I could not understand how to do it. Please provide a example.
 

Gökhan

Simge Simulation Tech.
asked Feb 26, 2016 in Unity by gokhan (20 points)
edited Feb 26, 2016 by gokhan

1 Answer

0 votes

Hi Gokhan,

Please find my answer in-line for your query:

1-I want to link my facebook account to userservice account. Do I have to use facebook sdk for this? I am asking because someone from shephertz said me no need facebook sdk while I was working with appwarp. I am a bit confused.

Ans: Yes, you are right to integrate Facebook login, you don't need to integrate Facebook SDK. Please have a look at this link which will help you to integrate Facebook login without using Facebook SDK. In order to link Facebook account with user service, could you please elaborate this more like why you want to link with user service.

2- I managed to logged in with facebook sdk. Where is the access token? I cannot find. Also, as far as I learned access token is temporary. So should I handle this somehow?

Ans: Once you login with Facebook, you will recieve access token of user in auth callnack and yes you need to verify the access token. 

3- linkUserFacebookAccount(username,Accesstoken). username is the name of player which we already created right? I mean not facebook userId. herehttp://api.shephertz.com/tutorial/Integrating-Facebook/?index=social-fb it says username is facebook UserId!!!
Ans: No, We require Facebook user id in this method to authenticate the credentials on server side. Once you call this method, you will be able to retrieve name, profile url etcin response callback. 

Note: If you have created non-acl app inside App42 dashboard, then you can pass name of player on the place of username. 


4-  I also want my google plus account. There are some topics and answer for this. But I could not understand how to do it. Please provide a example.

Ans: For google login, you need to integrate Google SDK on the client side to retrieve the access token. Once you are able to retrieve the access token, you can use this custom code to get profile of user from Google and register that user as into User service. For more details, please have a look at this link which will help you to create single session and save user profle in Storage service. 

Let me know if you need any help from my side. 

Regards,

Himanshu Sharma

answered Feb 27, 2016 by hs00105 (2,005 points)
Hi Himanshu
I guess I understood different thing from LinkUserFacebookAccount. I want to use facebook a bit different. I want user login into my game with userService(username,email and password). Then I want to offer user to link his facebook account to his normal(userService) account. So, next time when user wants to login, he or she can loggin either using his username and password or with facebook. When player choose to login with facebook, I will again get user informations as if he logged in using user service. User did not link his facebook account to any user service account but still try to log in with facebook, I will prompt "Your facebook account is not linked to any account!". Do I think different then how it is used? Or how can I achieve what I say?
Him Himanshu
You said add comment when you want to ask related questions. But I see that my questions are not responsed when I add comment.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...