apns-php

APNs push notification with macOS Sierra

你说的曾经没有我的故事 提交于 2019-12-03 11:02:11
I'm trying to send my phone a push notification using the simple PHP tool which connects to ssl://gateway.push.apple.com:2195 , but the connection fails with the following errors: Warning: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in <Users/.../file.php> on line 30 Warning: stream_socket_client(): Failed to enable crypto in <Users/.../file.php> on line 30 Warning: stream_socket_client(): unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Unknown error) in

Apple Multiple Push Notifications not visible in Notifications Tray

谁说我不能喝 提交于 2019-12-03 01:48:00
I basically want to make multiple push notifications in the same application visible in the notification tray in iOS. This scenario works if my data is on while push notification is triggered via APNS, but only the latest one is received in case I am offline and come back after a while. This functionality is affirmed by APNS documentaion. However, this is what worked in WhatsApp: Turned Data Connection OFF Sent some messages to WhatsApp Turned Data Connection ON Saw multiple push notifications received in Apple's Notification Tray How's this scenario working? Can I use APNS for this? If yes,

Apple Wallet Not Auto Updating Pass

[亡魂溺海] 提交于 2019-12-02 04:30:57
Finally im able to push new changed compiled bundle. There is one issue im facing in order to see new changes. i have to go in my wallet card & disable "Automatic updates" then enable. then i can see my new compiled pass card. $result = $pdo->query($query); if($result->rowCount() > 0) { $myPass = $result->fetch(); $data = $myPass['data']; $nameFile = 'passbook_'.time().'.pkpass'; file_put_contents($nameFile, $data); $stream = function () use ($nameFile) { readfile($nameFile); }; return $app->stream($stream, 200, array( 'Content-Type' => 'application/vnd.apple.pkpass', 'Content-length' =>

Apns php error “Failed to connect to APNS: 110 Connection timed out.”

点点圈 提交于 2019-12-01 18:15:45
I have done apns code for php and objective c from this Apns code and setup certificate from this link Sandbox and production apns for sending notification to ios devices is working perfectly on my server.I moved code and same certificate to client server then sending notification is not working. I debug all php code and found that it stops at this line of code 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

Unexpected HTTP/1.x request: POST /3/device/XXXX

我们两清 提交于 2019-12-01 00:47:31
问题 Hi i am sending IOS push notifications using apns and curl in php and getting this error message. I also define 'CURL_HTTP_VERSION_2_0' but still getting this error: Unexpected HTTP/1.x request: POST /3/device/ Here is my code: $key_file = XXXXXX'; $secret = null; $private_key = JWKFactory::createFromKeyFile($key_file, $secret, [ 'kid' => '3W6B5LQQHX', 'alg' => 'ES256', 'use' => 'sig', ]); $payload = [ 'iss' => 'RUK725A7V4', 'iat' => time(), ]; $header = [ 'alg' => 'ES256', 'kid' => $private

apns http2 api not returning status 410 after uninstalling app

◇◆丶佛笑我妖孽 提交于 2019-11-29 10:49:19
Im using apns with http2 protocol for sending pushnotifications, the code i use is similar to this post: https://stackoverflow.com/a/34831873/1546652 When my app is correctly installed the apns http2 api works ok while sending messages, my reponse is something of the style : {"response":"","httpcode":200} The problem is that when i uninstall the app and send a pushnotification to the invalid registrationId i dont receive status 410 nor the response "reason:Unregistered" and still receive a true response with status 200. How can i receive 410 status and correspondig response when unistall the

APNS + PHP “stream_socket_client(): Failed to enable crypto”

微笑、不失礼 提交于 2019-11-28 20:36:09
I'm having trouble with using APNS with PHP and getting the following message: stream_socket_client(): Failed to enable crypto The problem only happens sometimes, and other times it would actually send the push. Since I have the test script on a loop of 10 iterations, I would sometimes get this: stream_socket_client(): SSL: Connection reset by peer I'm testing using the sandbox server tls://gateway.sandbox.push.apple.com:2195 Here is what I tried: I tried to reissue the PEM and all certificates with it. I played around with the request protocol sslv3:// and tls:// . I played around with the

apns http2 api not returning status 410 after uninstalling app

落花浮王杯 提交于 2019-11-28 03:56:27
问题 Im using apns with http2 protocol for sending pushnotifications, the code i use is similar to this post: https://stackoverflow.com/a/34831873/1546652 When my app is correctly installed the apns http2 api works ok while sending messages, my reponse is something of the style : {"response":"","httpcode":200} The problem is that when i uninstall the app and send a pushnotification to the invalid registrationId i dont receive status 410 nor the response "reason:Unregistered" and still receive a

ApnsPHP: Push notifications working in development but not in production

巧了我就是萌 提交于 2019-11-28 01:24:37
Yes: there are many duplicates to this question, but none of the answers helped. I am following this great tutorial by Ali Hafizji on using APNS service for push notifications . Testing APNS in development mode : download aps_development.cer export the private key for the certificate ( aps_development_key.p12 ) Then I combined the two using following commands (using terminal): openssl x509 -in aps_development.cer -inform der -out aps_development.pem openssl pkcs12 -nocerts -out aps_development_key.pem -in aps_development.p12 cat aps_development.pem aps_development_key.pem > final_aps

APNS + PHP “stream_socket_client(): Failed to enable crypto”

拈花ヽ惹草 提交于 2019-11-27 20:48:40
问题 I'm having trouble with using APNS with PHP and getting the following message: stream_socket_client(): Failed to enable crypto The problem only happens sometimes, and other times it would actually send the push. Since I have the test script on a loop of 10 iterations, I would sometimes get this: stream_socket_client(): SSL: Connection reset by peer I'm testing using the sandbox server tls://gateway.sandbox.push.apple.com:2195 Here is what I tried: I tried to reissue the PEM and all