I have added expo notification in my react native application. It is working fine while running the application locally. But after creates a build by running the expo build:android -t app-bundle
command and deploy .aab file to the play store notifications are not working.
I’m using the spring-boot application to send expo push notifications.
const getNotificationPermission = async () => {
const pushNotificationToken = await getStorageData(storage.NOTIFICATION_TOKEN);
if (!pushNotificationToken) {
Permissions.getAsync(Permissions.NOTIFICATIONS).then((object) => {
if (!object.granted) {
return Permissions.askAsync(Permissions.NOTIFICATIONS);
}
return object;
}).then((object) => {
if (!object.granted) {
// throw new Error('Permission Not Granted!');
}
}).then(() => {
return Notifications.getExpoPushTokenAsync();
}).then((response) => {
setStorageData(storage.NOTIFICATION_TOKEN, response.data);
}).catch((err) => {
return null;
});
}