Search code examples
phpiospush-notificationapple-push-notificationsapns-php

php iOS Push Notifications not working


ApnsPHP[11001]: ERROR: Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195': Connection timed out (110).

I am using http://code.google.com/p/apns-php/ this code for push notification I am trying to do a php push notification for a iphone application. I am using a linux server. I read lot of articles from net to do this but all articles are not updated all are 2 years back updated. my issue is ApnsPHP[11001] how to solve this issue please help me. some websites suggest to use entrust_root _certification_authority.pem what is this. how to get this. is this is unique for each and every websites. is https is necessary for do this. please help me.


Solution

  • https is necessary and you need to sign the connection

    the server needs your push certificate. therefore, apns-php needs the push certificate, the key to use it and the apple wwdr certificate as well.

    that is the pem the article talks about I guess. It IS specific to an app > the push certificate and key differ

    => so -- IIRC the procedure is roughly:

    1. register the app id with apple
    2. configure it for push and download the cert
    3. download the GENERAL wwdr cert
    4. import it into the keychain
    5. export the private key, the cert and the wwdr as a PEM file
    6. give the serverside access to that pem file (I didnt use apns-php but my own script so I dont know the details, but again: thats roughly it :)