I'm writing server-side code for android notification using FCM.
So the code sends the notification correctly to the topics but not to the particular device's registration token. So the code works fine for this case-
info.put("to", "topics/xyz");
info.put("title", "Hello 1");
info.put("body", "Hi");
But for the second case-
info.put("to", DeviceIdKey.trim()); //device registration token
info.put("title", "Hello 1");
info.put("body", "Hi");
it gives,
OUTPUT:
{
"multicast_id": 1XXXXXXX01820YYYY2,
"success": 0,
"failure": 1,
"canonical_ids": 0,
"results": [
{
"error": "MismatchSenderId"
}
]
}
IMPORTANT - And the registration tokens for all the android/IOS devices which I have are 2 years old generated by GCM. Thanks!