notifications

Notify inactive users (who have not opened the app for 7 days) even if Android app gets killed or runs in background

依然范特西╮ 提交于 2020-08-26 13:35:33
问题 I have a requirement where I need to notify inactive users (who have not opened the app for 7 days). This means the notification must be sent if the app is in background for 7 days or the app has been killed and not used for 7 days. I followed an algorithm using AlarmManager similar to this answer but the notifications are not sent if the app gets killed. I tried to integrate BroadcastReceiver as shown below but it creates an infinite loop when I call it from OnDestroy() of CheckRecentRun

Notify inactive users (who have not opened the app for 7 days) even if Android app gets killed or runs in background

北城余情 提交于 2020-08-26 13:34:39
问题 I have a requirement where I need to notify inactive users (who have not opened the app for 7 days). This means the notification must be sent if the app is in background for 7 days or the app has been killed and not used for 7 days. I followed an algorithm using AlarmManager similar to this answer but the notifications are not sent if the app gets killed. I tried to integrate BroadcastReceiver as shown below but it creates an infinite loop when I call it from OnDestroy() of CheckRecentRun

Notify inactive users (who have not opened the app for 7 days) even if Android app gets killed or runs in background

时间秒杀一切 提交于 2020-08-26 13:34:21
问题 I have a requirement where I need to notify inactive users (who have not opened the app for 7 days). This means the notification must be sent if the app is in background for 7 days or the app has been killed and not used for 7 days. I followed an algorithm using AlarmManager similar to this answer but the notifications are not sent if the app gets killed. I tried to integrate BroadcastReceiver as shown below but it creates an infinite loop when I call it from OnDestroy() of CheckRecentRun

TIme-based Notification Architecture

六眼飞鱼酱① 提交于 2020-08-24 04:00:46
问题 I am designing a notification service (server). I can have two kinds of notifications: one which is delivered immediately, and the other is delivered at some time in the future. Is there a framework to handle the future notifications? I know I can write background worker who can for example sample the DB to look for a notification which needs to be sent, but I sure millions tried to solve this problem already and I'd prefer to reuse a proven solution. I didn't decide yet on the framework / DB

AVPlayer audioSessionGotInterrupted notification when waking up from background

戏子无情 提交于 2020-08-21 18:40:05
问题 I use AVAudioPlayer to play audio. I have background audio enabled and the audio sessions are configured correctly. I implemented the audioSessionGotInterrupted method to be informed if the audio session gets interrupted. This is my current code: @objc private func audioSessionGotInterrupted(note: NSNotification) { guard let userInfo = note.userInfo, let typeValue = userInfo[AVAudioSessionInterruptionTypeKey] as? UInt, let type = AVAudioSessionInterruptionType(rawValue: typeValue) else {

AVPlayer audioSessionGotInterrupted notification when waking up from background

拥有回忆 提交于 2020-08-21 18:39:47
问题 I use AVAudioPlayer to play audio. I have background audio enabled and the audio sessions are configured correctly. I implemented the audioSessionGotInterrupted method to be informed if the audio session gets interrupted. This is my current code: @objc private func audioSessionGotInterrupted(note: NSNotification) { guard let userInfo = note.userInfo, let typeValue = userInfo[AVAudioSessionInterruptionTypeKey] as? UInt, let type = AVAudioSessionInterruptionType(rawValue: typeValue) else {

Monitoring Screensaver Events in OSX

时光毁灭记忆、已成空白 提交于 2020-08-21 04:51:13
问题 I want to monitor screensaver and lockscreen events on an OSX box. As a first pass, I'm fine with them just printing to the console. Following the advice of another's question, I wrote some Objective C to listen for Cocoa Notifications for the com.apple.screensaver.didstart , com.apple.screensaver.didstop , com.apple.screenIsLocked , and com.apple.screenIsUnlocked events. // ScreenSaverMonitor.h #import <Foundation/NSObject.h> #import <Foundation/NSNotification.h> @interface

Android Heads-up notification disappears after a few seconds

五迷三道 提交于 2020-08-15 05:52:27
问题 I would that the notification does not disappear after a few seconds. So i have create the notification like this: NotificationCompat.Builder builder = new NotificationCompat.Builder(context); builder.setSmallIcon(R.drawable.cast_ic_notification_small_icon) .setDefaults(Notification.FLAG_ONGOING_EVENT) .setPriority(Notification.PRIORITY_HIGH) .setContentTitle(notificationDetails.getSubject()) .setContentText(notificationDetails.getMessage()) .setColor(context.getResources().getColor(R.color

Android 9 Api 28 Notification not showing

不问归期 提交于 2020-08-11 06:15:30
问题 I'm trying to show notification but it's not working for both Oreo and Pie version. It's working in kitkat version. I tried all the possible condition i can do, i don't know what else i'm missing here Here is my code: String idChannel = "my_channel_01"; Intent mainIntent; mainIntent = new Intent(ChecklistOptionActivity.this, CashCountOptionActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, mainIntent, 0); NotificationManager mNotificationManager =

Android 9 Api 28 Notification not showing

[亡魂溺海] 提交于 2020-08-11 06:14:33
问题 I'm trying to show notification but it's not working for both Oreo and Pie version. It's working in kitkat version. I tried all the possible condition i can do, i don't know what else i'm missing here Here is my code: String idChannel = "my_channel_01"; Intent mainIntent; mainIntent = new Intent(ChecklistOptionActivity.this, CashCountOptionActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, mainIntent, 0); NotificationManager mNotificationManager =