I am new to React Native and I have a task to implement push notifications in react native. I am using MS Azure Notification Hub for serving push notifications for my react native app. Both the local and remote notifications are working fine on my app but the problem is that I am receiving a very basic notification from the backend without actions and images. I managed to customize local notifications in my app but I am unable to customize remote notifications. I want to change its color, actions and add images. Please tell me how can I achieve my job? Even is it possible to customize remote push notifications in react native or must it be the MS Azure Notification Hub that will send all customization by itself? I have also tried to call a local notification in onNotification method so that the customizations of the local notification may override the style of remote push notification but it did not work because notifications get triggered as soon as they are received. Remember that I am using react-native-push-notification for the purpose. Below is my code.
PushNotification.configure({
onRegister: (token) => {
console.log("TOKEN", token);
}
onNotification: (notification) => {
console.log('NOTIFICATION:', notification);
PushNotification.localNotification({
channelId: 'demo-channel',
title: 'You tapped on Fruit',
ticker: 'Tcker',
message: 'Hey you got 1 Fruit',
bigText: 'Congratulations',
bigLargeIcon:
'https://cdn.pixabay.com/photo/2021/01/05/05/30/grapes-5889697__340.jpg',
bigPictureUrl:
'https://cdn.pixabay.com/photo/2021/01/05/05/30/grapes-5889697__340.jpg',
largeIconUrl:
'https://cdn.pixabay.com/photo/2021/01/05/05/30/grapes-5889697__340.jpg',
smallIcon:
'https://cdn.pixabay.com/photo/2021/01/05/05/30/grapes-5889697__340.jpg',
});
})