Hey! So I’m using Expo’s push notification system, and it works just fine for my app published on the Expo store.
I went ahead and ran exp build:ios
, uploaded my .ipa and made it onto the App Store, but push notifications no longer work. I’m using the following code for my backend;
let messages = []
// Get push_tokens for each friendsToNotify
// Send push notifications to each friendsToNotify
for (let friend of friendsToNotify) {
if (friend.online) {
messages.push({
to: friend.push_token,
sound: 'default',
body: result[0].first_name,
data: result[0],
badge: 1
})
}
}
// console.log(messages)
let chunks = expo.chunkPushNotifications(messages);
(async () => {
// Send the chunks to the Expo push notification service. There are
// different strategies you could use. A simple one is to send one chunk at a
// time, which nicely spreads the load out over time:
for (let chunk of chunks) {
try {
let receipts = await expo.sendPushNotificationsAsync(chunk);
console.log(receipts);
} catch (error) {
console.error(error);
}
}
})();
And it even returns me the usual [ { status: 'ok' } ]
in my server logs.
The frontend side is perfectly fine for handing push notifications, they come through using the Expo push notification tool - but only to my Expo store app, and not my standalone iOS app.
What should I do to get push notifications working?