3

I am setting AlarmManager for scheduling local notification. I have tried many different solution like this, but all in vain. That answer suggest me to use setExact() and setExactAndAllowWhileIdle() methods for different version of apis code sample below:

if (Build.VERSION.SDK_INT >= 23) {
    alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP,
            triggerTime, intent);
} else if (Build.VERSION.SDK_INT >= 19) {
    alarmManager.setExact(AlarmManager.RTC_WAKEUP, triggerTime, intent);
} else {
    alarmManager.set(AlarmManager.RTC_WAKEUP, triggerTime, intent);
}

I am checking the device alarm with command adb shell dumpsys alarm. Alarms are there, but not triggering.

Batch{365d942c num=2 start=132037642 end=132037642}:


 RTC_WAKEUP #1: Alarm{2f05aef5 type 0 when 1506076080000 com.mominapp.mominapp PRAYER_TIME_NOTIFICATION_ACTION}
    tag=*walarm*:PRAYER_TIME_NOTIFICATION_ACTION
    type=0 whenElapsed=+35m18s677ms when=2017-09-22 15:28:00
    window=0 repeatInterval=0 count=0
    operation=PendingIntent{738548a: PendingIntentRecord{297a3afb com.mominapp.mominapp broadcastIntent}}

This shows that my application has an alarm scheduled at 15:28 but it is not triggered by any mean. I am facing this problem specially for OPPO and Samsung Devices.

Any help will be appreciated. Kind Regards.

serv-inc
  • 35,772
  • 9
  • 166
  • 188
rana_sadam
  • 1,216
  • 10
  • 18

1 Answers1

0

Make sure auto-restart mode and background data turned on?

Also in oppo device make sure

SETTING - BATTERY - OTHERS - choose the app that you want to keep notification - turn off FREEZE BACKGROUND APPS

SETTING - BATTERY Low Power Mode must be OFF

Rajesh N
  • 6,198
  • 2
  • 47
  • 58
  • Some app is working on same device with Freeze mode and power saving mode thats why my client is stuck with this. – rana_sadam Nov 15 '17 at 06:50