How can I force Facebook Login to Web view Dialog in Android?
I am using Facebook Unity SDK for login to facebook in game which is Andorid... When I click Login on android it opens up FACEBOOK app, I want to open it in webview in game only? Is there any code? If there is then how to add it and where? Please Answer!?
Answer by liortal · Mar 13, 2017 at 10:57 AM
I am pretty sure you cannot set this from the Facebook SDK for Unity (in C# code). The best option would be to edit the underlying Android code and force it to use this particular login type.
As the project is open sourced, you can have a look at how Facebook login is implemented (for Android): https://github.com/facebook/facebook-android-sdk/blob/master/facebook/src/main/java/com/facebook/login/LoginManager.java#L63
Specifically, you can see that there's an enum called LoginBehaviour, which is responsible for dictating what the login behaviour will be (app first, webview, etc).
You can clone this repository, and modify the code to set whatever LoginBehaviour you like. Then rebuild the library into an .aar and replace the library that comes with Unity with your patched one.
But,How can I do it? Please any example or anything... I am on Facebook. I would like to talk with you. Android game Subway Surfers by $$anonymous$$iloo , have Facebook login dialog either Facebook app installed or not. It shows only Facebook Dailog. Please Anyone...
Thanks, but I am quiet low at coding these codes... Just tell :-
1) In which software I edit it (I tried making JavaScript in Unity for that and paste code, its show errors)
2) How can I edit it to open web view (I tried lot but :( failed every time)
Please Help,, and Thanks a lot for this also....
And I think loginmanager.java is in link is for Android App Facebook Login and not for Unity?? Can You directly show me how to add webview to unity android game??
Answer by alvincarter · Mar 14, 2017 at 04:29 AM
Android game Subway Surfers by Kiloo , have Facebook login dialog either Facebook app installed or not. It shows only Facebook Dailog. Please Anyone...