偉大的鏈接:Ionic Google Authentication
插件鏈接:enter link description here
你並不需要把webClientId在GooglePlus.login()
。
您的登錄方法應該是(如果沒有其他選項) -
GooglePlus.login({}).then((res) => {
console.log(res);
}, (err) => {
console.log(err);
});
的iOS
你需要把REVERSED_CLIENT_ID
在3210於iOS。
<plugin name="cordova-plugin-googleplus" spec="~5.1.1">
<variable name="REVERSED_CLIENT_ID" value="com.googleusercontent.apps.967272422526-vu37jlptokv45glo2kciu9o2rddm7gte" />
</plugin>
要找到你REVERSED_CLIENT_ID
,在開發者控制檯去憑據,然後單擊上創建的iOS憑證和Download Plist
。
的Android
爲Android,你不需要任何的ID,它適用於Signing-certificate fingerprint
,請確保您Signing-certificate fingerprint
和Package name
是正確的,同時創造oauth client id
。
如果你不與任何創建密鑰庫文件簽名apk文件,然後採取默認debug.keystore文件SHA-1 signing-certificate fingerprint
。
keytool -exportcert -keystore C:\Users\Username\.android\debug.keystore -list -v
我已經使用了debug.keystore
(windows)的最常用路徑。它可能會有所不同,只需查找.android
dir即可。
你想獲得'idToken'或'serverAuthCode'嗎?或者它只是簡單的用戶認證? –
不要刪除答案。我會測試,並會讓你知道。我正在等待我的後端開發者的反饋。之後,我會給你一個反饋。我想,你的回答是正確的我的簡單用例。 @SwapnilPatwa – Sampath
好的,我以爲我錯過了'idToken'部分並感到困惑。 –