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

'schedule' is event not firing #1182

Closed
RyanTully opened this issue Jan 6, 2017 · 5 comments
Closed

'schedule' is event not firing #1182

RyanTully opened this issue Jan 6, 2017 · 5 comments

Comments

@RyanTully
Copy link

RyanTully commented Jan 6, 2017

Hi Katzer/Team,

I'm using the ios10 version of the plugin: de.applant.cordova.plugin.local-notification 0.8.5-dev "LocalNotification" and can't seem to get the 'schedule' event to fire.

I'm running:
Cordova v6.4.0
Cordova ios v4.3.1
Testing with ios 10.1

The 'trigger' and 'click' events work ok.

Below is my code to schedule the event (title, text and date variables are preset)

   cordova.plugins.notification.local.schedule({
		id: 1,
		title: data.title[ctrl.rmdTitle[1]],
		text: data.text[ctrl.rmdText[1]],
		at: date,
		data: { meetingId:"#123FG8"}
	});

These are my event handlers:

This doesn't seem to fire -

    cordova.plugins.notification.local.on("schedule", function(notification) {
		alert("scheduled: " + notification.id);
	});

but these fire ok -

    cordova.plugins.notification.local.on("trigger", function(notification) {
	alert("triggered: " + notification.id);
});

cordova.plugins.notification.local.on("click", function(notification) {
	alert("clicked: " + notification.id);
});

Can anyone see what I'm doing wrong?

Thanks

@rwillett rwillett added the ios label Apr 10, 2017
@rwillett
Copy link
Collaborator

Is this still a problem? if so, update with template #1188

@rwillett
Copy link
Collaborator

Closed as no update from original poster.

@RyanTully
Copy link
Author

Hello,

Sorry for the delay in responding, I've been away for some time.

I can confirm that the issue still persists with iOS 10. Code works as expected when tested with iPhone 6 simulator - OS 9.

Environmnet
de.appplant.cordova.plugin.local-notification 0.8.5-dev
iOS
iPhone 6 Simulator - OS 10.3
iPhone 6 Handset - OS 10.0.2
Cordova 6.5.0
Cordova ios 4.3.1
Xcode 8.3.2

Expected Behaviour
alert should appear when schedule handler fires

Actual Behaviour
alert does not appear

Steps to Reproduce
Code examples provided in previous post

Context
I wanted to hook onto this event to initiate a database insert. I'm no longer using this methodology but have re-opened the issue as is it still appears that the event does not fire.

Xcode Warnings Log

'CDVLocalNotification' is deprecated: Deprecated in Cordova 4.0. Functionality removed in 4.0, constant will be removed in 5.0
AppDelegate+APPAppEvent.m:79:32:
'CDVLocalNotification' has been explicitly marked deprecated here

I'm not so familiar with Xcode so if there is another log output you require could you tell me what launch argument is required for the debugger.

Thanks

Ryan

@GeneralUSA
Copy link

GeneralUSA commented Nov 8, 2017

Hi Ryan,

Not sure if you resolved your issue. I am a complete newbie to mobile app development and am working out through tutorials how to get Local Notification to work in my app. I am nearly there, but having issues too with my "Schedule" button activating. I say all this in hopes that this tip may help you. If not, hope someone else can help you.

One of my tutorials told me to replace CDV in the config.xml file with "GAP", all lowercase.

<widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://cordova.apache.org/ns/1.0">

Not sure if same issue for you, but perhaps. If not, I also came across Issues 1096 and 1093, which could relate to your issue.

@RyanTully
Copy link
Author

Hi GeneralUSA,

Thank you for your tips. In the end I used a different method to achieve what I wanted which didn't rely on the schedule event firing. I detailed here as a bug as I thought it will probably be an issue for someone else.

No doubt I will need to use it at some point and will make use of your notes above.

Ryan

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

No branches or pull requests

3 participants