When i test Push Notification with apn_development_cer, it works with the loaded app on the iPhone device from Xcode.
But, when i am downloading the same application from App Store or with the Ad Hoc Distribution on the same iPhone device from Xcode, it just stops sending Push Notification with apn_production_cer.
Thanks in advance!
Vivek Dandage
Are you using sandbox (development) environment which is available through gateway.sandbox.push.apple.com, port 2195 ? For app store build, you will need production environment which is available through gateway.push.apple.com, port 2195;
Related
Push Notifications are not delivering to apps deployed via Xcode, but work perfectly when build is deployed via TestFlight? What could this problem be?
The iPhone Simulator is unable to receive push notifications or successfully register for them.
But, you can create a local APNS file and test PN on the simulator. Check this;
https://betterprogramming.pub/how-to-send-push-notifications-to-the-ios-simulator-2988092ba931
When I test the app using a TestFlight version built by the CI machine, the device receives push notifications.
But when I rebuild the app under Xcode locally with the debugger connected, the device doesn't receive any push notifications.
To validate things further I again tested locally with a push notifications tester, and the device indeed received a push notification.
So the code isn't omitted due to it being a #DEBUG build as the grant and registrations pass.
What is my local build possibly missing?
When you build your app in debug locally your app will generate a unique device token that doesn't receive production push notifications. When you build your app with a distribution provisioning profile it generates a different device token that does work on production.
Apple will reject a development device token unless you are specifically requesting a push notification using your APNS Sandbox certificate.
So if you haven't already you'll have to go through the certificate creation process all over again but this time for a sandbox certificate and use that one instead.
The solution ended up being that our server with the Houston gem needed to configure its APNS support to be in development mode, and not in production mode. đź‘Ť
We have created project in Mobile Hub and manage AWS Pinpoint to send push notification in iOS devices and setup AWS Pinpoint console for push notification. We have uploaded development certificate .p12 and download the demo app from our application(project) which is created using 'AWS Mobile Hub' web service(Screen shot attached). We are getting notification while installing it from adhoc IPA. But, We are unable to get notification when we are installing directly from Xcode into my device.
So, how to get notification when app install/run directly from Xcode ?
Thanks
Previously, the Pinpoint console didn't support sending push notifications via the APNs Sandbox development environment.
Note: This feature was supported earlier only by invoking the API (not through the console). You can make a call to the API to do the following:
To register the APNs Sandbox Channel.
Register a device as an APNs Sandbox endpoint.
Send messages/campaign pushes to it.
As of yesterday (10/03/2017) Pinpoint fully supports APNs Sandbox environment through the console as well. In order to register a device as an APNs Sandbox endpoint, use the latest version of the AWS iOS SDK (v2.6.2 or above) and enable the debug flag. This corresponds to the Sandbox development environment.
You can enable the debug flag by using the following code snippet
AWSPinpointConfiguration *config = [AWSPinpointConfiguration defaultPinpointConfigurationWithLaunchOptions:launchOptions];
[config setDebug:YES];
AWSPinpoint *_pinpoint = [AWSPinpoint pinpointWithConfiguration:config];
I have built a application in Xcode 7 with Push Notification using test- flight in development. I also have a created a script to push notification to the devices using the token of the devices that I stored in a database.
I simple flag the devices in the database and my scripts read the tables and send a notification to the device(s). Works!
All was well until xcode8.
Now The only way the scripts work is if I "attach" the devices to the mac and build and install the app using the attached cable. I then detached the devices and the scripts works.
If I "archive" the app to iTunes and then using test flight as an external user, i then install the app from test flight, I never get a notification when I run the scripts.
So basically, If I attached the device locally and build, install using a cable it works great. but if uploaded to iTunes and using test flight it does not.
below is as much screen shots
/Users/webcastman/Desktop/Screen Shot 2016-10-26 at 1.55.39 PM.png
/Users/webcastman/Desktop/Screen Shot 2016-10-26 at 2.14.20 PM.png
/Users/webcastman/Desktop/Screen Shot 2016-10-26 at 2.15.12 PM.png
/Users/webcastman/Desktop/Screen Shot 2016-10-26 at 2.16.13 PM.png
The first step in sending a remote notification is to establish a connection with the appropriate APNs server link:
•Development server: api.development.push.apple.com:443
•Production server: api.push.apple.com:443
When you are installing app in your device through Xcode, I think its build using development provision profile if you have selected Automatic in codesign settings. and when you are archiving and uploading on testflight its build using Distribution profile.
You need to customize your script to send notification for development and distribution(Production) app.
When you are installing app in your device through Xcode, I think its build using development provision profile.
if you are using gateway.sandbox.push.apple.com, port 2195, change it with production url.
•Sandbox: gateway.sandbox.push.apple.com, port 2195. (for development)
•Production: gateway.push.apple.com, port 2195. (for production)
you also need different APNS certificate (.p12 or .pem- whatever you are using in your script) for Development and production build.
After changing this, you will start getting notification for builds installed through test flight too.
I am new to PNS. I have developed one app which is having PNS and deliver ipa to client and PNS coming properly no issues at all in development mode.Now i want to uplaod to App store before that i am creating all new certificate and profiles in production mode and tested from server but in Production mode PNS is not coming?? I have removed sandbox from PHP server side script even replaced .pem certificate name also. but still not working. Any idea what is going wrong??
You need to run a distribution version of your app, e.g. built against a distribution provisioning profile, one of Ad Hoc/Enterprise/AppStore. Make sure the profile has a production push notification entitlement.
You can check this with
codesign -d --entitlements - pathTo.app
look for
<key>aps-environment</key>
<string>production</string>