Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Push notification register APN to GCM Problem #665

Closed
shepax opened this issue Mar 1, 2016 · 5 comments
Closed

Push notification register APN to GCM Problem #665

shepax opened this issue Mar 1, 2016 · 5 comments

Comments

@shepax
Copy link

shepax commented Mar 1, 2016

I have some problem with IOS push notification using GCM as midleware for the push.

The plugin Is not doing the registration proces of the apn key with the gcm. i'm getting a gcm tokem but no luck at all with de apn device.tokem.

I been trying to run this for a week, i want to know if this feature is implemented o not?

and if is not is there a way to do it with what you have now?

the plugin is not doing this work..

Logic works as follows

  1. We request device token from apns as usual.
  2. Then we send that token to gcm service with provided api.
  3. Then gcm sends back a another token.
  4. We send that token to app server.
  5. App server can send notifications using that token.

Sorry for the bad english and if this is not the place to ask this.

@macdonst
Copy link
Member

macdonst commented Mar 2, 2016

@shepax are you using the senderId and gcmSandbox parameter in the ios init options? Because what you describe the plugin should do for you.

@shepax
Copy link
Author

shepax commented Mar 2, 2016

Yes i'm doing that but with no luck at all. The apn is not sending the code back..

I got all done up, the certificates of apple on de phone and gcm. Set up the gcmSandbox:true.

this is the code im using do.

 var push = PushNotification.init({
            "android": {
                "senderID" : "866025XXXX",
                "icon" : "folicon",
                "iconColor": "#00abc9"

            },
            "ios": {
                    "senderID" : "866025XXXX",
                    "alert": "true",
                    "badge": "true", 
                    "sound": "true",
                                         "gcmSandbox":"true"}, 
            "windows": {} 
        });

(EDIT)

Fix the problem was the json format, you have to use notification so the messge can be send to ios.

"to" : "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
  "priority" : "normal",
  "notification" : {
    "body" : "This week’s edition is now available.",
    "title" : "NewsMagazine.com",
    "icon" : "new",
  },

The one i was using was this:

"to" : "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
  "priority" : "normal",
  "data" : {
   "message" : "This week’s edition is now available.",
    "title" : "NewsMagazine.com",
    "icon" : "new",
  },

The problem now is that the code I send to Android with the notificaiton format:

                    style = "inbox";
                    icon = "myicon";
                    iconColor= "#00abc9";

aren't working

@macdonst
Copy link
Member

macdonst commented Mar 2, 2016

@shepax correct, when sending to GCM on iOS you need to use the notification object but when sending to GCM on Android you need to use the data object.

@macdonst macdonst closed this as completed Mar 2, 2016
@ef33zy
Copy link

ef33zy commented Jul 17, 2016

@shepax I am having the same issue with the "style", "summaryText"etc for Android. Were you able to find a resolution? @

@lock
Copy link

lock bot commented Jun 4, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants