Integrating a webview inside unity to sign into facebook.

0 votes
Okay so when using the FB Leaerboard, lets just say im running it on pc now. Soon will be on android. Anyways when running the game on pc. When I go to connect to facebook it minmizes the unity game and pops open my web browser so that I can accept it to take information from facebook. I have 3 things.

1 - If say a player played the game earlier and his data is saved in the system. Is there a way when the player clicks the connecting to facebook if he has already at one time connected to facebook from this game that it wont open a web browser and will just get his infromation. So for example. The player plays the game first time on the pc. Hits play game (which would call to connnect to facebook) this would minmize the game and maxmizes a new web browser to accept that it can share with facebook. Player hits okay and such goes back to game and plays. Plays the game once around and then decides to close the game and play later. Is there a way where if the player has already said okay with facebook that it wont open another page just for it to do nothing I mean he already said okay with facebook lol.

2 - This is a hard one. Ive seen alot of webviewers inside unity. Can this be used with the call to facebook? So instead of facebook opening a web page outside the game. It will open up a small webpage inside the game. To hit okay and then exit after.

3 - If a player isnt signed in already with facebook the game just goes in a loop trying to connect to facebook and keeps saying Waiting for response. How can I get around this I try to do if statments and also while statements with bool values but didnt work. I assumed that the

FacebookService.ConnectWithFacebook();

 is the call to open the webppage up and get the players sign in.

So can you help lol. Many thanks!
asked Apr 25, 2015 in App42 Cloud API-BaaS by IslandStudio.CB (12 points)
edited Apr 26, 2015 by IslandStudio.CB
I assume you are using App42 SDK to authenticate with Facebook which uses browser to do the Auth. You can avoid this by using facebook SDK which uses its own UI widget for authentication and is quite seamless for user.  This this for details https://developers.facebook.com/docs/unity/getting-started/android

1 Answer

0 votes

Hey, For Facebook auth you can use Facebook Unity SDK. If you are building it only for Android and don't want to use Unity FaceBook SDK, you can go through with Android Facebook plugin library . It actually opens Android WebView inside your game and close it once authorization has been done.

Let me know if it helps.

Thanks

Vishnu

 

answered Apr 29, 2015 by Vishnu Garg (674 points)
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
...