So, I have a problem with GCM. I have uploaded .p12 development and production APNS certificates to Google Console (I've checked, they are the same name, bundle identifier). I have my development and production provision profile all set up. I have aps-environment
in my production profile and I am able to upload normally to iTunes Connect. I am using:
_registrationOptions = @{kGGLInstanceIDRegisterAPNSOption:deviceToken,
kGGLInstanceIDAPNSServerTypeSandboxOption:@NO};
for production. It is set to NO. For my development it is set to YES. I've checked, I am getting device token, and it is sent to my server.
Push notifications are just not working in Production environment. They only work in Development environment. Do you have any idea what's the cause?
Set "priority": "high"
{
"to": "gcm_device_token",
"priority": "high",
"content_available": false,
"notification": {
"sound": "default",
"badge": "1",
"title": "Push Title",
"body": "Push Body"
}
}
Here's the code to use for production environment :
_registrationOptions = @{kGGLInstanceIDRegisterAPNSOption:deviceToken,
kGGLInstanceIDAPNSServerTypeSandboxOption:@NO};
Here's the code to use for development environment :
_registrationOptions = @{kGGLInstanceIDRegisterAPNSOption:deviceToken,
kGGLInstanceIDAPNSServerTypeSandboxOption:@YES};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With