Closed FallDi closed 7 years ago
The relevant specifications (and GCM for older Google clients) all specify that the maximum size is 4096 bytes (and that in practice it should be slightly lower due to encoding).
Are you sure your payload is <4kb after encryption?
It problem can be closed. We use base64 url encode for raw_data. It was wrong. Classic base64 help resolve it issue. Thanks.
body = JSON.stringify({
"registration_ids": ["cIKD0Ykm2ZI:APA91bG-OP...."],
"raw_data": payload.ciphertext.toString('base64')
});
Also i got such response from GCM
For simple payload - "Hello". Encoded payload is too big, any way to resolve it? I understand that encrypted payload is big, but how to pass normal data in this case? But sometimes for same payload it works...