The Push Notification plugin will send out alerts ONLY if devMode is set to true.
I can't leave my production environment in development mode so I'm trying to figure out why the alerts won't send when devMode is set to false.
I have checked the PushNotifications_PushService.php
page and the logs will print out that Notified is 1 (which would be correct for my test). However, the alert never sends out. My phone never receives the alert.
My only assumption is that it deals with the APNSAdapter but that is coming from Sly/NotificationPusher. I've never worked with this class before so I'm not sure exactly how it works. Does anyone have any ideas what is going on?
UPDATE 1:
I am pretty sure the problem deals with the NotificationPusher class that the developer is importing. However, I'm not sure what is wrong with it.
Here is an issue also posted on the NotificationPusher GitHub: https://github.com/Ph3nol/NotificationPusher/issues/111
UPDATE 2:
Tested via command line using the following command: ./np push --certificate=/path/to/production_ck.pem apns deviceToken "Notification test"
This worked. No errors. Phone received alert.
Still not sure why it won't receive them from Plugin in Production Mode.
UPDATE 3:
I have placed log statements into the NotificationPusher class. I found no errors when comparing it to the "Dev" process.
I noticed when debugging the NotificationPusher project that it utilizes zendframework APNS to send the messages. My assumption is that the error must be somewhere within this project.
I found this: http://framework.zend.com/manual/1.12/en/zend.mobile.push.apns.html
In the first comment, he isn't getting any errors either but the alert is never getting to the device.
As far as the NotificationPusher project, I was able to determine that:
- It is getting the device token and the message data
- The response data is the same for both development mode and production mode. (However, the iPhone device never receives the alert message in production mode.) Still no error from code
Has anyone worked with the Zendframework? Any ideas what is going on?
UPDATE 4:
The only difference I have found so far is that the development mode uses the sandbox URL whereas the production mode uses the production mode.
What doesn't make sense is that I'm using my production certificate and it works on the sandbox URL but it doesn't work on the production URL.