android-notifications

NotificationListenerService Wearable

会有一股神秘感。 提交于 2019-12-11 23:44:09
问题 I am trying to implement a way to detect the notifications that are sent to the android wearable devices. After googling around, I have found it is not possible to use notificationListenerService on the wearable. In current implementation, I have implemented the notificationListenerService on the mobile handheld and am using the DataLayer to send the notifications over. My issue is: With the notificationListener, it detects everything that appears. Is there a reliable way to detect which

Pending Intent opens wrong activity

北城以北 提交于 2019-12-11 23:24:08
问题 I am using the FirebaseMessagingService for getting notifications and opening the app upon clickng the notification. But everytime i click the notification the app opens the MainActivity instead of the intended ResultActivity. I also followed docs from the PendingIntent docs and still does the same. private void createNotification( String messageBody) { Intent intent = new Intent( this , ResultActivity.class ); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_CLEAR_TASK);

Android: Push Notification

有些话、适合烂在心里 提交于 2019-12-11 20:06:14
问题 I am developing an application. In that application i am using the GCM (Push Notification). I took help of this Link 1. and i successfully implemented the client side code. Now to send notification i am using the following link as : Link 2 But the issue is that i am ale to get the notification, but when i click on that nothing happens. What should i do, so that if user click on notification web page or update page etc opens. I used the same code as given in that link. No changes done so far

I want to schedule a worker to show a notification when the device is plugged in and connected to the internet

痞子三分冷 提交于 2019-12-11 18:33:04
问题 Alright, I think the title is pretty self-explanatory...I have to use the WorkManager api to schedule a notification that will be displayed every time the device is connected to the internet and is charging(plugged-in). I managed to create a worker and make it display the notification, but the issue here is that it only shows the notification once. After that even if I disconnect/re-connect to wifi and unplug/plug the cable, it won't show the notification. val notificationTriggerConstraint =

Stopping and restarting foreground service scanning with altbeacon

南楼画角 提交于 2019-12-11 18:04:36
问题 I'm currently getting a headache with sticky notifications while trying to stop and restart foreground scanning in altbeacon. What I want to do: I want to start scanning for Bluetooth LE Beacons in a vehicle after the User presses a Button in my App. The App should notice if the User leaves his vehicle (event region left) and perform some actions. After that, the User can go back to the login screen and start the process again. The Beacon detection should still be working when the app is

Notification not showing when the app is closed

走远了吗. 提交于 2019-12-11 17:48:18
问题 Only use of data payload not receive any notification when app is closed, and also onMessageReceive method is not triggered. In bellow image show data payload click here to view parameter and Response is click here to view response In response success 1 but not receive any notification in redmi phone. 回答1: Supporting Fire-base push notification for all device is like a maze. There are 3 scenario for push notification Foreground (fire FirebaseMessagingService 's onMessageReceived method)

Group ID being ignored when creating NotificationChannel

青春壹個敷衍的年華 提交于 2019-12-11 17:23:04
问题 I'm migrating my apps to Android O (API 26), notification channel group ID always got ignored when creating NotificationChannel: NotificationManager nm; nm.createNotificationChannelGroup(new NotificationChannelGroup("test_group", "Test")); NotificationChannel newCh = new NotificationChannel("test_channel:id123", "Test", NotificationManager.IMPORTANCE_NORMAL); newCh.setGroup("test_group"); nm.createNotificationChannel(newCh); NotificationChannel ch = nm.getNotificationChannel("test_channel

Context.startForegroundService() did not then call Service.startForeground() In BroadcastReceiver

倾然丶 夕夏残阳落幕 提交于 2019-12-11 16:05:57
问题 I need your help to resolve this problem : Context.startForegroundService() did not then call Service.startForeground() I'm using a BroadcastReceiver to start the notification service : @Override public void onReceive(Context context, Intent intent) { WakeLock.acquire(context); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { ContextCompat.startForegroundService(context, new Intent(context, StartNotificationService.class).putExtras(intent)); } else { context.startService(new Intent

Blank notification appears without any code call

て烟熏妆下的殇ゞ 提交于 2019-12-11 15:22:19
问题 i experience pretty weird thing in my android app. In some unknown for me cases sometimes blank notification apperas in notification bar, without any title, body and with default gray color. The only filled thing is icon, which is my default application icon(from manifest). There is only one place in project when i create notification manually - intent service that sends data via rest api. Notification have his own icon (different than default), color, text, progressbar and works fine when

How to set sound for notification?

邮差的信 提交于 2019-12-11 14:38:19
问题 I copied the .mp3 file in assets. When notification raises, file is not playing Could anyone please help me. notification.sound = Uri.parse("file:///android_assets/alarm_951.mp3"); 回答1: try the following: notifyDetails.flags = Notification.FLAG_ONLY_ALERT_ONCE | Notification.FLAG_SHOW_LIGHTS | Notification.FLAG_AUTO_CANCEL; 回答2: Instead of copying your file to the assets folder copy it to resources/raw/ and then use Uri sound = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw