I have push notifications working on my main development device... but it is not working for my test device (using the same application). Does the test device also need to be set up as a development device? The app works.. it just does not populate the device token up to the server. I need to be able to send the app to testers and have push notifications work for everyone.
Beware that an app built with a development provision profile, must be notified trough the sandbox-version of the PNS-service with a development push certificate. If your application is built with a distribution sertificate ( either ad hoc or App store), you must use the production PNS-service with a production push certificate.
Hope this helps:)
Related
I am using onesignal plugin for push notifications in my android and ios app so I want to test push notifications first on development side and then I will upload it on ios app store. Or is there any best practice for implementation of onesignal push notification first for testing and then distribution.
Personal opinion, you do not need separate profiles/certificates for development and production anymore in case of APNs. Recently apple has made some changes. Now you only need one '.p8' push notification certificate from your 'developer.apple.com' account. You give this .p8 file to your backend team.
Xcode will automatically manage your production and development on your side.
This is what you have to do to make it work:
For the backend:
In your app delegate, inside the function where you get APNs token from apple. This APNs token will either be development or production. How does apple decide, which one to give? Well when you export an IPA/App locally, or upload it on test flight or on App store, Xcode will automatically give you production push notification APNs. When you install IPA/App locally using xcode to a phone connected to xcode or on simulator, Xcode will automatically give you development/staing push notification APNs token inside that function. And at that point you just have to send that token to your backend.
How will backend check if the user's token they are getting is production or development?
Using your URL, if it is staging, it will consider it as development APNs token.
If it is production URL, it will consider it as production APNs token.
What you have to make sure?
Make sure the Base URL is set to production if you are uploading app to test flight.
Make sure the Base URL is set to development if you are running app locally on simulator or your phone connected to your xcode.
So i have a question to which i could not find an answer on PushWoosh API or on google.
I have integrated successfully my application to PushWoosh. For people who knows about PushWoosh you can setup the "environment" to use sandbox or production when sending the push notification.
So when i use Sandbox i can send push notifications to my device. When i choose production nothing comes up( im guessing its because i have not launched the application to the AppStore yet?)
So am i to presume that if it works on SandBox mode, i can now upload it to the appstore and switch to production mode and the push notifications should work when the app is downloadable from the appstore?
When creating the SSL Certificates i used the "Apple Push Notification service SSL (Sandbox & Production)".
Thank you for your answers..
You can test your production mode notifications before releasing it to appstore. Apple provides a mechanism for it. You need to build an AdHoc version of your App. If you are not familiar with Adhoc distribution please refer the below link
iPhone: Push Notification Testing on Production Certificate
There is no assurance that push notifications will work in production mode if they are working in sandbox mode, so you cannot presume any assumptions. Adhoc distribution is provided by apple to test production mode notifications. Please go through the below link which provides some helpful information.
https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/TestingYouriOSApp/TestingYouriOSApp.html
Let me know if you have any questions.
I have a Development APNs iOS Certificate for my new app, and from my server I am successfully sending push notifications and receiving them on own iPhone, using the device token. I have a partner in this app development, and I create an .ipa file of the app and give it to him for testing. This is called ad-hoc development. It has worked for us thus far.
From my server it looks like I am successfully sending out the push notification to his device as well as mine, using HIS device token of course (but using the same Dev APNs Cert), but he never receives the notifications. I still continue to receive my notifications. I also have registered his device in my dev center. He does not have a developer account.
So after reading up a little I am thinking that maybe with this APNs Dev certificate it is impossible to send notifications to third party devices, like my partner's device in this case. I was thinking perhaps I need to create a DISTRIBUTION certificate. Is this true? Or should the notifications work for many devices just using the APNs Dev certificate?
Thanks
Pushes go out over two environments - development and production and they are not interchangeable - i.e. if you send out a push to the Apple development server intended for a release build app it won't work and vice versa.
Apps installed and run via Xcode are debug builds and you need to send the push via the dev server, an app built for distribution is a prod build and thus the pushes need to go to the prod server.
As you are probably aware the url for the two servers is different.
Needless to say the server needs to be signed with both the prod and dev push certificates for the server to be able to send pushes on both environment.
BTW the two environments do not behave the same in terms of delivery speed etc. But this is only really noticeable for silent pushes, where bizarrely the dev environment is better than the prod one.
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 am testing push notifications with production.pem with ADHoc provisioning certificates. From server side sending successfully but device is not getting notifications. Please help me
Thank you
The Server will show success means the problem is at your side, Check the below three scenarios for this
1.) The gateway should be gateway.push.apple.com:2195
2.) You have refreshed your provisioning profile after creating APNS certificate
3.)Your Device Token is correct corresponding to the Distribution Provisioning profile
N.B If all the above things are correct,then make sure your app is in background, If your App is in foreground, then you will receive push notification, but wont be able to see it
Keep in mind that the Ad hoc testing of push notifications only works if the app was installed on a device without using xcode+usb cable to install the app on the device. The app has to be delivered to the phone with either TestFlight (or similar) or something else like diawi.com
You can check in server side.
List<PushedNotification> notifications = Push.alert("TEST TEST",keystorePath,"test", ***true***, devices); => For Distribution
For development => List<PushedNotification> notifications = Push.alert("TEST TEST",keystorePath,"test", ***False***, devices)
Check your device token. There are two device tokens. First one is when you run app with development other one is run app with production. These are difference. Use Ad-hoc device token.