Maleandr
Maleandr

Reputation: 91

GCM iOS production environment

I have problem with running GCM on iOS with production environment. We use topic messaging and app successfully register to some topic e.g. /topic/global, but it receives notifications only for dev builds. I tested uploaded production pk12 certificate with apple apn directly and it works as it should. Production app is signed with enterprise certificate (don't know if it makes any difference).

Can somebody point what I'm doing wrong or what I should check again?

Upvotes: 4

Views: 1333

Answers (1)

Ahmed Abdallah
Ahmed Abdallah

Reputation: 2355

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};

Upvotes: 3

Related Questions