I have a push notification server wrote with php apns. The app has both development and production push certificates enabled and has a valid provisioning profile created after the push service was enabled.
During testing (sandbox), the push notifications send absolutely fine to the device using the development push certificate pem file after creating it using a few steps.
I submitted the app to the app store and then updated the php apns server to use the production push certificate pem file that has been created and it says connected to apple, sending message and then disconnected (as it does in the test environment) however no push notification arrives on the app (the version downloaded from the app store).
I have confirmed that the app is sending the device ID to the php apns server and the php apns server is using the correct certificates (as it connects fine - tested with an invalid cert and it failed to connect) and it says sending message however as mentioned, nothing arrives.
Does anybody have any idea why this could happen?
Thanks!!
Related
I like to know when to use sandbox APNS (gateway.sandbox.push.apple.com) and when to use production APNS (gateway.push.apple.com) to send push notification.
Currently we are using production APNS for
app store version, and
testflight version
of the app and sandbox APNS for the local (debug) version. Is this correct?
The problem is that, although we receive push notification correctly for App Store version, we do not receive push notification for testflight and local versions.
We are using same production certificate for all the versions. Is this correct?
SandBox for apps signed with iOS Development Certificate (Debug default)
Production for apps signed with iOS Distribution Certificate (Release default, including testFlight)
Note that testFlight builds are exactly same with the AppStore builds if you don't have complete separate uploads with different version or build numbers.
The recommended approach: Send your request first to the production APNS, and when that fails, send it to the sandbox APNS. And always do that, without exception.
The reason: In practice, 99.9% of all your push notifications will be handled correctly by the production APNS. There is the 0.09% that are sent by developers, which will be handled a bit slower (one rejection followed by one success) and the 0.01% that should succeed with the production APNS but for some reason don't (instead of failing once, you try twice and fail twice).
The big advantage is that it just works. You don't have to configure your server where to send push notifications, and you don't have to configure the client to tell the server where to send push notifications. You just send the push and it works.
I am trying to implement the push notifications to my application that is currently on the store.
The old applications are working perfectly and receiving push normally with the same code on both server and app sides(OFF the sandbox).
However, when I am trying to create a production push certificate for my new application, I noticed that the push SSL certificate has changed and it seems that the development and production can now be received under 1 certificate.
However when I send the created certificate to my server side and try to send push, I am not being able to receive any one on my device and we can't figure out why! (push are sent and received successfully my APNS Pusher application)
Note that notifications are working normally when creating a developer certificate and my app is in the development mode.
Any help to receive push on production mode? what modifications did Apple Change recently and what are the required steps that should I implement to my Server/App to make it work?
PushSharp version on my server: 2.2.1
I got the same issue. By upgrading pushsharp library to 4.0.10 I fixed the issue.
I am trying to testflight my app, but when I use notifications I get an error because I have a development APN instead of a production APN. My problem is uploading it to parse. First I created a development SSL Certificate, then I went back and did a Production SSL Certificate, but I am having trouble uploading the Production Certificate because It's not an APN, rather a Apple Push Services. I also created a Distribution Provisioning (ad hoc).
Apples Push Notification service is a bit strange:
On the client side:
If you build your client with Xcode you usually build a "Debug" version of your app. In that case the registerForRemoteNotification method will create a sandbox device token for you.
If you build a "Release" version of your app the same method create a production device token for you.
On the server side:
If you have a sandbox device token you can only send a push notification to that device if you use Apples sandbox Push Notification service with your sandbox SSL certificate.
If you have a production device token then you have to use Apples production push notification service with your production SSL certificate to send a push notification to that device.
The tricky part is:
if you only have a device token you will not know if it is a production device token or a sandbox device token.
if you want to use release and debug clients against the same server, that server has to use the sandbox and the production service at the same time. And you need a mechanism to decide when to use which service.
BTW: there is a nice tutorial by Ray Wenderlich which also contains a useful PHP script for easy testing.
http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1
I've been working on an app for a while that uses push notifications from the chat module of QuickBlox.
I've been testing the push notifications on my iPad and it works fine (Developer Device). I've added both of the certificates to QuickBlox and both are active(Developer & Production).
The production devices are being registered for remote notifications and they are showing that they registered for production push notifications. When I send a message to a developer device it receives the notification and it works fine, however when I send to a production device its not received.
If I try to send a push notification to production users from the admin panel it gets sent, but non receive it. The production users are internal and external testers in TestFlight. I heard the TestFlight testers have to use a production certificate so thats why I'm registering them as so. When I archive the build going to the store I make sure that I do it using the production provisioning profile. I don't know what else to do :O
Thanks in advance
edit: I tried using push notification tester for the certificate and it worked fine. It pushed and the push notification was received to the production device. Still not working on QuickBlox
I tried to remove the certificate and then add it again, but that didn't help. I had to revoke my certificate then create a new one. After I added it, it took a good few hours until the notifications started to work. Must have been an issue with QuickBlox.
I have a problem with push notifications in development\distribution (app that talk with production server).
We have the same certificate in test and in productions servers.
When I run my app on device that talk with the test DB (I save device token by email) I'm getting notification, but when the app talk with the production server, I never get notification...
the certificate file is same on both servers
I signing the app in the same way
What can be the problem?
Use the APNs Production iOS type certificate on your production server. If you use the certificate with the same name but with the type "APNs Development iOS" it will not send push notifications.