Did I miss something?
I've created some push notifications in Xamarin.iOS and it works perfectly with the Development certificate.
Then I created a Production certificate and it doesn't work.
Does APNS work differently in Production?
Thanks.
There are a few things to doublecheck. Make sure that:
You're using an App Store and Ad Hoc certificate to sign your app.
You're using an Apple Push Notification service SSL (Sandbox & Production) certificate on the server side
The aps-environment value in your info.plist is set to production
Related
I've tried to send push notification using "Development SSL Certificate" or the sandbox .p12 cert the iphone is able to receive notification sent from MobileFirst Operations Console.
However, when I replace the sandbox .p12 cert with the production one, I couldn't receive push notification. I even deleted the device app, remove the device from the registered list and re-register the device. But I'm still getting the same result.
Are there any additional settings needed?
MFP server version is "Product version: 8.0.0.00-20170220-1900"
Update:
From this MobileFirst tutorial Link
"The APNS production certificate can only be tested once the application that utilizes it has been successfully submitted to the Apple App Store."
What about in house distribution app/"save for Enterprise Deployment" outside of the app store?
Please make sure the push notification capability is enabled from the capabilities tab of the project target if you are deploying your application from xcode 8.0 or later.
This should be on if you deploy your application from xcode 8 or later.
For push notifications to be sent, the following servers must be accessible from a MobileFirst Server instance:
Sandbox servers:
gateway.sandbox.push.apple.com:2195
feedback.sandbox.push.apple.com:2196
Production servers:
gateway.push.apple.com:2195
Feedback.push.apple.com:2196
1-courier.push.apple.com 5223
During the development phase, use the apns-certificate-sandbox.p12 sandbox certificate file.
During the production phase, use the apns-certificate-production.p12 production certificate file.
Reference : https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/notifications/sending-notifications/#apple-push-notifications-service
Currently, I have a server that sends notifications to my Mac App. However, before I release the app I would like to be able to send push notifications to my app using the production key instead of the development (sandbox) key and use the production server. This way I can make sure everything will work fine on the App Store. I know iPhone has adhoc that allows this, but mac doesn't seem to have this option. There is a development profile, but it only works in a development (sandbox) environment. Any way to test mac app push notification in production mode?
Yes, there are ways to test APN with the Apple Push Notification service SSL (Production) certificate, although your app will then be using the production environment instead, and the entitlement will need to be changed:
com.apple.developer.aps-environment from developer to production.
Many push notification servers do not handle error responses or
dropped connections robustly. An easy way to check this is to
intentionally send a notification to a sandbox environment device
token, assuming your server is communicating with the production push
environment. Doing that should return an invalid token response and
drop the connection. To learn more about checking error responses from
the push service, please see Push Notification Throughput and Error Checking
Having two environments allows wiggle room for mishaps while you are building your app. If confident with the way in which the server sends and the app receives APN's in the sandbox then create the production certificate and send yourself a notification to ensure it's working.
Note: There is a separate persistent connection to the push service
for each environment. The operating system establishes a persistent
connection to the sandbox environment for development builds, while ad
hoc and distribution builds connect to the production environment.
We are using the development APN pem currently.
We are about to submit app to the apple store for review for distribution
Shall we change the APN pem to distribution one now or only after apple's approval?
Currently for beta testing, we are using the build that uses development APN pem
You should not change the Push Notification Cert on your server, instead you should provide one for each environment (development, production). You can create one certificate per environment for your app in the Developer Portal. This approach allows you to test your push notification code and setup from Debug-Builds as well as from AdHoc-, TestFlight- or AppStore-Builds.
I have an app that uses APNS and a server that uses SSL certificates generated by Apple member portal.
Both the app and the server are open source, and people using this solution install the server and the app in their own machines. There is no "central" server.
For others to use push notifications, they need SSL certificates that I have. What are the security implications if I share my SSL certificates (private and public) for APNS push with others?
In development everything works fine:
my app (built with Phonegap) sends the device token to the server
my server sends the notification to the Apple servers
I receive the notification on my iPhone
But, when I switched to production (enabled push notifications and created a new SSL certificate for production) I keep getting "(8) Invalid token" from Rapns (which is installed on my push notification server).
I have read that this message is probably caused because I use a development device token in production (i.e. my server use a production certificate, but the app is running in development and sends a development device token to the server).
How can I run the app in production mode, so that I get a valid device token for production?
I think I should use an Ad Hoc Distribution Provisioning profile, but even if I have changed the "Code Signing Identity" properly in Build settings, I still get the same token I was getting in development! And this obviously doesn't work.
Solved by creating an archive - instead of run - and signing it with an Ad Hoc Distribution Provisioning profile.
You may have to delete the already installed application on the device - do a xcode clean up(for a safer side) - reinstall the application.