加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – Google帐户登录Android Xamarin集成

发布时间:2020-12-15 03:59:00 所属栏目:百科 来源:网络整理
导读:我需要将google登录结合到 android xamarin应用程序. 来自bellow链接的代码: http://motzcod.es/post/67077106339/google-plus-services-login-and-1-in-xamarin-android 它显示错误连接失败,[GooglePlayServicesUtil] Google Play商店丢失. 甚至添加谷歌播
我需要将google登录结合到 android xamarin应用程序.
来自bellow链接的代码:
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

Android: Login using google account?

Google Login For Android App

但这是关于android eclipse使用java代码的.
有人可以建议我如何在xamarin这样做.任何提示/链接都不胜感激.
谢谢.

解决方法

最后,我通过对来自xamarin论坛和stackoverflow的可用代码进行研究得到一个解决方案.
我使用了OAuth2Authenticator

>在google开发者控制台中注册为web应用程序而不是安装的应用程序(android)*提供带有有效url(“http://abcd.com/xyz.aspx”)的重定向网址,应该在应用程序代码中使用.
>验证完成后将返回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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读