1

I got strange GCM response when registration_id is BLACKLISTED payload is

{"data":{"title":"Your troopers were attacked"},"registration_ids":["BLACKLISTED"]}

response is

{"multicast_id":9151224166188989772,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"InvalidParameters"}]}

And response headers are

   [headers] => Array
    (
        [content-type] => application/json; charset=UTF-8
        [date] => Thu, 12 Nov 2015 04:16:06 GMT
        [expires] => Thu, 12 Nov 2015 04:16:06 GMT
        [cache-control] => private, max-age=0
        [x-content-type-options] => nosniff
        [x-frame-options] => SAMEORIGIN
        [x-xss-protection] => 1; mode=block
        [server] => GSE
        [alternate-protocol] => 443:quic,p=1
        [alt-svc] => quic=":443"; p="1"; ma=604800
        [accept-ranges] => none
        [vary] => Accept-Encoding
        [transfer-encoding] => chunked
    )

[http_version] => HTTP/1.1
[status] => 200
[message] => OK

I cannot find such error in documentation https://developers.google.com/cloud-messaging/http-server-ref#table9. Anyone know which this error indicate?

For any other registration_id, for example "GOOGLE", i got right response InvalidRegistration

FallDi
  • 660
  • 7
  • 21
  • Which client app made the device-side registration request? Are you using an emulator for the registration? – sampson-chen Nov 12 '15 at 21:34
  • It doesn't matter :) I understand that this is not valid GCM token(for example from emulator), also i have no any pattern to validate token on server-side(http://stackoverflow.com/questions/33355586/do-android-gcm-registration-ids-always-start-with-apa). But i do not know how to handle such error InvalidParameters on server side, for example - needs remove such device from database or not. Thanx! – FallDi Nov 13 '15 at 11:19
  • Actually, it helps to troubleshoot if we know a specific emulator is causing the bad registration. – sampson-chen Nov 13 '15 at 21:57

1 Answers1

0

I assume 'BLACKLISTED' is a reserved word. Google mentions that you should not use reserved words, but does not give a full list.

This is a guess based on reading https://developers.google.com/cloud-messaging/http-server-ref which mentions this...

The key should not be a reserved word ("from" or any word starting with "google" or "gcm"). Do not use any of the words defined in this table (such as collapse_key).

Magnus Smith
  • 5,895
  • 7
  • 43
  • 64