Android : Google Sign In GoogleApiClient.connect()

久未见 提交于 2019-12-02 10:53:40

For Google Sign-in you might want to try starting from the Android Sign-in Quickstart and then integrating from there. If you're using Play Games Services, BaseGamesUtils can be helpful but is not required.

Next, unless you are updating / migrating a legacy Play Games Services project, remove all references to APP_STATE from your manifest and app. The App State API, used for Play Games Services, has been deprecated and may cause issues in authorization.

You indicate that your APP_ID is coming from a keytool -list call but this sounds incorrect. APP_ID corresponds to the Play Games Services application ID and is only used for Play Games Services features. You only should be running:

keytool -list -keystore ~/.android/debug.keystore

for getting a SHA-1 hash. This hash is used to register your Android application (which has package name com.example.gsignin) on the Google Developer Console.

Hope that helps, you might be best off by starting with the working sample that I pointed you to and then working from there to figure out where things are breaking.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!