appfeel / node-pushnotifications

Push notifications for GCM, APNS, MPNS, AMZ (automatic detection from device token)
MIT License
534 stars 126 forks source link

Unclear how to specify API key for gcm/fcm #177

Closed kovkev closed 2 years ago

kovkev commented 2 years ago

Hi node-pushnotifications team!

I am trying to setup push notifications from my node server to my android app.

I think that I used to do the following and I think it used to work:

const settings = {
    gcm: {
        id: "123123123-123123123-123123123-123123123-123123123",
        phonegap: false, // phonegap compatibility mode, see below (defaults to false)
    },

Now, I get errorMsg: 'InternalServerError'

Now, I look at the docs for the push notification configuration settings. I see that they show:

const settings = {
    gcm: {
        id: null,
        phonegap: false, // phonegap compatibility mode, see below (defaults to false)
        ...
    },

Notice the id: null.

Which API key should I use? Where should I put it? There are no instructions.

alex-friedl commented 2 years ago

The id: null is just a bad example in the README. It should of course be your app id, as in this example: https://github.com/alex-friedl/crossplatform-push-notifications-example/blob/master/server/js/push.js

afeurra commented 1 year ago

Me too I found this unclear. Docs should explain this a little, an inline comment cloud be enough.