我使用apns与http2协议发送推送通知,我使用的代码类似于这篇文章:https://stackoverflow.com/a/34831873/1546652
当我的应用程序正确安装时,apns http2 api在发送消息时工作正常,我的回复是这样的风格:{"response":"","httpcode":200}
问题是,当我卸载应用程序并向无效registrationId发送推送时,我没有收到状态410,也没有响应"原因:未注册",仍然收到状态为200的真实响应.
在apns http2中取消应用程序时,如何获得410状态和对应响应?
发送Apple推送通知时遇到问题.
当我只向两台设备发送消息时,一切正常.但是当我向数据库中的所有设备发送消息时,并不是所有的推送消息都被传递,但我没有得到任何设备的错误.发送还可以!
当我将消息发布到所有设备时,其中一个在第一次测试中获取消息的设备没有收到消息.
发送程序正在运行,因为我在第一次测试时在手机上收到一条消息,当我发送到所有设备时它也能正常工作.可以有任何其他问题导致这个问题吗?或者这是Apple的bug /问题.
我不知道问题是什么.有人也有这个问题吗?
我已经从这个Apns代码完成了php和Objective c的apns代码
并从此链接设置证书
用于向ios设备发送通知的沙箱和生产apns在我的服务器上运行完美.我将代码和相同的证书移动到客户端服务器,然后发送通知不起作用.
我调试所有的PHP代码,发现它停在这行代码
private function _connectSSLSocket($development) {
    $ctx = stream_context_create();
    stream_context_set_option($ctx, 'ssl', 'local_cert', $this->apnsData[$development]['certificate']);
    $this->sslStreams[$development] = stream_socket_client($this->apnsData[$development]['ssl'], $error, $errorString, 100, (STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT), $ctx);
    if(!$this->sslStreams[$development]){
        $this->_triggerError("Failed to connect to APNS: {$error} {$errorString}.");
        unset($this->sslStreams[$development]);
        return false;
    }
    return $this->sslStreams[$development];
}
apns.log文件显示错误"无法连接到APNS:110连接超时".
没有弄错.为什么我会收到此错误而不向ios设备发送通知?任何人都可以指导我吗?
我基本上想要在iOS中的通知托盘中显示的同一应用程序中进行多个推送通知.
如果我的数据在通过APNS触发推送通知时打开,则此方案有效,但在我离线并且稍后返回时仅收到最新的数据.APNS文档确认了此功能.
但是,这在WhatsApp中有效:
这种情况如何运作?我可以使用APNS吗?如果是,那怎么样?
请参阅微信中多个推送通知的示例图像.
在决定是否向用户发送本地通知之前,我正在向我的应用发送静默推送通知,然后处理推送通知的内容.但是,在收到无声通知后,我无法从应用程序发出本地通知.
这是触发静默通知后appdelegate中的代码:
func application(application: UIApplication,
    didReceiveRemoteNotification userInfo: [NSObject : AnyObject],
    fetchCompletionHandler handler: (UIBackgroundFetchResult) -> Void) {
        println("Did receive remote with completion handler")
        var localNotification:UILocalNotification = UILocalNotification()
        localNotification.alertAction = "view broadcast messages"
        localNotification.alertBody = "Hello"
        localNotification.fireDate = NSDate(timeIntervalSinceNow: 0)
        localNotification.soundName = UILocalNotificationDefaultSoundName;
        application.scheduleLocalNotification(localNotification)
        handler(UIBackgroundFetchResult.NewData)
}
但是,本地通知永远不会触发.
我启用了位置更新,后台提取和远程通知功能.
此外,当我的应用程序处于其后台状态时,它会侦听位置更新,然后在特定情况下使用本地通知向用户发出警报 - 这类似于代码.
那么为什么本地通知不会从中发出didReceiveRemoteNotification?
谢谢
我正在使用Pushy Notification,我需要在p8文件中注册.那么我如何从开发者帐户创建该p8文件?
我尝试通过ApnsPHP库在存折上发送推送通知
$config['production'] = DOCROOT . '/my_cert.pm';
$config['entrust'] = DOCROOT . '/entrust_root_certification_authority_2048.pem';
$config['passphrase'] = '';
$token = $push_info->push_token;
$text = 'TEST';
$push = new ApnsPHP_Push(
    ApnsPHP_Abstract::ENVIRONMENT_PRODUCTION, $config['production']
);
if ($config['passphrase'] <> '') {
    $push->setProviderCertificatePassphrase($config['passphrase']);
}
$push->setRootCertificationAuthority($config['entrust']);
$message = new ApnsPHP_Message();
$message->addRecipient($token);
$push->connect();
$message->setSound();
$message->setText($text);
$push->add($message);
$push->send();
$push->disconnect();
$aErrorQueue = $push->getErrors();
if (!empty($aErrorQueue)) {
    echo 'Error -  ' . print_r($aErrorQueue, true);
}
输出量
Wed, 20 Mar 2019 11:01:16 +0000 ApnsPHP[6467]: INFO: Trying tls://gateway.push.apple.com:2195...
Wed, 20 Mar 2019 11:01:17 +0000 ApnsPHP[6467]: …push push-notification apple-push-notifications apns-php passbook
我们在 .NET 中实现了一个 API 服务,该服务向 Apple Wallet 发送后台通知以更新其余额,而 Apple Wallet 又会调用以下我们服务的 API:
webServiceURL/version/devices/deviceLibraryIdentifier/registrations/passTypeIdentifier?passesUpdatedSince=tagwebServiceURLversion/passes/passTypeIdentifier/serialNumberapi.push.apple.com:443服务使用 HTTP/2 协议发送推送通知,并使用Pass Type ID 和 NFC 证书进行身份验证,每次都会成功,钱包会调用上述两个 API,从而更新余额。
然而,大约 30% 的情况下,通行证更新会出现延迟;延迟不断增加,如 1 分钟、2 分钟、10 分钟、1 小时等,然后重置。
我尝试在推送通知请求中添加一个apns-expiration值为UtcNow + 5 分钟(纪元格式)的标头,但它不起作用。
我有我的两个文件entrust_root_certification_authority.pem和server_certificates_bundle_sandbox.pem,但我不知道我应该把他们.我收到此错误:
Fatal error: Uncaught exception 'ApnsPHP_Exception' with message 'Unable to read certificate file 'server_cerificates_bundle_sandbox.pem'' 
问题:我无法访问APNS服务器.我收到110连接超时错误.
我的情况:
我用一个非常简单的PHP来测试.这是我的代码:
$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', 'apn.pem');
stream_context_set_option($ctx, 'ssl', 'passphrase', 'aaa');
$fp = stream_socket_client("ssl://gateway.sandbox.push.apple.com:2195", $err,     
      $errstr,60,STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT,$ctx);
if ($fp)
    echo ('aa');
else
    echo ($err.$errstr);