question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Repeated local notification not working

See original GitHub issue
  • Plugin version: cordova-plugin-local-notification 0.9.0-beta.2 “LocalNotification”

  • Platform: Android

  • OS version: 6.0.1

  • Device manufacturer / model: Samsung J5

  • Cordova version (cordova -v): 8.0.0

  • Cordova platform version (cordova platform ls): 7.0.0

  • Plugin config:

    this.localNotifications.schedule({ id: notificationId, title: title, text: text, icon: “res://icon”, smallIcon: “res://notification”, color: ‘#000000’, every: { weekday: 5, hour: 18, minute: 37 } });

  • Ionic Version: 4.0.1

Expected Behavior

I need to schedule one repeatable local notification to every Friday at 19h.

Actual Behavior

I using your plugin in ionic (https://ionicframework.com/docs/native/local-notifications/) but the parameters to repeat notifications is different of docs. In my case, parameters same every is a ELocalNotificationTriggerUnit, not string (like your docs). I’m trying create a schedule and repeatable notification in all Fridays of weeks but, this not working because, the comments of plugin file not light my life to perfect understand a method to implement that.

I try to implement equals actual docs but, not working.

This is the parameters of ILocalNotificationTrigger:

 /**
 * The date and time when the system should deliver the local notification. If the specified value is nil or is a date in the past, the local notification is delivered immediately.
 * Default: now ~ new Date()
 */
at?: Date;

/** ***** TIMESPAN ***** */
/**
 * Amount of units
 */
in?: number;

/**
 * Unit
 */
unit?: ELocalNotificationTriggerUnit;

/** ***** REPEAT/MATCH ***** */
/**
 * Amount of units
 */
count?: number;

/**
 * The unit
 */
every?: ELocalNotificationTriggerUnit;

/**
 * The end of the repeating notification
 */
before?: Date;

/**
 * The date and time when the system should deliver the local notification. If the specified value is nil or is a date in the past, the local notification is delivered immediately.
 * Only for "repeat"
 * Default: now ~ new Date()
 */
firstAt?: Date;

/**
 * Only for "match"
 */
after?: Date;

How i make that? Sorry for my mistake and thanks for your attention.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
Simpler1commented, Sep 6, 2018

Try:

        cordova.plugins.notification.local.schedule({
          id: notificationId,
          title: title,
          text: text,
          trigger: {
            every: {
              weekday: 5,
              hour: 19,
              minute: 0,
            },
            count: 365,
          },
        });
0reactions
mschristocommented, Mar 7, 2019

Check this #1533

Read more comments on GitHub >

github_iconTop Results From Across the Web

repeating local notifications | Apple Developer Forums
I am having trouble making my app. I am making an app that configures notifications on a save button and many of these...
Read more >
Repeating local notification not updating content
Unable to update local scheduled notification content - not a solution. I'm creating a single repeating request (I tried it and it did...
Read more >
Repeated local notification not working - Ionic Native
I need to schedule one repeatable local notification to every Friday at 19h. I using latest version of Local Notifications plugin (https:// ...
Read more >
How is it possible to create highly customised repeated local ...
I am able to create local notification with the very basic repetitive rule. Repeat yearly. var dateComponents = DateComponents() dateComponents.
Read more >
Scheduling notifications: UNUserNotificationCenter and ...
So, in order to send local notifications in our app, we first need to request permission, and that's what we'll put in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found