谷歌帐户登录集成为Android Xamarin [英] Google Account login Integration for android Xamarin
问题描述
我需要整合谷歌登录到Android应用xamarin。
至从波纹管链路代码消失> http://motzcod.es/post/67077106339/google-plus-services-login-and-1-in-xamarin-android
它显示的错误连接失败和[GooglePlayServicesUtil]谷歌Play商店丢失。
甚至ofter加入谷歌播放服务(升级Froyo)组件
连我通过波纹管链接
的https://developers.google.com/+/mobile/android/sign-in
但是这是用java代码涉及到Android蚀。
有谁能够建议我如何做到这一点的xamarin。任何提示/链接赞赏。
谢谢你。
最后,我从xamarin论坛和计算器在可用的代码做研究了一个解决方案。
我利用了OAuth2Authenticator的
-
在谷歌开发者控制台web应用,而不是安装的应用程序(机器人)寄存器*提供有效的URL重定向URL( http://abcd.com/xyz.aspx )相同应该在应用程序代码中使用。
-
在验证完成它会返回的access_token
-
通过使用的access_token使REST请求获取用户的完整信息(的https:// WWW .googleapis.com /的oauth2 / V1 /用户信息?=的access_token + accessTokenValue +。)
-
反序列化JSON响应来获得信息,对象。
*如果我们在开发者控制台注册为安装的应用程序(如
安卓)作出OAuth2Authenticator后,要求它会显示窗口
有消息请复制此代码,切换到您的应用程序和
它粘贴在那里[代码] 需要手动关闭该窗口并继续
到身份验证。得到这个web应用类型choosen的车程。
块引用>
请参阅获取更多信息。 :由谷歌帐户集成Xamarin.Android和登录Xamarin.iOS
I need to integrate google login to android xamarin application. gone through the code from bellow link: http://motzcod.es/post/67077106339/google-plus-services-login-and-1-in-xamarin-android
it shows the error connection failed and [GooglePlayServicesUtil] Google Play Store is missing. even ofter adding google play service(Froyo) component.
even i gone through the bellow links https://developers.google.com/+/mobile/android/sign-in
Android: Login using google account?
but this is related to android eclipse using java code. can anybody suggest me how to do this in xamarin. any hints/links are appreciated. thank you.
解决方案Finally i got a solution by doing the research over the available codes from xamarin forum and stackoverflow. I made use of the OAuth2Authenticator
Register in google developer console as webapplication instead of installed application(android)* provide the redirect url with valid url ("http://abcd.com/xyz.aspx") same should be used in the application code.
On authentication complete it will return access_token
By using the access_token make the REST request to get user complete information (https://www.googleapis.com/oauth2/v1/userinfo?access_token=" + accessTokenValue + ".)
Deserialize the json response to get information in object.
*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.
Refer for more info. : Login by google account integration for Xamarin.Android and Xamarin.iOS
这篇关于谷歌帐户登录集成为Android Xamarin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!