繁体   English   中英

Android-Google+登录

[英]Android - Google+ login

我正在按照https://developers.google.com/+/mobile/android/sign-in?hl=pt-PT上的教程进行操作,因此在启用登录方面有一些困难。

就在第2步,我已经将代码复制到我的登录片段(在这里我的Facebook登录正常运行),并且在Plus客户端上出现错误:

- mPlusClient cannot be resolved to a variable
- The method setVisibleActivities(String, String) is undefined for the type PlusClient.Builder
- The constructor PlusClient.Builder(SplashFragment, SplashFragment, SplashFragment) is undefined

我无法理解我的失败之处,因为我已经多次阅读了本教程。

该教程已更新为英文版。 您可以从https://developers.google.com/+/mobile/android/getting-started?hl=zh-CN进行检查。 他们现在使用GoogleApiClient。

mGoogleApiClient = new GoogleApiClient.Builder(this)
    .addConnectionCallbacks(this)
    .addOnConnectionFailedListener(this)
    .addApi(Plus.API)
    .addScope(Plus.SCOPE_PLUS_LOGIN)
    .build();

该页面的葡萄牙语版本似乎尚未更新为最新的API,因此在尝试使用旧的API(此版本已弃用)时出现错误。 考虑使用英文版本

您还可以使用Social-Auth Library轻松集成多个社交平台。

SocialAuth Android是流行的SocialAuth Java库的Android版本。 现在,如果要将应用程序与多个社交网络集成,则不需要集成多个SDK。 将SocialAuth Android库集成到您的应用中后,您只需要添加几行代码即可。

社会认证

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM