Questions tagged [apns-php]

A full set of open source PHP classes to interact with the Apple Push Notification service for the iPhone, iPad and the iPod Touch.

From the project page:

A full set of open source PHP classes to interact with the Apple Push Notification () service for the devices with iOS operation system, such as iPhone, iPad and the iPod Touch.

  • Development server: api.development.push.apple.com:443

  • Production server: api.push.apple.com:443

In general APNS works in the following way:

  1. Web application sends request via HTTP/Socket connection to Apple's APNS server. The message should contain payload(what use will receive) and unique device token that was sent to the server beforehand.
  2. APNS server determines specific device and application should it sends notification to, is user allowed specific application to get the notification, etc
  3. If 2-nd item is OK, iOS receives push notification.
152 questions
17
votes
8 answers

APNS + PHP "stream_socket_client(): Failed to enable crypto"

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…
Samer
  • 973
  • 1
  • 6
  • 15
14
votes
1 answer

APNS: invalid token (8)

I am using the apns php server provided at https://code.google.com/p/apns-php/. I've have set up th push notification certificate but my code still throws an error on connect. What is wrong with this? Here is how I get the device token: -…
13
votes
4 answers

iOS swift How to create .p8 file?

I am working with Pushy Notification where I need to register with the p8 file. So how can I create that p8 file from developer account?
Kushal Maniyar
  • 846
  • 1
  • 8
  • 26
13
votes
4 answers

APNs push notification with macOS Sierra

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.…
Vinod Vishwanath
  • 5,821
  • 2
  • 26
  • 40
10
votes
2 answers

How to connect to apn with PHP using p8 auth key file

After Apple changed the APNs Auth Key to p8, the current libraries such as https://github.com/immobiliare/ApnsPHP still use old pem and cert files to connect $push = new ApnsPHP_Push( ApnsPHP_Abstract::ENVIRONMENT_SANDBOX, …
mehmetsen80
  • 727
  • 1
  • 8
  • 25
10
votes
3 answers

apns http2 api not returning status 410 after uninstalling app

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…
user1546652
  • 557
  • 1
  • 5
  • 15
10
votes
5 answers

APNS SSL operation failed with code 1

EDIT - Using the enhanced binary format Turns out I wasn't using the enhanced binary format so I changed my code.
Mark Molina
  • 5,057
  • 8
  • 41
  • 69
8
votes
5 answers

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

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 =…
Waseem Bashir
  • 638
  • 3
  • 10
  • 26
8
votes
4 answers

Some Devices Not Receiving Apple Push Notifications

I am using Apples iOS Enhanced Notification Format to send push notification in bulk, and using the PHP solution described in this post: https://stackoverflow.com/a/10059000/300129 The experience at this point is that when I send a push…
Chris
  • 5,485
  • 15
  • 68
  • 130
7
votes
2 answers

How to find the Apple Push Notification Delivered to user or not from our server?

Am new to Apple Push Notification services in iPhone app. I have learned these tutorials and apple document,…
Gopinath
  • 5,392
  • 21
  • 64
  • 97
6
votes
2 answers

Unable to connect to live 'ssl://gateway.push.apple.com:2195'

I am facing issue with APNS php code for push notification on IOS devices, I have two separate connection for Development and Production. I have configure the development connection on my server by adding the .pem file certificate and Passphares…
Iffi
  • 608
  • 1
  • 7
  • 16
6
votes
2 answers

Only from PHP: Unable to connect APNS gateway.push.apple.com:2195

It's a late night. I just spent 10 hours in google/stackoverflow search and experiments. And seems I hate Apple Push Notifications. I'm totally frustrated and will appreciate any help. Thank you. The problem: The PHP code for sending Apple Push…
gorodezkiy
  • 3,299
  • 2
  • 34
  • 42
6
votes
1 answer

ios swift creating local notification after silent notification

I am sending a silent push notification to my app, then processing the content of the push notification, before deciding whether to send a local notification to the user. However I cant fire a local notification from the app after receiving a silent…
Gmeister4
  • 754
  • 10
  • 19
5
votes
0 answers

Apple Wallet pass balance update delay

We have implemented an API service in .NET that sends background notifications to Apple Wallet to update its balance, which in turn calls below to APIs of our…
5
votes
1 answer

Push for pass on Passbook

I try send push notification on Passbook by ApnsPHP library $config['production'] = DOCROOT . '/my_cert.pm'; $config['entrust'] = DOCROOT . '/entrust_root_certification_authority_2048.pem'; $config['passphrase'] = ''; $token =…
1
2 3
10 11