Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/121.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 DidReceiveEmoteNotification:fetchCompletionHandler未在后台使用内容可用标志调用(连接到XCode时调用)_Ios_Objective C_Xcode_Debugging_Apple Push Notifications - Fatal编程技术网

Ios DidReceiveEmoteNotification:fetchCompletionHandler未在后台使用内容可用标志调用(连接到XCode时调用)

Ios DidReceiveEmoteNotification:fetchCompletionHandler未在后台使用内容可用标志调用(连接到XCode时调用),ios,objective-c,xcode,debugging,apple-push-notifications,Ios,Objective C,Xcode,Debugging,Apple Push Notifications,我在推送通知方面遇到了一个非常奇怪的问题 当应用程序连接到Xcode(调试构建)时,didReceiveMemotentification:fetchCompletionHandler的行为与预期的一样 didReceiveMemotentification:fetchCompletionHandler 当应用程序位于前台时收到推送时触发 didReceiveMemotentification:fetchCompletionHandler 当应用程序位于后台时收到推送时触发 didReceiv

我在推送通知方面遇到了一个非常奇怪的问题

当应用程序连接到Xcode(调试构建)时,
didReceiveMemotentification:fetchCompletionHandler
的行为与预期的一样

  • didReceiveMemotentification:fetchCompletionHandler
    当应用程序位于前台时收到推送时触发
  • didReceiveMemotentification:fetchCompletionHandler
    当应用程序位于后台时收到推送时触发
  • didReceiveMemotentification:fetchCompletionHandler
    接收推送并通过通知中心打开应用程序时触发(从推送)
但是,当我不使用xcode在手机上构建应用程序时:

  • didReceiveMemotentification:fetchCompletionHandler
    is
    当应用程序位于前台时收到推送时触发
  • didReceiveMemotentification:fetchCompletionHandler
    不是 当应用程序位于后台时收到推送时触发
  • didReceiveMemotentification:fetchCompletionHandler
    is
    接收推送并通过通知中心打开应用程序时触发(从推送)
使事情进一步复杂化:

出于某种不虔诚的原因,这一切都停止了。然后,只是随机地,它似乎自行修复了(这都是在24小时内完成的)。然而,大约5分钟前,它再次停止工作。我的一些用户似乎也在经历同样的事情,而其他人则很好

我想生产推送证书可能有问题,但为什么我要接受推送呢?我在这里完全迷路了

PS:消息有效负载模板:

{
    aps =     {
        alert = "<message>";
        badge = 1;
        "content-available" = 1;
        sound = "layerbell.caf";
    };
    layer =     {
        "<convoId>";
        "<messageId>";
    };
}
{
aps={
警报=”;
徽章=1;
“可用内容”=1;
sound=“layerbell.caf”;
};
图层={
"";
"";
};
}

请注意这与终止状态无关。我知道如果应用程序被终止,将不会调用
didReceiveEmotentification:fetchCompletionHandler
。这不是问题所在。

我敢打赌这是您的配置文件和设备上使用的证书之间的断开连接,但是如果您确定已正确设置(使用dev cert发送dev通知,prod for prod),那么您确定服务器正确发送通知吗?你能用苹果公司的APNS接收回复进行验证吗?@remus感谢回复。有效负载来自称为Layer的第三方聊天框架。我非常确定他们的服务器发送的数据是正确的(请记住,我也会收到推送)。我会再次检查配置文件,但是,这无法解释为什么我的一些用户在Testflight中会出现这种情况。我只是想提供帮助。嗨,你成功解决了吗?@AXE不幸的是,我停止了这个项目的工作,但我认为我从未解决过这个问题。我一直在为我正在进行的其他项目使用更为更新的ios sdk,但我还没有遇到这个问题。