Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/98.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
Gcm ios后台推送通知失败_Ios_Objective C_Google Cloud Messaging_Apple Push Notifications - Fatal编程技术网

Gcm ios后台推送通知失败

Gcm ios后台推送通知失败,ios,objective-c,google-cloud-messaging,apple-push-notifications,Ios,Objective C,Google Cloud Messaging,Apple Push Notifications,当我的应用程序在前台但在后台不工作时,我可以接收推送通知 当我发送json时,其格式如下: { "data":{"message":"test ios push notification"}, "time_to_live":604800, "registration_ids":["key...."], "collapse_key":"GCM Notifications", "content_available":1, "priority":"high" } 在我的应用程序中,我在前台(后台没有

当我的应用程序在前台但在后台不工作时,我可以接收推送通知

当我发送json时,其格式如下:

{
"data":{"message":"test ios push notification"},
"time_to_live":604800,
"registration_ids":["key...."],
"collapse_key":"GCM Notifications",
"content_available":1,
"priority":"high"
}
在我的应用程序中,我在前台(后台没有任何内容):

我认为问题在于内容可用,但我不知道为什么我发送内容可用,并且返回内容可用。这是正常转换吗?

已解决 我很糟糕,我忘了在目标->功能部分启用它:

{
    aps =     {
        "content-available" = 1;
    };
    "gcm.message_id" = " whatever ";
    message = "test ios push notification";
}