iOS push doesn't work when building from xcode - ios

I'm finding a strange discrepancy in the way that iOS push/APNS works for my app. (For background, the app in question uses Cordova together with the phonegap-plugin-push plugin.) If I download the app's current release from the app store, push works just fine. But if I build the app in release mode and run it on a test device using Xcode, no push notifications are ever received. This seems odd because I would have thought that either method produces essentially the same build.

Try to sign you app using distribution certificate while building from Xcode.

Pushes from a released version must be sent to Apple's push server, while pushes from a development server must be sent to Apple's sandbox push server.
The recommended method is that your server code that sends the push sends it to the push server first, and on failure sends it to the sandbox push server. If your server code is written like that, it will handle both released and development versions just fine.
I've seen server libraries that must be configured to either send to the push server or to the sandbox push server. With that setup, you need different servers, one handling released apps, one handling development apps.
Try archiving the app and downloading the archive to your phone, if that works then your server is set up in this very inconvenient way.

Related

react-native-push-notification remote doesn't show when I test with real ios device with xcode

I'm using react-native-push-notification.
I'm trying to test push notifications, if I build app and upload it to testflight it shows remote notifications just fine, but when I do it with xcode build on a real device it doesn't react at all (I'm getting onRegister call and notification token though). This problem is only on IOS, android getting notifications in production and development. Can't google anything related so probably I'm missing something.
P.S. I'm using backend to send notifications through firebase
you have to go in capaibility in xcode and active PushNotification first
for more info see this
hope you have followed all the steps to get the APNS certificate and attached that to your xcode, before the build, if not please do so.
Also, in addition you need to have .pem file to add to your Firebase to make your ios app enable to send and receive push.

iOS VoIP Notifications not working on newly created app

I have an old app that have VoIP implemented. Everything is working just fine. Now I'm creating a new one - new app in App Store(new bundle id), new certificates. I've never managed to receive a single voip notification in that app.
However if I put the old bundle id (from the old app that's working) as Bundle Identifier in the new app - it starts to receive the VoIP notifications. So the problem isn't in the new app code base.
I have created everything identical to the old one - certificates, capabilities, code.
Does anyone have experienced this?
Any solutions and suggestions are highly welcomed.
Check the server code which is sending voip. Check if the server is using new bundle id and certificates of the app. Ass you said, problem is not in your app code. It should be on server end.
So yesterday I've submitted a ticket to apple. They said:
Based on your reports that your Push Notifications have stopped working without any changes on your end, we suspect this could be due
to continued use of the legacy Binary Interface which was retired
March 31st, 2021 (https://developer.apple.com/news/?id=c88acm2b).
This change requires you to migrate your push servers to use the
HTTP/2 API. Any push servers still using the legacy interface will be
unable to connect to APNs, resulting in Push Notifications not
working.
More information about the HTTP/2 provider API can be found in these
two WWDC sessions:
WWDC2015 Whats New in Notifications https://developer.apple.com/videos/play/wwdc2015/720/
WWDC2016 Whats New in the Apple Push Notification Service https://developer.apple.com/videos/play/wwdc2016/724/
After migrating to HTTP/2 the pushes started working.

Flurry send test push message stopped working

In my project sending Flurry campaigns to a specific iOS device using Push Token stopped working suddenly.
I have previously configured Flurry with an Apple Push Services certificate for production and an Apple Development iOS Push Services for development. Both certificates are still valid.
When trying to send the push message to my device using Push Token, we get this error message:
Unable to send test push. Please try again
I'm at a loss what the error could be here, especially since it worked fine before. Any ideas?
After some weeks Flurry support managed to solve this. Meaning we did not have any faulty configurations.

Push notifications stop working after packaging iOS app

I have an enterprise iOS app I'm developing which receives push notifications for various features. I have the push notification service installed and working while debugging the app with Xcode and an iPhone X (phone doesn't matter, I've tried multiple and they all seem to work directly from Xcode).
If I package the app and distribute it over the air to the device, I get the normal "Would you like to receive push notifications" (which I agree to), but then it won't receive push notifications.
Things I've checked:
Make sure the device capability "Push Notifications" is turned on.
Make sure the bundle identifier matches.
Verify that the pushID is correct.
Verify that Background Modes: Remote Notifications is turned on.
The only thing I can think of is that maybe when the app is packaged it's flipping something to production rather than development and maybe when I send the push notification it's not able to send to production or something along those lines.
Has anyone had this issue before?
#HarshalBhavsar's answer got me closer. I found the explanation here though:
https://stackoverflow.com/a/35628480/3921182
As it turns out, Apple has a push notification service for development that is separate from distribution(production). When sending the push notification messages to a distributed app, they actually need to be sent to:
ssl://gateway.push.apple.com:2195
rather than
ssl://gateway.sandbox.push.apple.com:2195

iOS Push Notifications not sent for Parse app in production mode

I have two Parse apps for a project, one for development and one for production. The production one has "Released in Production" toggled on:
I am just testing on my phone, nothing has been released and distributed to the App Store.
I am able to send push notifications from the Parse development app:
But using the exact same settings in the Parse production app (same iOS Development Cert, deviceToken getting saved to an Installation as expected), "Pushes Sent" is always 0:
I realize that a production cert is needed for Release builds, but as far as I understand, I'm only testing Debug builds (plug in iPhone, click build with physical device as the target), so the only thing that's different when it doesn't work is that it's coming from a Parse app with production mode toggled on.
Am I missing something? Does "Released in Production" have other implications? Could there be something with the app on my phone thinking it's already registered for Push Notifications from Parse development app, so when I try to run it pointing at the Parse production app, it fails?
FYI - this is a React Native app. application:didReceiveRemoteNotification: is defined and works when coming from Parse dev, but nothing from Parse prod.
Any suggestions or ideas would be most appreciated!!
If you click info button in Release in Production it'll say, that it's just for Parse knowledge, so they can properly scale they resources allocated for your app. It has nothing to do with Push Notifications.
To test Production certificate try to build your app using Release mode.

Resources