Hi everybody,
Since last week, I get The remote server returned an error: (400) Bad Request for my notification push. Is it a general problem or just me ? Thanks
Push Notification error server 400
Monday, November 25, 2024 5:25:55 PM
Hello Laurent,
Below is the description of 400 error, coming from Firebase, which we use to handle push notifications:
"Potential causes include invalid registration, invalid package name, message too big, invalid data key, invalid TTL, or other invalid parameters.
Invalid registration: Check the format of the registration token you pass to the server. Make sure it matches the registration token the client app receives from registering with Firebase Notifications. Do not truncate or add additional characters.
Invalid package name: Make sure the message was addressed to a registration token whose package name matches the value passed in the request.
Message too big: Check that the total size of the payload data included in a message does not exceed FCM limits: 4096 bytes for most messages, or 2048 bytes in the case of messages to topics. This includes both the keys and the values.
Invalid data key: Check that the payload data does not contain a key (such as from, or gcm, or any value prefixed by google) that is used internally by FCM. Note that some words (such as collapse_key) are also used by FCM but are allowed in the payload, in which case the payload value will be overridden by the FCM value.
Invalid TTL: Check that the value used in ttl is an integer representing a duration in seconds between 0 and 2,419,200 (4 weeks).
Invalid parameters: Check that the provided parameters have the right name and type."
Maybe you've changed something? Maybe something has changed in your Firebase project?
Below is the description of 400 error, coming from Firebase, which we use to handle push notifications:
"Potential causes include invalid registration, invalid package name, message too big, invalid data key, invalid TTL, or other invalid parameters.
Invalid registration: Check the format of the registration token you pass to the server. Make sure it matches the registration token the client app receives from registering with Firebase Notifications. Do not truncate or add additional characters.
Invalid package name: Make sure the message was addressed to a registration token whose package name matches the value passed in the request.
Message too big: Check that the total size of the payload data included in a message does not exceed FCM limits: 4096 bytes for most messages, or 2048 bytes in the case of messages to topics. This includes both the keys and the values.
Invalid data key: Check that the payload data does not contain a key (such as from, or gcm, or any value prefixed by google) that is used internally by FCM. Note that some words (such as collapse_key) are also used by FCM but are allowed in the payload, in which case the payload value will be overridden by the FCM value.
Invalid TTL: Check that the value used in ttl is an integer representing a duration in seconds between 0 and 2,419,200 (4 weeks).
Invalid parameters: Check that the provided parameters have the right name and type."
Maybe you've changed something? Maybe something has changed in your Firebase project?
Best regards,
Patryk
GrandNode Team
Patryk
GrandNode Team
0
To be honest, I haven't tracked the changes in Firebase, but I suppose it was added much earlier than 27th October, because the documentation page that contains the AppID description was edited in August. During the 4.80.0 development, we've noticed that this field is used by Firebase, so we've decided to update the Firebase library, and add a new field to the configuration.
In your case, you can manually add the AppID field to the push notification javascript file on your server, to check if it helped.
In your case, you can manually add the AppID field to the push notification javascript file on your server, to check if it helped.
Best regards,
Patryk
GrandNode Team
Patryk
GrandNode Team
0