Good day! Prompt, push notifications in production do not work with GCM. No messages come, but the registration token is coming. And in the development of the push work. I was suspicious that the wrong certificate was listed in GCM. Question:

  1. How can I test production push notifications in development? I read that you can pour on testflight, but is there any other way easier?
  2. Can I edit the ad-hoc provisioning profile when the app is already on the appstore?
  • 1) No. 2) No. - Max Mikheyenko
  • one). GCM moved to firebase, possibly related. 2). Tell me when sending push notifications you send priority: high? - rowwingman
  • @rowwingman 1) No, we have no firebase. 2) Yes, we send - Nemezis16

1 answer 1

Put in the code condition:

BOOL sandboxOption; #ifdef DEBUG sandboxOption = YES; #else sandboxOption = NO; #endif [[GGLInstanceID sharedInstance] startWithConfig:instanceIDConfig]; self.registrationOptions = @{kGGLInstanceIDRegisterAPNSOption:deviceToken, kGGLInstanceIDAPNSServerTypeSandboxOption:@(sandboxOption)}; [[GGLInstanceID sharedInstance] tokenWithAuthorizedEntity:self.gcmSenderID scope:kGGLInstanceIDScopeGCM options:self.registrationOptions handler:self.registrationHandler]; 

Due to this, the APNS server will now be automatically selected. For release - production, for debug - sandbox. This can help, because sometimes you can forget to change the option, and fill in the build without pushing it, because the sandbox option does not work in production.

Still reloaded p12 for production and sandbox to GCM, which generated from APNS certificates

enter image description here

enter image description here

I understand that the problem was that the wrong p12 was specified for production. Perezaliv fixed the situation.