Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of successful repeating callbacks #1195

Closed
jashachik opened this issue Jan 23, 2017 · 8 comments
Closed

Example of successful repeating callbacks #1195

jashachik opened this issue Jan 23, 2017 · 8 comments

Comments

@jashachik
Copy link

Good evening,

It looks like the callback functionality isn't working as expected.

My code:

window.cordova.plugins.notification.local.schedule({
      id: 1,
      title: "Message Title",
      text: "Message Text",
      at: date,
      every: 'minute',
      ongoing: true
    }, submitCallBack);

Please advise on how to get this working

@rwillett
Copy link
Collaborator

There is an issue template that you should fill in. This helps us without us having to ask what you are doing. See #1188.

However assuming you are using IOS 10, (at: OR firstAt:) AND every: do not work together on IOS 10 and it is unlikely they ever will as Apple appears to have changed their underlying framework. You will need to change your logic in your code.

Rob

@steveracine
Copy link

I have to say, I've seen this posted in just about every thread regarding repeating events, but I'm not seeing that behavior. On my iPhone (iOS 10.2.1) I have a notification using firstAt and every together and it works perfectly.

@Tawpie
Copy link

Tawpie commented Feb 21, 2017 via email

@steveracine
Copy link

steveracine commented Feb 21, 2017

Sure.

I'm not using vanilla Cordova, but I'm building my project using PhoneGap, Cloud Builder, using the most recent version of the plugin. In my config.xml I don't define a version number, so it will pull whatever the master version is.

To schedule the events I use the following settings:

{
	id: i+1,
	title: "STRING",
	text: "STRING",
	firstAt: firstNotification,
	every: "day",
	data: {JSON}
}

Then after I build an array of notifications to register, I call:

cordova.plugins.notification.local.schedule(reminders, function(){
	console.log('notifications scheduled');
	app.loadHUB();
});

There IS a warning that says "Unknown property: firstAt", but the notification will be delivered whether the app is running, in the background, or if the app is closed.

However, I should note that my app has multiple notifications and I'm only receiving a notification alert (for lack of better term) for the ones that were created FIRST. I register 2 notifications at a different spot of my app and I never get the banner on my lockscreen, even though they are triggered as they come up when querying for "triggered" notifications. Same code, but they don't come to the notification tray or lock screen.

Hope that's clear. I'm still trying to debug the second issue, was going to make a new thread, but I'm at a loss as to why it wouldn't work.

EDIT

I output the triggered events when the app is resumed, see attached image.
screen shot 2017-02-21 at 2 20 02 pm

@Tawpie
Copy link

Tawpie commented Feb 21, 2017 via email

@steveracine
Copy link

Very possible. I'll try swapping out the "firstAt" and replace it with "at" to see if the notifications are still successful. Something to note though, the only notification that actually arrives is the one that I schedule with "firstAt". The others I use "at", but they are only 1 time events so I'm not using "every".

Will update after with results.

@rwillett
Copy link
Collaborator

Is this still an issue?

@rwillett
Copy link
Collaborator

Closed as no update from OP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants