2017-07-20 6 views
0

私のアプリにg + loginを統合しようとしています。 ionic plugin add cordova-plugin-googleplus --variable REVERSED_CLIENT_ID=myreversedclientidandroid device(ionic 2)のionic-native googleplusログインに関する問題

console.developers.google.comから生成された逆にクライアントIDを使用:使用したイオン-navtiveジープラスプラグインをインストールし

まず、私は、以下の手順に従ってきました。そのフォーマットはxxxxxxxx-xxxxxxxxx.apps.googleusercontent.comです。

ログインボタンをクリックすると、g +ネイティブコールが試行されます。ここに私のTSコードです:

googleLogin() { 
    this.googlePlus.login({ 
     'webClintId':'xxxxxxxx-xxxxxxxxx.apps.googleusercontent.com ', 
    }).then((res) => { 
     alert("Login successfull: " + res); 
     this.navCtrl.setRoot(HomePage); 
    }).catch((err) => { 
     alert("Login unsuccessfull: " + err); 
    }); 
} 

そのブロックと印刷エラーしようとして、上記のコードを試して:私は、その後17

ログイン成功しなかったがhttps://ionicthemes.com/tutorials/about/ionic2-google-login

+0

デベロッパーコンソールで 'Android Signing Certificate SHA-1'を設定しましたか? – hrdkisback

答えて

0

webClientIdをGooglePlus.login()に入れる必要はありません。

ログインの方法は、(追加オプションなしの場合)でなければなりません -

GooglePlus.login({}).then((res) => { 
    console.log(res); 
}, (err) => { 
    console.log(err); 
}); 

のiOS

あなたは、iOS用​​3210でREVERSED_CLIENT_IDを配置する必要があります。

<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をクリックしてください。あなたが任意のIDを必要としないAndroid向けのAndroid

enter image description here

が、それはSigning-certificate fingerprint上で動作、oauth client idを作成中Signing-certificate fingerprintPackage nameあなたが正しいことを確認します。

enter image description here

あなたが任意の作成したキーストアファイルを使用してAPKに署名されていない場合、デフォルトのdebug.keystoreファイルのSHA-1 signing-certificate fingerprintを取ります。

keytool -exportcert -keystore C:\Users\Username\.android\debug.keystore -list -v 

私はdebug.keystore(ウィンドウ)の最も一般的なパスを使用しています。それはあなたのために異なるかもしれません、ちょうど.androidディレクトリを探してください。

+0

提案したとおりに完了しましたが、エラーは同じです。 –

+0

アンドロイドでこのエラーが発生していますか? –

+0

はい、私がアンドロイドデバイスでアプリケーションを実行すると –

関連する問題