android-notifications

Flutter: Push notifications even if the app is closed

杀马特。学长 韩版系。学妹 提交于 2020-01-12 03:13:25
问题 I have built an application with flutter that works like a reminder. How can I display notifications to the user even though the app is closed? 回答1: For reminders i would recomend Flutter Local Notifications Plugin. It has a powerful scheduling api. From the documentation of local notification: Scheduling when notifications should appear - Periodically show a notification (interval-based) - Schedule a notification to be shown daily at a specified time - Schedule a notification to be shown

How to show a Notification on Oreo?

蓝咒 提交于 2020-01-11 14:37:12
问题 Notification doesn't shown on above V26 API.Notification cshown on v25 but when i checked it on v27 than the notification doesn't appear. My code to StartService and create notification. Inside Mainctivity onCreate() Intent intent1 = new Intent(this, NotificationService.class); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { ContextCompat.startForegroundService(this, intent1); } else { startService(intent1); } NotificationService extends Service onCreateMethod i call the method

Xamarin Forms Android not receiving Push notifications when closed

为君一笑 提交于 2020-01-11 11:19:09
问题 I am following this walkthrough for creating push notifications into a Xamarin forms app https://docs.microsoft.com/en-us/azure/notification-hubs/notification-hubs-android-push-notification-google-fcm-get-started I have successfully integrated with NotificationHub and can receive test messages on the device when app is in focus or in background I cannot, however, manage to make the app wake in order to receive messages, which is the main reason for having notifications There are a great many

Icon is not getting displayed in notification in Android nougat

蹲街弑〆低调 提交于 2020-01-10 02:29:42
问题 I researched about this and found out that addAction (int icon, CharSequence title, PendingIntent intent) is deprecated, so I used addAction (Notification.Action action) . In both the cases, icon cant be seen. NotificationCompat.Action action = new NotificationCompat.Action.Builder(R.drawable.ic_share, "", pendingIntent).build(); notificationBuilder.addAction(action); The text seems to be working though, but I have left it blank, hence there is an empty space below the main image, where icon

I want to generate android notification or alarm every day

旧城冷巷雨未停 提交于 2020-01-07 07:49:19
问题 In my application i need to deploy a some kind of reminder. that every day at any fixed time my application generate a notification.. and it happens if my application is running or not. (e.g by using background service) I am able to generate notification, but im un able to create logic to generate it every day. Please help if any one understand what i want. Thanks in advance. 回答1: See below link and this is work for me. Create alarm set on a specified time, using AlarmManager Repeat alarm

How to send notification between two application

两盒软妹~` 提交于 2020-01-07 03:56:09
问题 I want to send push notification from Device "A" with Application "A" to Device "B" with application "B" how I can achieve that? Any help will be appreciated. can I use firebase with that? With parse I can define that with number like : ParseQuery query = ParseInstallation.getQuery(); query.whereEqualTo("phone", "1234567890"); ParsePush push = new ParsePush(); push.setQuery(query); push.sendPushInBackground(); how can I achieve that in other cases ? 回答1: You'd probably have to go with

Android Wear notification not showing

倖福魔咒の 提交于 2020-01-06 21:36:25
问题 Hi I'm writing an Android Wear app that allows the user to control a music player from their watch. I'm trying to do it with a notification with two action buttons. Below is the code that creates/updates the notification when the currently playing song changes, it is from OnDataChanged() from the WearableListenerService . The data arrives on the emulator as expected and the notification builder is constructed correctly, as I can see it in the debugger. Also the final log line is executed and

Android Wear notification not showing

旧街凉风 提交于 2020-01-06 21:36:09
问题 Hi I'm writing an Android Wear app that allows the user to control a music player from their watch. I'm trying to do it with a notification with two action buttons. Below is the code that creates/updates the notification when the currently playing song changes, it is from OnDataChanged() from the WearableListenerService . The data arrives on the emulator as expected and the notification builder is constructed correctly, as I can see it in the debugger. Also the final log line is executed and

how to show compact notification if it is available on the user device?

邮差的信 提交于 2020-01-06 08:22:08
问题 I am trying to show a compact notification like so (the one that expand and collapse): mIcon = R.drawable.ic_launcher; Notification noti = new Notification.Builder(mContext) .setContentTitle(mContentTitle) .setContentText(mContentText) .setSmallIcon(mIcon) .setLargeIcon(mIcon2) .setStyle(new Notification.BigTextStyle() .bigText(mContentText)) .build(); I am getting the following errors: Call requires API level 16 (current min is 11): android.app.Notification.Builder#setStyle The method

NotificationCompat.PRIORITY_DEFAULT doesn't make sound on older OS versions

懵懂的女人 提交于 2020-01-06 07:05:10
问题 I don't specify any sound (resource), I want to use the default sound It works fine on Android 8 and 9 But on Android 4-7 it triggers notification without sound How can I make the same behavior on all Android? Notificaiton builder: NotificationCompat.Builder(this, channelId) .setSmallIcon(R.drawable.notify_icon .setContentTitle(title) .setContentText(subtitle) .setPriority(if (Prefs.isNotificationSound) NotificationCompat.PRIORITY_DEFAULT else NotificationCompat.PRIORITY_LOW) .setCategory