My notifications works correctly with Expo Go and in Testflight when I send notifications with the Expo Notification Tool but not from a device to another.
This is my code to send notifications from a device :
const message = {
to: expoPushToken,
sound: 'default',
title: body,
body: '',
data: { someData: 'goes here' },
};
await fetch('https://exp.host/--/api/v2/push/send', {
method: 'POST',
headers: {
host: "exp.host",
Accept: 'application/json',
'Accept-encoding': 'gzip, deflate',
'Content-Type': 'application/json',
},
body: JSON.stringify(message),
});
“react-native”: “0.72.6”,
“expo”: “~49.0.15”,
Thank you for your help !
I tried to use https://fcm.googleapis.com/fcm/send to send notifications and i tried getDevicePushTokenAsync.