Search code examples
javaandroidprogressive-web-appsweb-pushandroid-push-notification

Web-push notifications without a title don't appear


The PWA Web-push notifications for Android aren't appearing without a title set (body only).

I have a bug that an Android push notification is not multiline. All the text is set in the notification's title - no surprises.

Splitting the text is kinda difficult as there are really a lot of options with their own variables and localization.

I've tried to set the text into a body instead of a title as it's done for iOS (working fine), and the notification just won't come!

webPushBuilder = new WebPush.Build()
.addBody(localizedText)
                        .addData(customDictionary);

The pushes arrive with title only and with title+body, but body-only ones don't come.

Is there a way to send them without the title?


Solution

  • From what I found, a title is required to receive a Push notification on Android.

    Setting title to "\n", " ", "" won't work either.