We are pushing the notifications from Web App built in React JS. The notification title has around 95 characters and gets cropped when received on the phone. How do we wrap the title like in Inshorts App? We don't have any issues with when the app is in the foreground.
here is our React JS code to push the notification:
message = {
notification: {
title:"Long title with 95 characters",
seoLink:"google.co.in",
image: "abc.jpg",
content_available: 'true'
},
data: {
title:"Long title with 95 characters",
body: "body msg",
seoLink:"google.co.in",
image: "abc.jpg",
},
to: fcmToken
};
This is the code we are using in Android Native:
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, channelId)
.setSmallIcon(R.mipmap.ic_launcher)
.setLargeIcon(image)
.setContentText(title)
.setAutoCancel(true)
.setStyle(new NotificationCompat.BigTextStyle().bigText(title))
.setColor(context.getResources().getColor(R.color.colorPrimary))
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setColor(context.getResources().getColor(R.color.colorPrimary))
.setVibrate(vibrate)
.setLights(0xff00ff00, 300, 100)
.setWhen(System.currentTimeMillis());