Suc*_*ith 9 .net c# monodevelop xamarin.android xamarin
我需要将google登录集成到android xamarin应用程序中.通过以下链接的代码:http: //motzcod.es/post/67077106339/google-plus-services-login-and-1-in-xamarin-android
它显示错误连接失败,并且缺少[GooglePlayServicesUtil] Google Play商店.甚至还加入了谷歌播放服务(Froyo)组件.
即使我经历了波纹管链接 https://developers.google.com/+/mobile/android/sign-in
但这与使用java代码的android eclipse有关.任何人都可以建议我在xamarin中如何做到这一点.任何提示/链接表示赞赏.谢谢.
Suc*_*ith 21
最后,通过对来自xamarin论坛和stackoverflow的可用代码进行研究,我得到了一个解决方案.我使用了OAuth2Authenticator
在google开发者控制台中注册为webapplication而不是已安装的应用程序(android)*提供带有效url(" http://abcd.com/xyz.aspx ")的重定向url 应该在应用程序代码中使用.
在身份验证完成时,它将返回access_token
通过使用access_token发出REST请求以获取用户的完整信息(https://www.googleapis.com/oauth2/v1/userinfo?access_token="+ accessTokenValue +".)
反序列化json响应以获取对象中的信息.
*如果我们在制作OAuth2Authenticator请求后在开发者控制台中注册为已安装的应用程序(如android),则会显示带有消息的窗口, 请将此代码切换复制到您的应用程序并将其粘贴到那里[代码]手动需要关闭窗口并继续进行身份验证.选择这个webapplication类型的选择.
请参阅更多信息.:通过google帐户集成登录Xamarin.Android和Xamarin.iOS
| 归档时间: |
|
| 查看次数: |
9012 次 |
| 最近记录: |