How will i stop expo from sending push notification "Hello there! This is an example push notification"

#1

anyone has managed to stop expo from sending push notification “Hello there! This is an example push notification” ?. I am using push notification in my app, but i dint want to receive that example push notification on start up at the first time opening the app after installation. Anyone please help me on this issue.

0 Likes

#2

can you provide some code? I am using expo push notification and am not getting such message

0 Likes

#3

i think its almost certain that you’re sending this notification somehow. can you grep your server code and your client code for “Hello there! This is an example” and see if you can find it?

0 Likes

#4

I’m pretty sure you just used the starter tabs template and the code is in api/registerForPushNotificationsAsync.js that calls it

1 Like

#5

@vipeeshp there is a bunch of comments in the file @ccheever mentioned if you want to understand why thats happening, alternatively you can just delete the file and go to RootNavigation and delete the import and function call

0 Likes

#6

I have generated new project using expo xde and modified code. I have done
grep for that word in my project and folder and I couldn’t find.

0 Likes

#7

this is the code you need to remove:


  // POST the token to our backend so we can use it to send pushes from there
  return fetch(PUSH_ENDPOINT, {
    method: 'POST',
    headers: {
      Accept: 'application/json',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      token: {
        value: token,
      },
    }),
  });
0 Likes

#8

Its worked, many thanks.

0 Likes