GCM iOS Production Does Not Receive Notifications

So I have a problem with GCM. I uploaded the .p12 development and issue of APNS certificates to the Google Console (I checked that they have the same name, package ID). I have a development and production profile. I have aps-environment in my production profile and I can load it normally in iTunes Connect. I use:

  _registrationOptions = @{kGGLInstanceIDRegisterAPNSOption:deviceToken, kGGLInstanceIDAPNSServerTypeSandboxOption:@NO}; 

for production. It is set to NO. For my development, set to YES. I checked, I get the device token, and it is sent to my server.

Push notifications just don't work in a production environment. They work only in the development environment. Do you know the reason?

+5
source share
1 answer

Set "priority": "high"

 { "to": "gcm_device_token", "priority": "high", "content_available": false, "notification": { "sound": "default", "badge": "1", "title": "Push Title", "body": "Push Body" } } 

The code for the working environment is used here:

 _registrationOptions = @{kGGLInstanceIDRegisterAPNSOption:deviceToken, kGGLInstanceIDAPNSServerTypeSandboxOption:@NO}; 

Here is the code to use in the development environment:

 _registrationOptions = @{kGGLInstanceIDRegisterAPNSOption:deviceToken, kGGLInstanceIDAPNSServerTypeSandboxOption:@YES}; 
+1
source

Source: https://habr.com/ru/post/1240537/


All Articles