I have implemented Local Notification in my React Native App.
Package using react-native-push-notification-ios/push-notification-ios
I have tried to fire local notification and it's a success. But local notification does not show all the Text of the body. Any maximum length or any solution for showing full text ?
My code :
showNotification = (id, title, message, data = {}, options = {}, channel) => {
console.log('SHOWWWWWW');
PushNotification.localNotification({
/* Android Only Properties */
...this.buildAndroidNotification(
id,
title,
message,
data,
options,
channel,
),
/* iOS and Android properties */
...this.buildIOSNotification(id, title, message, data, options),
/* iOS and Android properties */
title: title || '',
message: message || '',
playSound: options.playSound || false,
soundName: options.soundName || 'default',
userInteraction: true, // BOOLEAN: If the notification was opened by the user from the notification area or not
});
};
buildIOSNotification = (id, title, message, data = {}, options = {}) => {
return {
alertAction: options.alertAction || 'view',
alertBody: message || '',
category: options.category || '',
userInfo: {
id: id,
item: data,
},
};
};
UPDATED SOLUTION :
Maximum character length is 256 on iOS Side