0

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?

Dávid Pásztor
  • 51,403
  • 9
  • 85
  • 116
Jordan
  • 319
  • 2
  • 12
  • 3
    are you sure when you package app the profile is development or production – Harshal Bhavsar Feb 28 '18 at 16:20
  • 1
    Agree with @HarshalBhavsar and I would also check the certificate – GIJOW Feb 28 '18 at 16:27
  • @HarshalBhavsar Thanks for the tip. I tried packaging the app for development and installing that way and it still isn't working. I remember a couple years ago with a different push notification service, needing a separate development and distribution certificate for push. I'm using a php service I wrote myself that only uses one certificate, could that be the issue? – Jordan Feb 28 '18 at 16:48

1 Answers1

1

@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

Jordan
  • 319
  • 2
  • 12
  • you have to use different .p12 for dev and production. Also as u said different ssl – Harshal Bhavsar Mar 01 '18 at 01:59
  • For enterprise development there's actually an option now for a combined .p12 which covers development and distribution which is kind of nice but also adds a level of confusion to everything haha. Thanks for all the help @HarshalBhavsar – Jordan Mar 01 '18 at 15:02