How to create bubble notifications on Android? - android

This video # 0:17 shows a bubble-style push notification on Android. Messaging apps like WhatsApp often use these.
I'm building an app with Capacitor 3 but can't find how to send these kinds of push notifications. Is there a plugin I could use, or some way of configuring just a normal push notification to display like this?

It turns out this is the default style when the 'brief' notification style is selected in the notifications setting on the phone. It isn't set programmatically as some kind of notification config.
Mine wasn't showing because the 'Show as popup' option was disabled for the notification channel I was testing. When I created a new channel, it was set to show notifications as popups, and then they started showing like in the video.

Related

Set Firebase Notification to appear as Popup like whatsapp in Android studio

I am building an social media app in Android studio, this app uses firebase for push notifications, and notifications is working fine, that Is notifications shows on device's notification bar.
How can I change the behavior so that the notification can appear as popup when app is in foreground?
I want a persistent kind of notification, something like WhatsApp that can stay on top other apps so that users can quickly open notification on wherever they are on their phone.
On my research, the best i could get was to use this on my theme
But I do not have Theme.Holo.Dialog in my style and my aim is that the notification should appear even if app is not open.
Thank you for looking into this
You should use heads-up notifications
For this purposes you should use notification channel with high a importance: How to set importance in the notification channel.
In this answer you can find code sample, how to show notification in the channel with high importance(to show notification even if the app in the foreground):
https://stackoverflow.com/a/67953864/16210149
Hope it would be helpful.

How to allow floating notification and lock screen notification programmatic in flutter

To implement push notification, Firebase Cloud Messaging is used.The notification is received successfully in the device but it has to be a pop-up(Floating notification) and it should also be displayed in lock screen.
Notification is composed using Admin SDK in node.js environment.
Please help to show the notification as a floating and lock-screen notification.
plugin used in flutter is firebase_messaging.
I suspect that it is not possible.
On some launchers that are enabled when in some it is disabled (for energy-saving purposes I guess) by default.
The user should enable it manually from app settings=>notification section manually.

Show firebase notifications when android app is open and with high priority

I am using nativescript-plugin-firebase for the APP and I get the notifications when the app is closed.
However, if the app is open I don't get any notifications. Is there any way to force showing push notifications even when the app is open or do I have to create a custom notification with sound within the app?
Another problem that I have is the way the push notifications are displayed. I use Laravel-FCM to send push notifications from the server-side, I have the priority set to 'high' and everything else set to default but when I receive the notification to the android device there is no floating notification, only a badge icon and a notification in the notifications center.
In the app notifications settings, there is Miscellaneous Notification Category with Importance set to Default, Vibration set to OFF and LED Light is also OFF but if I manually change those settings then firebase notifications appear with floating notification and vibration.
Any way to actually make these notifications with high priority by default?
P.S. The device I am testing on is Xiaomi Redmi Note 8 Pro
I have the same problem when using Nativescript-firebase as yours. When the app is open, the push notification is delivered but not shown (see onMessageReceived callback) then you can use Nativescript-local-notification to show the content of the push notification received when app is open.

Avoid autonotification display from GCM using notificacion push in Android

As we know, developing on Android we can handle push notification and show a custom view depending on our logic. But there is a problem, if I send a push notification with a content and title from the server android will auto-display the notification and if I handle them at the same time the phone shows both, mine and the auto-displayed.
How can I disable auto display of the notification in these cases.
Why do I need to do this?
I am using OneSignal to send push notifications for both android and ios. The second one need to receive a content and title to be shown but this is not mandatory for android and I want to be able to show a custom view in this case.
Thanks in advance
You can omit the displaying of the OneSignal notification by the SDK by setting up a NotificationExtenderService per the OneSignal Background Data and Notification Overriding documentation. Use the NotificationExtenderBareBonesExample class example shown in step 2 and return true instead of false to let the SDK know your handling the notification.

Android Silent Push

I am new to android and I'm playing around trying some features here and there.
I wanted to know what is the way to use silent push - meaning get a push notification on the device without any alarm, notification or vibration - i.e. without the user to be aware of it.
If someone have a tutorial he can refer me to I'll be more than gratefull.
The default push in Android (Google Cloud Messaging for Android) is a silent push.
You actually have to write code in order for the push notification to generate a notification, sound or any other effect noticeable by the user.
Read the GCM Guide.

Categories

Resources