晚上好!
我希望将Firebase云消息添加到我的项目(Android,Java)中。我已经按照文档找到了tee,但是检索消息令牌仍然有问题。Android声称无法解析“FirebaseMessaging”中的“getToken”方法,并且不会编译。我假设我需要编写一个方法getToken(),但是找不到关于该方法应该做什么的任何文档。
这里是我的类,它像文档所描述的那样扩展了FirebaseMessagingService。
public class PushNotificationManager extends FirebaseMessagingService {
public
我想要解码给定的token.My问题是找不到jwt-解码。现在我正在使用这个npm安装jwt-解码器,
安装完成后,这个模块在这里调用,我们在其中使用如下所示的组件
var jwtDecode = require('jwt-decode');
after that i am calling in
componentDidMount(){
this.getToken()
}
getToken(){
var token ='eyJ0eXAiO.../// jwt token'
我在我的Android应用程序中使用Google和Facebook登录。我发现还谈到过一段时间后就会失去与Firebase数据库的连接,这种情况一直在发生。我运行了下面的代码和“完成的刷新令牌”。永远不会被印出来。
Log.d(TAG, "Start token refresh.");
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); // mAuth is your current firebase auth instance
user.getToken(true).addOnCompleteLi
我想在开始url中传递FCM令牌。我的代码并不是每次都能工作,我认为需要延迟,但我不能处理它。下面的代码并不是每次都能工作,因为有时TWA会在建立firebase连接之前启动: public class LauncherActivity
extends com.google.androidbrowserhelper.trusted.LauncherActivity {
public static String x = null;
@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(
这可能是我第一次使用登录和注册在颤振。虽然这很好用,但是当我尝试使用authentication_token时,我很难理解为什么SharedPreferences不会存储到我的本地存储中。每次尝试访问令牌时,都会得到以下错误:
Unhandled Exception: type 'String' is not a subtype of type 'int' of 'index'
E/flutter (16224): #0 Network.getToken
package:eatiano_app/…/network_utils/authe