2016-10-07 19 views
0

に私が(電子メール、名前、写真他のすべてが正常に動作します user.getToken() 呼び出したときにこれがあります、など。)エラー:java.lang.Exceptionを:失敗した解決方法入手トークンクラスcom.google.firebase.auth.FirebaseUser

 dependencies { 
      // make sure you have these versions by updating your local Android SDK's (Android Support repo and Google repo) 
      compile "com.google.firebase:firebase-core:9.4.0" 
      compile "com.google.firebase:firebase-database:9.4.0" 
      compile "com.google.firebase:firebase-auth:9.4.0" 
      compile "com.google.firebase:firebase-crash:9.4.0" 

      // for reading google-services.json and configuration 
      compile "com.google.android.gms:play-services-base:9.4.0" 

      // Uncomment if you want to use 'Remote Config' 
      compile "com.google.firebase:firebase-config:9.4.0" 

      // Uncomment if you want FCM (Firebase Cloud Messaging) 
      compile "com.google.firebase:firebase-messaging:9.4.0" 

      // Uncomment if you want Google Cloud Storage 
      compile 'com.google.firebase:firebase-storage:9.4.0' 

      // Uncomment if you need Facebook Authentication 
      compile "com.facebook.android:facebook-android-sdk:4.+" 

      // Uncomment if you need Google Sign-In Authentication 
      compile "com.google.android.gms:play-services-auth:9.4.0" 

     } 

私はhttps://github.com/EddyVerbruggen/nativescript-plugin-firebaseを使用していますが、入手トークンは()私が言われているとして、IOSで動作します。問題はアンドロイドでのみ持続します。

オリジナルスレッド:https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/153

答えて

0

問題がgetTokenた今getToken(forceRefresh:boolean)あり、そのためには、(署名が正しくない)エラーを説明します。

さらに、Firebaseの認証トークンを同期的に取得することができないため、プラグインAPIに新しい機能が追加されました:Fire38の認証トークンのみを含む約束を返す。認証されたユーザーを活用するためにバックエンドサーバーに送信します。

firebase.getAuthToken({ 
    forceRefresh: false 
}).then(
    function (token) { 
    console.log("Auth token retrieved: " + token); 
    }, 
    function (errorMessage) { 
    console.log("Auth token retrieval error: " + errorMessage); 
    } 
); 

リリース情報については、GitHubの問題を参照してください。

関連する問題