Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 我不知道';我得不到;onPushTokenReceivedCallback当;我用我的电话_Ios_Firebase_Push Notification_Notifications_Nativescript - Fatal编程技术网

Ios 我不知道';我得不到;onPushTokenReceivedCallback当;我用我的电话

Ios 我不知道';我得不到;onPushTokenReceivedCallback当;我用我的电话,ios,firebase,push-notification,notifications,nativescript,Ios,Firebase,Push Notification,Notifications,Nativescript,当我使用iphone时,我没有得到代币。当我使用模拟器时,我得到了令牌。 我使用nativescript firebase插件,并在main.js中执行firebase.init函数 我已经尝试了我在这个错误上发现的一切,或者我甚至不知道这是否是一个常见的错误。完整init如下所示 firebase.init({ showNotifications: true, showNotificationsWhenInForeground: true, onPushTokenReceived

当我使用iphone时,我没有得到代币。当我使用模拟器时,我得到了令牌。 我使用nativescript firebase插件,并在main.js中执行firebase.init函数

我已经尝试了我在这个错误上发现的一切,或者我甚至不知道这是否是一个常见的错误。完整init如下所示

firebase.init({
  showNotifications: true,
  showNotificationsWhenInForeground: true,

  onPushTokenReceivedCallback: (token) => {
    console.log(`onPushTokenReceivedCallback: ${token}`);
    appSettings.setString('firebasemessagekeytoken', token);
  },

  onMessageReceivedCallback: (message) => {
    console.log(`onPushTokenReceivedCallback: ${message.title}`);
  }
})
  .then(() => {
    console.log('[Firebase] Initialized');
  })
  .catch(error => {
    console.log(`error: ${error}`);
  });```

你看到权限对话框了吗?您是否尝试了
getCurrentPushToken()
方法?是的,我尝试了,但什么也没看到,我只使用了````。然后(()=>{console.log('[Firebase]Initialized');})``它是生产版本还是调试版本?你在Firebase设置上配置了基本证书了吗?它在模拟器上工作,在模拟器上我得到了令牌,我可以收到通知。我已经做了所有我认为正确的事情,我已经做了,这样我就可以用邮递员向设备令牌发送消息。所以我不明白为什么我在使用iphone时得不到代币。我插上iphone,tns运行了吗?设备(id)我在终端“6.9.0”中也得到了这个消息-[Firebase/Messaging][I-FCM001000]启用了FIRMessaging远程通知代理,将关闭远程通知接收器处理程序。如果您希望手动集成Firebase消息,请将“FirebaseAppDelegateProxyEnabled”添加到您的Info.plist中,并将其设置为否。按照以下说明操作:````