android-notifications

Show video, gif or banner in push notificaion

∥☆過路亽.° 提交于 2021-02-15 07:35:45
问题 I have come across the notification which actively changes the content like banners. AFAIK videos and GIFs are not supported in the notification. How can we achieve this? I have searched and found Custom Notification Layout might the solution. But not quite sure. 来源: https://stackoverflow.com/questions/65773220/show-video-gif-or-banner-in-push-notificaion

Notification custom sound and vibrate not working?

心不动则不痛 提交于 2021-02-11 17:01:52
问题 I have an app that receives notification, all is working. However, the custom sound and vibration is not working. I'm testing it on Android 9 pie. Uri sound = Uri.parse("android.resource://" +getApplicationContext().getPackageName()+ "/" +R.raw.siren); //ContentResolver.SCHEME_ANDROID_RESOURCE + String NOTIFICATION_CHANNEL_ID = "com.example.bantay.bantay.test"; NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); NotificationCompat

Notification channel error

陌路散爱 提交于 2021-02-10 14:14:24
问题 I have an app which will recieve FCM notifications.App was recieved notifications on os below Android oreo devices. But notificatons are not recieving in android oreo device.Instead of notification it gets toast "developer warning for package failed to post notification on channel null". I searched and understand that Notification channels are required.But I dont know where it is to be added.Please give me guidance.The toast is appearing on 8.0 emulator.In real device nothing is coming. 回答1:

Notification channel error

可紊 提交于 2021-02-10 14:10:39
问题 I have an app which will recieve FCM notifications.App was recieved notifications on os below Android oreo devices. But notificatons are not recieving in android oreo device.Instead of notification it gets toast "developer warning for package failed to post notification on channel null". I searched and understand that Notification channels are required.But I dont know where it is to be added.Please give me guidance.The toast is appearing on 8.0 emulator.In real device nothing is coming. 回答1:

Flutter: local notifications custom sound doesn't work

允我心安 提交于 2021-02-10 06:57:31
问题 I'm trying to play my own custom sound for my notifications. But on my android emulator, it just plays the default sound and on my own device, it doesn't even make a sound. I tried this but it didn't help me. FlutterLocalNotificationsPlugin _notifications = FlutterLocalNotificationsPlugin(); var initializationSettingsAndroid = AndroidInitializationSettings('app_icon'); var initializationSettingsIOS = IOSInitializationSettings(); var initializationSettings = InitializationSettings

How to dismiss notification without intent?

霸气de小男生 提交于 2021-02-10 02:29:13
问题 I want to display a notification inside the app that disappears when the notification is tapped without starting an activity. I use an empty intent and it works: Intent intent = new Intent(); PendingIntent contentIntent = PendingIntent.getActivity(context, (int)System.currentTimeMillis(), intent, PendingIntent.FLAG_UPDATE_CURRENT); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, "") .setSmallIcon(R.drawable.icon) .setContentTitle(title) .setContentText(text)

How to dismiss notification without intent?

时光毁灭记忆、已成空白 提交于 2021-02-10 02:25:50
问题 I want to display a notification inside the app that disappears when the notification is tapped without starting an activity. I use an empty intent and it works: Intent intent = new Intent(); PendingIntent contentIntent = PendingIntent.getActivity(context, (int)System.currentTimeMillis(), intent, PendingIntent.FLAG_UPDATE_CURRENT); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, "") .setSmallIcon(R.drawable.icon) .setContentTitle(title) .setContentText(text)

Android push notifications after device reboot

血红的双手。 提交于 2021-02-08 11:53:22
问题 I use the FirebaseMessagingService to handle incoming notifications. When my app is in the foreground and background the messages are being arrived. When I swipe-out the app, notifications are being arrived. But if I restart my device, notifications are not being arrived until I run my app. In the same way, Telegram and WhatsApp continue receiving notifications after reboot. I have implemented the onNewToken() method and have added logic to send new token to the server but it hasn't helped.

Repeat notification every day 12h

瘦欲@ 提交于 2021-02-08 05:38:37
问题 I want repeat my notification every day at 12h, but my code isn't working... I launch my Alarm Manager in MainActivity in OnCreate like this : protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_ma); Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY, 12); calendar.set(Calendar.MINUTE, 00); calendar.set(Calendar.SECOND, 0); Intent intent1 = new Intent(MainActivity.this, AlarmReceiver.class);

QT/QML Android App, open app when click notification bar

我怕爱的太早我们不能终老 提交于 2021-02-07 14:17:47
问题 I make an QT for Android apps. When I click button notify bar seen above in tablet. But if click notify, my apps open/focus(don' know) with black window. How to do it simply. My code is: package org.ays.operation; import android.app.Notification; import android.app.NotificationManager; import android.content.Context; import android.app.PendingIntent; import android.content.Intent; public class NotificationClient extends org.qtproject.qt5.android.bindings.QtActivity { private static