我需要将 google 登录集成到 android xamarin 应用程序。 通过以下链接的代码: http://motzcod.es/post/67077106339/google-plus-services-login-and-1-in-xamarin-android
它显示错误连接失败并且 [GooglePlayServicesUtil] Google Play Store 丢失。 甚至经常添加 google play service(Froyo) 组件。
即使我浏览了下面的链接 https://developers.google.com/+/mobile/android/sign-in
Android: Login using google account?
但这与使用java代码的android eclipse有关。 任何人都可以建议我如何在 xamarin 中执行此操作。任何提示/链接表示赞赏。 谢谢。
最佳答案
最后,我通过研究 xamarin 论坛和 stackoverflow 中的可用代码得到了解决方案。 我使用了 OAuth2Authenticator
在谷歌开发者控制台中注册为 web 应用程序而不是已安装的应用程序 (android)* 提供具有有效 url 的重定向 url ("http://abcd.com/xyz.aspx ") 应在应用程序代码中使用相同的 url。
<认证完成后返回access_token
使用access_token发起REST请求获取用户完整信息(https://www.googleapis.com/oauth2/v1/userinfo?access_token= "+ accessTokenValue + ".)
反序列化 json 响应以获取对象中的信息。
*If we registered in developer console as installed application(like android) after making OAuth2Authenticator request it will show window with message please copy this code switch to your application and paste it there [code] manually need to close the window and proceed to authentication. to get ride of this webapplication type is choosen.
引用更多信息。 : Login by google account integration for Xamarin.Android and Xamarin.iOS
关于c# - 适用于 Android Xamarin 的 Google 帐户登录集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25520180/