heads-up-notifications

Dismiss Heads Up notification and create a normal one

喜你入骨 提交于 2019-12-05 13:43:51
I'm using this code to create a Heads Up notification. private static void showNotificationNew(final Context context,final String title,final String message,final Intent intent, final int notificationId, final boolean isHeaderNotification) { NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context.getApplicationContext()) .setSmallIcon(R.drawable.prime_builder_icon) .setPriority(Notification.PRIORITY_DEFAULT) .setCategory(Notification.CATEGORY_MESSAGE) .setContentTitle(title) .setContentText(message) .setWhen(0) .setTicker(context.getString(R.string.app_name));

How do some apps block/replace heads-up notifications?

半腔热情 提交于 2019-12-04 00:57:50
问题 Background Ever since heads-up notifications appeared on Android, some people liked it for its quick handling, yet some hated it for showing on top of apps (especially games). In order to show heads-up notifications, developers can use something like that: final NotificationCompat.Builder builder = new NotificationCompat.Builder(this) .setContentTitle("aa").setContentText("bb").setTicker("cc") .setColor(0xffff0000).setSmallIcon(R.mipmap.ic_launcher) .setLargeIcon(BitmapFactory.decodeResource

Heads up notification do not work sometimes

雨燕双飞 提交于 2019-11-29 12:47:19
I make a head up notification this way: Notification.Builder nb = new Notification.Builder(context) .setSmallIcon(icon) .setContentTitle("Title") .setContentText("Content") .setDeleteIntent(delete) .setPriority(Notification.PRIORITY_HIGH) .setVibrate(new long[0]); notificationManager.notify(1, nb.build()); // TODO hardcode First time I install application on a testing device, notifications are heads up, but if I expand notification area (while heads up is still running) and dismiss the notification from there, next time notifications are not heads up. After reinstalling the app notifications

Heads up notification do not work sometimes

蹲街弑〆低调 提交于 2019-11-28 06:34:15
问题 I make a head up notification this way: Notification.Builder nb = new Notification.Builder(context) .setSmallIcon(icon) .setContentTitle("Title") .setContentText("Content") .setDeleteIntent(delete) .setPriority(Notification.PRIORITY_HIGH) .setVibrate(new long[0]); notificationManager.notify(1, nb.build()); // TODO hardcode First time I install application on a testing device, notifications are heads up, but if I expand notification area (while heads up is still running) and dismiss the

Firebase Messaging - Create Heads-Up display when app in background

空扰寡人 提交于 2019-11-27 03:24:53
问题 With FCM I receive push notifications in the system tray when the app is in the background or not running. When the app is in the foreground I can override onMessageReceived and create my own heads-up notification with NotificationCompat . Is there a way to create a heads-up notification when my app is in the background or not running? Thanks EDIT: For reference here is the message payload I am using via curl to https://fcm.googleapis.com/fcm/send { "to":"push-token", "content_available":