[英]Firebase OnTokenRefresh() never called?
I have a problem with Firebase Cloud Messaging. 我的Firebase Cloud Messaging有问题。 The message onTokenRefresh is not called in my Android App.
我的Android应用程序未调用onTokenRefresh消息。 It worked some time before but now I do not get a new token.
它在以前曾工作过一段时间,但现在我没有获得新令牌。
My Code: 我的代码:
public class FirebaseIDService extends FirebaseInstanceIdService {
@Override
public void onTokenRefresh() {
Log.e("Token refresh","Method called");
}
}
I initiate the method call by String fcm_token = FirebaseInstanceId.getInstance().getToken();
我通过
String fcm_token = FirebaseInstanceId.getInstance().getToken();
启动方法调用String fcm_token = FirebaseInstanceId.getInstance().getToken();
The String is null, perhaps because FCM works asynchronously. String为null,可能是因为FCM异步工作。
My Manifest: 我的清单:
<service
android:name=".FirebaseIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
Do you have any idea what is wrong? 你有什么想法吗 I also tried
FirebaseInstanceId.getInstance().deleteInstanceId();
我也尝试过
FirebaseInstanceId.getInstance().deleteInstanceId();
before. 之前。 It causes a timeout.
它导致超时。
将您的依赖项更新为com.google.firebase:firebase-core:11.0.4 com.google.firebase:firebase-messaging:11.0.4。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.