Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cordova-plugin-local-notifications
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nabil Sadki
cordova-plugin-local-notifications
Commits
823b98b3
Commit
823b98b3
authored
Jun 07, 2014
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add callback to `add`
parent
86975e60
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
10 deletions
+16
-10
CHANGELOG.md
CHANGELOG.md
+1
-1
README.md
README.md
+2
-2
APPLocalNotification.m
src/ios/APPLocalNotification.m
+2
-1
local-notification.js
www/local-notification.js
+11
-6
No files found.
CHANGELOG.md
View file @
823b98b3
...
...
@@ -2,7 +2,7 @@
#### Version 0.8.0 (not yet released)
-
[
enhancement:
]
Android 2.x (SDK >= 7) support (Thanks to
**khizarsonu**
)
-
[
enhancement:
]
Scope parameter for
`isScheduled`
and
`getScheduledIds`
-
[
enhancement:
]
Callbacks for
`cancel`
&
`cancelAll`
-
[
enhancement:
]
Callbacks for
`
add`
,
`
cancel`
&
`cancelAll`
-
[
enhancement:
]
`image:`
accepts remote URLs and local URIs (Android)
-
[
feature:
]
New Android specific
`led:`
flag.
...
...
README.md
View file @
823b98b3
...
...
@@ -72,7 +72,7 @@ More informations can be found [here][PGB_plugin].
#### Version 0.8.0 (not yet released)
-
[
enhancement:
]
Android 2.x (SDK >= 7) support (Thanks to
**khizarsonu**
)
-
[
enhancement:
]
Scope parameter for
`isScheduled`
and
`getScheduledIds`
-
[
enhancement:
]
Callbacks for
`cancel`
&
`cancelAll`
-
[
enhancement:
]
Callbacks for
`
add`
,
`
cancel`
&
`cancelAll`
-
[
enhancement:
]
`image:`
accepts remote URLs and local URIs (Android)
-
[
feature:
]
New Android specific
`led:`
flag
...
...
@@ -122,7 +122,7 @@ window.plugin.notification.local.add({
json
:
String
,
// Data to be passed through the notification
autoCancel
:
Boolean
,
// Setting this flag and the notification is automatically canceled when the user clicks it
ongoing
:
Boolean
,
// Prevent clearing of notification (Android only)
});
}
,
callback
,
scope
);
```
### Cancel scheduled local notifications
...
...
src/ios/APPLocalNotification.m
View file @
823b98b3
...
...
@@ -115,6 +115,7 @@
}
[
self
scheduleNotificationWithProperties
:
properties
];
[
self
execCallback
:
command
];
}];
}
...
...
@@ -277,7 +278,7 @@
NSTimeInterval
fireDateDistance
=
[
now
timeIntervalSinceDate
:
fireDate
];
if
(
notification
.
repeatInterval
==
NS
EraCalendarUnit
if
(
notification
.
repeatInterval
==
NS
CalendarUnitEra
&&
fireDateDistance
>
seconds
)
{
[
self
cancelNotification
:
notification
fireEvent
:
YES
];
}
...
...
www/local-notification.js
View file @
823b98b3
...
...
@@ -103,7 +103,7 @@ LocalNotification.prototype = {
defaults
.
smallImage
=
null
;
defaults
.
image
=
null
;
defaults
.
wideImage
=
null
;
}
;
}
return
defaults
;
},
...
...
@@ -122,11 +122,12 @@ LocalNotification.prototype = {
* The new callback function
*/
createCallbackFn
:
function
(
callbackFn
,
scope
)
{
if
(
typeof
callbackFn
!=
'function'
)
return
;
return
function
()
{
if
(
typeof
callbackFn
==
'function'
)
{
callbackFn
.
apply
(
scope
||
this
,
arguments
);
}
}
};
},
/**
...
...
@@ -134,13 +135,17 @@ LocalNotification.prototype = {
*
* @param {Object} options
* The notification properties
* @param {Function} callback
* A function to be called after the notification has been canceled
* @param {Object} scope
* The scope for the callback function
*
* @return {Number}
* The notification's ID
*/
add
:
function
(
options
)
{
add
:
function
(
options
,
callback
,
scope
)
{
var
options
=
this
.
mergeWithDefaults
(
options
),
callbackFn
=
null
;
callbackFn
=
this
.
createCallbackFn
(
callback
,
scope
)
;
if
(
options
.
id
)
{
options
.
id
=
options
.
id
.
toString
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment