1

After I set up easyAPNs and test it successfully on sandbox I got this problem on production when I try to process message queue:

Notice: APNS responded with command(8) status(8) pid(3). 1) APNS::__construct -> File: apns.php (line 34) 2) APNS::_fetchMessages -> File: class_APNS.php (line 232) 3) APNS::_iterateMessages -> File: class_APNS.php (line 404) 4) APNS::_pushMessage -> File: class_APNS.php (line 457) 5) APNS::_triggerError -> File: class_APNS.php (line 585) in /home/push/class_APNS.php on line 693

Fatal error: APNS responded with error for pid(3). status(8: Invalid token) 1) APNS::__construct -> File: apns.php (line 34) 2) APNS::_fetchMessages -> File: class_APNS.php (line 232) 3) APNS::_iterateMessages -> File: class_APNS.php (line 404) 4) APNS::_pushMessage -> File: class_APNS.php (line 457) 5) APNS::_triggerError -> File: class_APNS.php (line 591) in /home/push/class_APNS.php on line 693

I double checked my production certificate and also generated a new one, but problem persists. This error was posted on easyAPNs group but any solution was found.

2 Answers 2

2

I was having same issue and fix for me was to package the app with Distribution Provisioning certificate with option of Ad Hoc when archiving the app to install on your iOS device.

I was able to test active & uninstall status of my devices in production mode after this step.

Hope this work for you too.

Sign up to request clarification or add additional context in comments.

1 Comment

after doing some tests I noticed that the error appears only in case of sending push to a device used for development, thank you!
1

If you are testing on multiple devices, make sure you use your production push certificate and change line 34 of class_APNS.php to:

private $DEVELOPMENT = 'production'; 

and line 98 to:

private $certificate = 'file path to production ceritficate'; 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.