Cordova App - Error while sending push from dashboard to android devices

Hello,

My cordova application receive push on iOS but while trying to send push on android, the urban airship error console gives me : "Received error: Received push with invalid authorization on platform GCM."

I've followed : https://support.urbanairship.com/entries/70861233-GCM-Troubleshooting-Guide and http://docs.urbanairship.com/platform/phonegap.html#setup and looked to other Knowledge Base tickets with no success. I've ensured both gcm sender ID and project ID are used in the right place.

What am I missing?

Thank for your attention

Didn't find what you were looking for?

New post

Comments

5 comments

  • Hi Ludovic,

    There are two things I would check:

    1) Make sure that the GCM API Key you created in your Google Developer Console was created as a Server Key, not an Android Key. If need be, you may try creating a new API Key under your Google Project.

    2) If you're using the Cordova CLI to create your app, you may want to make sure you are modifying the contents of the main config.xml file, not the one located under "platforms"->"android".

    The reason being is because any changes made in the config.xml file inside the android folder will be overwritten by the top-level config.xml file. It may not be apparent when building the app, so definitely make sure all instances of the config.xml file have the correct info and are not being overwritten during the build event.

     

    Other than that, just make sure the GCM API Key you're using in Urban Airship is tied to the correct GCM Sender ID in your config.xml file, and you should be able to resolve the issue.

    If that doesn't help, let me know and we can dig in further.

    Comment actions Permalink
    0
  • Thank for your quick answer Michael,

    Now that a Server Key was created and tied to UrbanAirship account, the console gives me an other error : "Application does not have permission to send to this device | Original Message: Error: mismatched sender ID".
    To sum up, I have now one project with 2 Api keys (Server and Android). The Server key is tied to Urban Airship and the Android Key contains the project bundle name and the sha-1 fingerprint. The config.xml use the GCM Sender ID of this project.

    What is wrong now?

    Comment actions Permalink
    0
  • Hi Ludovic,

    Can you double check to make sure the config.xml has the correct GCM Sender ID?

    Make sure you used the Project Number, not the Project ID.

    Can you verify that is correct?

     

    Comment actions Permalink
    0
  • Hello Michael,

    I've double check and everything seems to be in place. I still get this error message : "Error: mismatched sender ID"

    Comment actions Permalink
    0
  • Hi Ludovic,

    If you wouldn't mind, can you upload your project root directories config.xml file and a screenshot of the API key in your Google Developer Console, as well as a screenshot of your Sender ID in the Google Developer Console? I have a feeling it's something we're missing. 

    Comment actions Permalink
    0

Please sign in to leave a comment.