ToothlessGear / node-gcm

A NodeJS wrapper library port to send data to Android devices via Google Cloud Messaging
https://github.com/ToothlessGear/node-gcm
Other
1.3k stars 206 forks source link

Null error And Invalid Request 400 #31

Closed sdogruyol closed 10 years ago

sdogruyol commented 11 years ago

I was using this module to send notifications to more than 1k+ users. Till last week i had no problems and it was working perfectly. But this week i couldn't send any notification to users.

Getting a 400 invalid request error without any hint. I know that it's something related with my JSON data format being wrong or so but i can send notification to a single user without any problem.

Anyone experienced something like this?

Here's the message options that i use.

messageOptions = {
        collapseKey : "some_key",
        delayWhileIdle : false,
        timeToLive : 3600*12,
        data : {
            content : "Some text"
        }
    }
sdogruyol commented 11 years ago

Seems like the problem is from having not registered devices in your device_ids.

If you are sending multiple registration_ids and any of them is not registered you gonna get a null error with 400 error code.

deerawan commented 10 years ago

So, the solution is send push notif one by one per registration id, right?