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.

How to set up a daily notification?

See original GitHub issue

WARNING: IF YOU IGNORE THIS TEMPLATE, WE’LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!

Provide a general summary of the issue.

Just seeing a compile time error trying to setup the following:

      const input = {
        title: 'daily notification',
        trigger: { every: 'day', at: {hour: 8, minute: 0} }
      };
      this.localNotifications.schedule(input);

I get the following error:

[ts]
Argument of type '{ trigger: { every: string; at: { hour: number; minute: number; }; }; }' is not assignable to parameter of type 'ILocalNotification | ILocalNotification[]'.
  Type '{ trigger: { every: string; at: { hour: number; minute: number; }; }; }' is not assignable to type 'ILocalNotification[]'.
    Property 'length' is missing in type '{ trigger: { every: string; at: { hour: number; minute: number; }; }; }'.

Your Environment

  • Plugin version: 0.9.0-beta.2
  • Platform: Android
  • OS version: 8.0
  • Device manufacturer / model: emulator
  • Cordova version (cordova -v): 8.0.0
  • Cordova platform version (cordova platform ls):
Installed platforms:
  android 7.0.0
  ios 4.5.5
Available platforms:
  browser ~5.0.1
  osx ~4.0.1
  windows ~5.0.0
  www ^3.12.0
  • Plugin config
  • Ionic Version (if using Ionic): 4.1.2

Expected Behavior

How to set up a trigger to a daily notification at a hour/minute.

Actual Behavior

Steps to Reproduce

Context

What were you trying to do?

Debug logs

Include iOS / Android logs

  • ios XCode logs
  • Android: $ adb logcat

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:8

github_iconTop GitHub Comments

1reaction
Tawpiecommented, Sep 27, 2018

I may be wrong (I’m not an ionic person!) but I believe the suggestion is to replace

this.localNotifications.schedule(input);

with

cordova.plugins.notification.local.schedule();

0reactions
Simpler1commented, Nov 19, 2018

I haven’t been able to successfully get a daily notification to work either. It seems to work sometimes, but not others. If you look at the scheduled notifications, they show that they are set, but they don’t trigger.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use Reminders on your iPhone, iPad, or iPod touch
Open the Reminders app. Tap + New Reminder, then type your reminder. An iPhone showing the New Reminder screen, where you can add...
Read more >
Create, find & edit reminders in Google Calendar - Android
Open the Google Calendar app Calendar . In the bottom right, tap Create Create event and then Reminder. Enter your reminder, or choose...
Read more >
How to Set Up Recurring Reminders on iPhone and iPad
First, launch the Reminders app on your iPhone or iPad. The interface will vary slightly between the two platforms, but the options are ......
Read more >
How to create recurring reminders on iPhone and iPad
Launch the Reminders app on your iPhone or iPad. · Enter a title for your reminder as you normally would. · Tap the...
Read more >
How to Set Up Recurring Reminders On Windows
Weekly, daily, or perhaps even every few minutes? That is not that easy to implement. Most reminder apps on Android or iOS don't...
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