Android:為沒有 Google Play 服務的用戶登錄 Google? (Android: Google signin for a user without Google Play Services?)


問題描述

Android:為沒有 Google Play 服務的用戶登錄 Google? (Android: Google signin for a user without Google Play Services?)

有沒有一種不需要 Google Play 服務即可實現 Google 登錄的方法?我知道官方文檔說您需要 GPS:

https://developers.google.com/identity/sign‑in/android/start‑integrating

但是我在這裡也發現了相互矛盾的信息:

沒有 Google Play 服務的 Google Plus 登錄

這表示使用 Google+ Api 您可以在用戶沒有 GPS 的情況下實現登錄。哪個是真的?您是否可以在沒有 GPS 的情況下從技術上實現登錄?如果可以的話,它會很好地用作因任何原因無法下載 GPS 的用戶的後備。


參考解法

方法 1:

You can use the Android Account Manager to get an access token (if the user has signed in with his/her Google Account on the phone):

If that is not what you want, you can always sign a user in using pure OAuth2 through a WebView. Here are some resources to get you started:

If you choose to use a webview you will have to handle access/refresh tokens manually, which might or might not be convenient for you.

Good Luck!

Edit: You mentioned G+ in your post, so here is some information on how to add G+ scopes to your request:

(Choose a scope that you need and include it in your request for access/refresh token)

(by JonErik Zivkovic)

參考文件

  1. Android: Google signin for a user without Google Play Services? (CC BY‑SA 2.5/3.0/4.0)

#android-googleapiclient #google-play-services #Android #google-signin #google-plus-signin






相關問題

Scope 在 GoogleApiClient 中的作用是什麼? (What does Scope do in GoogleApiClient?)

Android studio - 將 GCM api 更新為 Google 服務 (Android studio - updating GCM api to Google services)

Android:為沒有 Google Play 服務的用戶登錄 Google? (Android: Google signin for a user without Google Play Services?)

GoogleApiClient onConnected 未被調用,在服務中使用 (GoogleApiClient onConnected not being called, using in a Service)

從 Play 商店安裝應用程序後嘗試使用 Google 登錄時出現“使用 Google 進行身份驗證時出錯:未知”異常。閱讀詳情 (Getting 'Error authenticating with Google: unknown' exception when trying to signin with google after installing app from play store. See details)

Android google Sign In 總是顯示 handleSignInResult:false (Android google Sign In always shows handleSignInResult:false)

Android Google Play 遊戲服務 (Android Google Play Games Services)

android - 即使沒有可用的互聯網,也會調用 onLocationChanged (android - onLocationChanged is called even when there is not internet available)







留言討論