Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/117.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
无法通过sendToDevice在iOS上获取通知,可能是使用Firebase notification Composer_Ios_Firebase_Firebase Cloud Messaging_Apple Push Notifications - Fatal编程技术网

无法通过sendToDevice在iOS上获取通知,可能是使用Firebase notification Composer

无法通过sendToDevice在iOS上获取通知,可能是使用Firebase notification Composer,ios,firebase,firebase-cloud-messaging,apple-push-notifications,Ios,Firebase,Firebase Cloud Messaging,Apple Push Notifications,我的iOS应用程序可以接收Firebase Notification Composer创建的通知。当我通过代码发送通知时,它无法接收。不会触发AppDelegate的回调或重写。当我从Composer发送它时,将按预期调用userNotificationCenter 当我在Firebase控制台中切换项目并使用不同项目的通知编写器时,不会收到通知。为此,我假设项目关联是正确的,并且iOS SDK设置正确,可以使用正确的身份验证凭据资源(如APNs密钥)侦听正确的项目 在发送方方面,我使用这个简单

我的iOS应用程序可以接收Firebase Notification Composer创建的通知。当我通过代码发送通知时,它无法接收。不会触发AppDelegate的回调或重写。当我从Composer发送它时,将按预期调用userNotificationCenter

当我在Firebase控制台中切换项目并使用不同项目的通知编写器时,不会收到通知。为此,我假设项目关联是正确的,并且iOS SDK设置正确,可以使用正确的身份验证凭据资源(如APNs密钥)侦听正确的项目

在发送方方面,我使用这个简单的代码发送通知。我可以在Composer中使用相同的fcm_令牌来接收消息,因此我还假设fcm_令牌是正确的

      var payload = {
        data: {
            title: "Welcome to My Group",
            message: "You may have new messages"
        }
    };
    admin.messaging().sendToDevice(<fcm_token>, payload);
var有效载荷={
数据:{
标题:“欢迎加入我的团队”,
消息:“您可能有新消息”
}
};
admin.messaging().sendToDevice(,有效负载);
我的项目还向webapps发送通知。上面相同的代码发送的消息可以被我的web应用程序接收,因此我确信消息也正确发送

有人知道由notification Composer创建的通知与使用sendToDevice创建的通知之间的区别吗