这是我打电话的时候
user.getToken()
其他一切正常(电子邮件,姓名,照片等)。
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但是getToken在IOS中工作(据我所知)。问题仅在android中存在。
原帖:https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/153
答案 0 :(得分:0)
问题是getToken
现在是getToken(forceRefresh:boolean)
,因此解释了错误(签名不正确)。
此外,无法同步检索Firebase身份验证令牌,因此不会进一步延迟解析承诺我现在已向插件API添加了新功能:getAuthToken
,它返回仅包含Firebase身份验证令牌的承诺你可以。发送到后端服务器以利用经过身份验证的用户。
firebase.getAuthToken({
forceRefresh: false
}).then(
function (token) {
console.log("Auth token retrieved: " + token);
},
function (errorMessage) {
console.log("Auth token retrieval error: " + errorMessage);
}
);
有关发布信息,请参阅GitHub问题。