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
9bcabe5a
Commit
9bcabe5a
authored
Jan 03, 2015
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cancel multiple notifications at once (iOS)
parent
0840fb0e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
21 deletions
+26
-21
CHANGELOG.md
CHANGELOG.md
+1
-1
APPLocalNotification.m
src/ios/APPLocalNotification.m
+7
-1
local-notification.js
www/local-notification.js
+18
-19
No files found.
CHANGELOG.md
View file @
9bcabe5a
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
-
[
enhancement:
]
Callbacks for
`add`
,
`cancel`
&
`cancelAll`
-
[
enhancement:
]
Callbacks for
`add`
,
`cancel`
&
`cancelAll`
-
[
enhancement:
]
`image:`
accepts remote URLs and local URIs (Android)
-
[
enhancement:
]
`image:`
accepts remote URLs and local URIs (Android)
-
[
enhancement:
]
Schedule multiple notifications at once (Android)
-
[
enhancement:
]
Schedule multiple notifications at once (Android)
-
[
enhancement:
]
Cancel multiple notifications at once
(Android)
-
[
enhancement:
]
Cancel multiple notifications at once
-
[
enhancement:
]
Clear multiple notifications at once (Android)
-
[
enhancement:
]
Clear multiple notifications at once (Android)
-
[
enhancement:
]
`clear`
&
`clearAll`
methods (Android)
-
[
enhancement:
]
`clear`
&
`clearAll`
methods (Android)
-
[
enhancement:
]
`onclear`
event (Android)
-
[
enhancement:
]
`onclear`
event (Android)
...
...
src/ios/APPLocalNotification.m
View file @
9bcabe5a
...
@@ -93,16 +93,22 @@
...
@@ -93,16 +93,22 @@
-
(
void
)
cancel
:(
CDVInvokedUrlCommand
*
)
command
-
(
void
)
cancel
:(
CDVInvokedUrlCommand
*
)
command
{
{
[
self
.
commandDelegate
runInBackground
:
^
{
[
self
.
commandDelegate
runInBackground
:
^
{
NS
String
*
id
=
[[
command
arguments
]
NS
Array
*
ids
=
[[
command
arguments
]
objectAtIndex
:
0
];
objectAtIndex
:
0
];
for
(
NSString
*
id
in
ids
)
{
UILocalNotification
*
notification
;
UILocalNotification
*
notification
;
notification
=
[[
UIApplication
sharedApplication
]
notification
=
[[
UIApplication
sharedApplication
]
scheduledLocalNotificationWithId
:
id
];
scheduledLocalNotificationWithId
:
id
];
if
(
!
notification
)
continue
;
[
self
cancelLocalNotification
:
notification
];
[
self
cancelLocalNotification
:
notification
];
[
self
fireEvent
:
@"cancel"
localNotification
:
notification
];
[
self
fireEvent
:
@"cancel"
localNotification
:
notification
];
}
[
self
execCallback
:
command
];
[
self
execCallback
:
command
];
}];
}];
}
}
...
...
www/local-notification.js
View file @
9bcabe5a
...
@@ -172,19 +172,28 @@ exports.clearAll = function (callback, scope) {
...
@@ -172,19 +172,28 @@ exports.clearAll = function (callback, scope) {
};
};
/**
/**
* Cancels the specified notification.
* Cancels the specified notification
s
.
*
*
* @param {String
} id
* @param {String
[]} ids
* The ID
of the notification
* The ID
s of the notifications
* @param {Function} callback
* @param {Function} callback
* A function to be called after the notification has been canceled
* A function to be called after the notification
s
has been canceled
* @param {Object} scope
* @param {Object} scope
* The scope for the callback function
* The scope for the callback function
*/
*/
exports
.
cancel
=
function
(
id
,
callback
,
scope
)
{
exports
.
cancel
=
function
(
ids
,
callback
,
scope
)
{
var
notId
=
(
id
||
'0'
).
toString
();
ids
=
Array
.
isArray
(
ids
)
?
ids
:
[
ids
];
for
(
var
i
=
0
;
i
<
ids
.
length
;
i
++
)
{
ids
[
i
]
=
ids
[
i
].
toString
();
}
if
(
device
.
platform
!=
'iOS'
)
{
ids
=
ids
[
0
];
}
this
.
exec
(
'cancel'
,
notId
,
callback
,
scope
);
this
.
exec
(
'cancel'
,
ids
,
callback
,
scope
);
};
};
/**
/**
...
@@ -304,11 +313,7 @@ exports.registerPermission = function (callback, scope) {
...
@@ -304,11 +313,7 @@ exports.registerPermission = function (callback, scope) {
* The callback function's scope
* The callback function's scope
*/
*/
exports
.
promptForPermission
=
function
(
callback
,
scope
)
{
exports
.
promptForPermission
=
function
(
callback
,
scope
)
{
console
.
warn
(
'Depreated: Please use `notification.local.registerPermission` instead.'
);
console
.
warn
(
'`notification.local.promptForPermission` is deprecated,'
,
'please use `notification.local.registerPermission`.'
);
exports
.
registerPermission
.
apply
(
this
,
arguments
);
exports
.
registerPermission
.
apply
(
this
,
arguments
);
};
};
...
@@ -613,13 +618,7 @@ exports.createCallbackFn = function (callbackFn, scope) {
...
@@ -613,13 +618,7 @@ exports.createCallbackFn = function (callbackFn, scope) {
*/
*/
exports
.
exec
=
function
(
action
,
args
,
callback
,
scope
)
{
exports
.
exec
=
function
(
action
,
args
,
callback
,
scope
)
{
var
fn
=
this
.
createCallbackFn
(
callback
,
scope
),
var
fn
=
this
.
createCallbackFn
(
callback
,
scope
),
params
=
[];
params
=
args
?
[
args
]
:
[];
if
(
Array
.
isArray
(
args
))
{
params
=
args
;
}
else
if
(
args
)
{
params
.
push
(
args
);
}
exec
(
fn
,
null
,
'LocalNotification'
,
action
,
params
);
exec
(
fn
,
null
,
'LocalNotification'
,
action
,
params
);
};
};
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