Issue with push notification


#1

there’s an issue with expo’s push notification. I received a network error request from sentry despite following the docs. I thought it was an issue with my code but that doesn’t seem the case. Using sdk 24

Discarded invalid parameter 'type' Collapse
Name	
type

here are the breadcrumbs:

POST https://securetoken.googleapis.com/v1/token?key=AIzaSyAH0KhdQ5GTX8RXt3kk7nS4ykh4g8Dpn5k [200]
10:07:33
xhr
POST https://www.googleapis.com/identitytoolkit/v3/relyingparty/getAccountInfo?key=AIzaSyAH0KhdQ5GTX8RXt3kk7nS4ykh4g8Dpn5k [200]
10:08:47
xhr
POST https://exp.host/--/api/v2/push/send [0]
10:08:47
xhr
POST https://exp.host/--/api/v2/push/send [0]
10:08:47
xhr
POST https://exp.host/--/api/v2/push/send [0]
10:08:47
xhr
POST https://exp.host/--/api/v2/push/send [0]
10:08:49
exception
Error: Network Error

#2

We need more information to identify the root cause. Could you please provide more information about how you are sending the push notification and whether you are providing the “Collapse” string anywhere in your code?


#3

hi,
thanks for the response. I am sorry I was not aware about a “collapse” string? can you provide some reference? here’s my code:

await axios.post(URL, {
            to: pushToken,
            sound: 'default',
            title: name,
            body: message,
          }, {
            headers: {
              'accept': 'application/json',
              'accept-encoding': 'gzip, deflate',
              'content-type': 'application/json',
            },
          });

it is not throught a server but directly through a phone


#4

here’s another place

if (pushToken) {
            content.push(axios.post(URL, {
              to: pushToken,
              sound: 'default',
              title,
              body,
            }, {
              headers: {
                'accept': 'application/json',
                'accept-encoding': 'gzip, deflate',
                'content-type': 'application/json',
              },
            }));
          }

then the promise is fulfilled with axios.all.


#5

In your first post, you included an error message with the string “Collapse” and it is unclear where that string is coming from.

From your error message I don’t see what the cause of the error is. Looking on Google, Discarded invalid parameter is an error message from Sentry and is unrelated to Expo. There may be an issue with sending the 'accept-encoding': 'gzip, deflate' header if that is handled by the layer below.


#6

The collapse and expand is a link on the sentry website that hides or shows the ‘type’ parameter error.
For the issue itself, if I remove the encoding there may not be any issues with push notifications? I can remove that piece of code as long as everything works. Or leave it as push notifications work and i can just ignore the error as long as it’s nothing serious


closed #7

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.