0

I am working on an Ionic (Angular + Cordova) app and using the @ionic-native/local-notifications plugin to schedule reminder notifications.

On iOS, interval notifications do not show at all when the device is locked.

On Android, interval notifications work for the first 2–3 times, but after that they stop showing when the device is locked.

I've verified notification permissions are granted.

It works sometimes when the app is foregrounded, but not reliably in the background or on the lock screen.

import { LocalNotifications, ELocalNotificationTriggerUnit } from '@ionic-native/local-notifications/ngx';

@Injectable()
export class NotificationService {
  constructor(private localNotifications: LocalNotifications) {}

  // Call this method to send a repeating notification
  sendIntervalNotification() {
    this.localNotifications.schedule({
      id: 1,
      title: 'Reminder',
      text: 'This is your scheduled notification',
      trigger: {
        every: { minute: 1 },   // runs every 1 minute
        count: 10               // total number of times to repeat
      },
      foreground: true,          // show when app is foregrounded
      lockscreen: true           // try to display on lockscreen
    });
  }
}

How can I make recurring/interval local notifications work consistently on both iOS and Android, even when the app is in the background or the device is locked?

1
  • Make sure requestPermissions() resolves before scheduling. this.LocalNotifications.requestPermissions(); this.localNotifications.schedule({ id: 1, title: 'Reminder', text: 'This is your scheduled notification', trigger: { every: { minute: 1 }, // runs every 1 minute count: 10 // total number of times to repeat }, foreground: true, // show when app is foregrounded lockscreen: true // try to display on lockscreen }); } Commented Oct 16 at 13:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.