Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Matheus_O_
Beginner
52 Views

PushNotifications using PhoneGap and GCM for iOS

        var push = PushNotification.init({ 
            "android": {
                "senderID": "mySenderID"
            },
            "ios": {
                "senderID": "mySenderID", 
                "alert": "true", 
                "badge": "true", 
                "sound": "true",
                "gcmSandbox": "true"
            }, 
            "windows": {} 
        });

        push.on('registration', function(data) {
            dispToken = data.registrationId;
        });

        push.on('notification', function(data) {
            console.log(data.message);
            alert(data.title+" Message: " +data.message);
            // data.title,
            // data.count,
            // data.sound,
            // data.image,
            // data.additionalData
        });

        push.on('error', function(e) {
            console.log(e.message);
        });

 

dispToken is the internal variable that I use to save the Token into my database. I have already enabled GCM for iOS on Google. When I push the notification using my PHP page it returns me a JSON with success message. On android it runs flawlessly, but on iOS I never got the push. Any ideas?

PS.: My iOS certificate is a production one. Also, changing gcmSandbox to true or false doesn't make any difference

Tags (2)
0 Kudos
2 Replies
Elroy_A_Intel
Employee
52 Views

I recommend that you review the steps for configuring push notification into your certificate as this might be what you are missing. 

https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AddingCap...

ANTÔNIO_C_
Beginner
52 Views

Matheus,

 

I've been experiencing the same problem. Did you have yours solved ? My problem seems to be the certificate. Your problem was the certificate too ?

 

Thanks in advance,

Antônio Costa

 

Reply