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
f0ca49c4
Commit
f0ca49c4
authored
Dec 31, 2015
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #634 Option to skip permission check
parent
731ac9df
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
25 deletions
+55
-25
CHANGELOG.md
CHANGELOG.md
+3
-1
local-notification-core.js
www/local-notification-core.js
+40
-18
local-notification.js
www/local-notification.js
+12
-6
No files found.
CHANGELOG.md
View file @
f0ca49c4
...
...
@@ -7,7 +7,9 @@ Please also read the [Upgrade Guide](https://github.com/katzer/cordova-plugin-lo
-
New
`color`
attribute for Android (Thanks to @Eusebius1920)
-
New
`quarter`
intervall for iOS & Android
-
Made small icon optional (Android)
-
Windows platform does not use hooks anymore
-
Windows platform works without hooks
-
`update`
checks for permission like
`schedule`
-
Fixed #634 option to skip permission check
-
Fixed #588 crash when basename & extension can't be extracted (Android)
-
Fixed #732 loop between update and trigger (Android)
-
Fixed #710 crash due to >500 notifications (Android)
...
...
www/local-notification-core.js
View file @
f0ca49c4
...
...
@@ -55,52 +55,74 @@ exports.setDefaults = function (newDefaults) {
/**
* Schedule a new local notification.
*
* @param {Object}
opt
s
* @param {Object}
msg
s
* 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
* @param {Object?} args
* skipPermission:true schedules the notifications immediatly without
* registering or checking for permission
*/
exports
.
schedule
=
function
(
opts
,
callback
,
scope
)
{
this
.
registerPermission
(
function
(
granted
)
{
exports
.
schedule
=
function
(
msgs
,
callback
,
scope
,
args
)
{
var
fn
=
function
(
granted
)
{
if
(
!
granted
)
return
;
if
(
!
granted
)
return
;
var
notifications
=
Array
.
isArray
(
opts
)
?
opts
:
[
opt
s
];
var
notifications
=
Array
.
isArray
(
msgs
)
?
msgs
:
[
msg
s
];
for
(
var
i
=
0
;
i
<
notifications
.
length
;
i
++
)
{
var
properties
=
notifications
[
i
];
var
notification
=
notifications
[
i
];
this
.
mergeWithDefaults
(
properties
);
this
.
convertProperties
(
properties
);
this
.
mergeWithDefaults
(
notification
);
this
.
convertProperties
(
notification
);
}
this
.
exec
(
'schedule'
,
notifications
,
callback
,
scope
);
},
this
);
};
if
(
args
&&
args
.
skipPermission
)
{
fn
.
call
(
this
,
true
);
}
else
{
this
.
registerPermission
(
fn
,
this
);
}
};
/**
* Update existing notifications specified by IDs in options.
*
* @param {Object}
op
tions
* @param {Object}
notifica
tions
* The notification properties to update
* @param {Function} callback
* A function to be called after the notification has been updated
* @param {Object?} scope
* The scope for the callback function
* @param {Object?} args
* skipPermission:true schedules the notifications immediatly without
* registering or checking for permission
*/
exports
.
update
=
function
(
opts
,
callback
,
scope
)
{
var
notifications
=
Array
.
isArray
(
opts
)
?
opts
:
[
opts
];
exports
.
update
=
function
(
msgs
,
callback
,
scope
,
args
)
{
var
fn
=
function
(
granted
)
{
for
(
var
i
=
0
;
i
<
notifications
.
length
;
i
++
)
{
var
properties
=
notifications
[
i
];
if
(
!
granted
)
return
;
this
.
convertProperties
(
properties
);
}
var
notifications
=
Array
.
isArray
(
msgs
)
?
msgs
:
[
msgs
];
for
(
var
i
=
0
;
i
<
notifications
.
length
;
i
++
)
{
var
notification
=
notifications
[
i
];
this
.
exec
(
'update'
,
notifications
,
callback
,
scope
);
this
.
convertProperties
(
notification
);
}
this
.
exec
(
'update'
,
notifications
,
callback
,
scope
);
};
if
(
args
&&
args
.
skipPermission
)
{
fn
.
call
(
this
,
true
);
}
else
{
this
.
registerPermission
(
fn
,
this
);
}
};
/**
...
...
www/local-notification.js
View file @
f0ca49c4
...
...
@@ -47,29 +47,35 @@ exports.setDefaults = function (defaults) {
/**
* Schedule a new local notification.
*
* @param {Object}
opt
s
* @param {Object}
notification
s
* 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
* @param {Object?} args
* skipPermission:true schedules the notifications immediatly without
* registering or checking for permission
*/
exports
.
schedule
=
function
(
opts
,
callback
,
scope
)
{
this
.
core
.
schedule
(
opts
,
callback
,
scope
);
exports
.
schedule
=
function
(
notifications
,
callback
,
scope
,
args
)
{
this
.
core
.
schedule
(
notifications
,
callback
,
scope
,
args
);
};
/**
* Update existing notifications specified by IDs in options.
*
* @param {Object}
op
tions
* @param {Object}
notifica
tions
* The notification properties to update
* @param {Function} callback
* A function to be called after the notification has been updated
* @param {Object?} scope
* The scope for the callback function
* @param {Object?} args
* skipPermission:true schedules the notifications immediatly without
* registering or checking for permission
*/
exports
.
update
=
function
(
opts
,
callback
,
scope
)
{
this
.
core
.
update
(
opts
,
callback
,
scope
);
exports
.
update
=
function
(
notifications
,
callback
,
scope
,
args
)
{
this
.
core
.
update
(
notifications
,
callback
,
scope
,
args
);
};
/**
...
...
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