0

我正在尝试使用该firebase_messaging: ^7.0.3版本获取 FCM 令牌。获取错误getToken, error fetching instanceID: FCM 令牌会返回空值。

  static final FirebaseMessaging _firebaseMessaging=FirebaseMessaging();
  static String token;


_firebaseMessaging.requestNotificationPermissions();
      _firebaseMessaging.configure();

      token=await _firebaseMessaging.getToken();
      String token2 = await _firebaseMessaging.getToken().then((String token) {
        assert(token != null);
        print(token);
        return token;
      });
      print(token2);
4

0 回答 0