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
63c99d3e
Commit
63c99d3e
authored
Jan 31, 2018
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow prio as an alias for priority and allow priority to take a string like "high" instead of 1
parent
b4631b8f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
12 deletions
+28
-12
local-notification.js
www/local-notification.js
+28
-12
No files found.
www/local-notification.js
View file @
63c99d3e
...
...
@@ -587,18 +587,6 @@ exports._convertProperties = function (options) {
options
.
badge
=
parseToInt
(
'badge'
,
options
);
}
if
(
options
.
priority
)
{
options
.
priority
=
parseToInt
(
'priority'
,
options
);
}
if
(
options
.
foreground
===
true
)
{
options
.
priority
=
Math
.
max
(
options
.
priority
,
1
);
}
if
(
options
.
foreground
===
false
)
{
options
.
priority
=
Math
.
min
(
options
.
priority
,
0
);
}
if
(
options
.
defaults
)
{
options
.
defaults
=
parseToInt
(
'defaults'
,
options
);
}
...
...
@@ -617,6 +605,7 @@ exports._convertProperties = function (options) {
options
.
data
=
JSON
.
stringify
(
options
.
data
);
this
.
_convertPriority
(
options
);
this
.
_convertTrigger
(
options
);
this
.
_convertActions
(
options
);
this
.
_convertProgressBar
(
options
);
...
...
@@ -625,6 +614,33 @@ exports._convertProperties = function (options) {
};
/**
* Convert the passed values for the priority to their required type.
*
* @param [ Map ] options Set of custom values.
*
* @return [ Map ] Interaction object with trigger spec.
*/
exports
.
_convertPriority
=
function
(
options
)
{
var
prio
=
options
.
priority
||
options
.
prio
||
0
;
if
(
typeof
prio
===
'string'
)
{
prio
=
{
min
:
-
2
,
low
:
-
1
,
high
:
1
,
max
:
2
}[
prio
]
||
0
;
}
if
(
options
.
foreground
===
true
)
{
prio
=
Math
.
max
(
prio
,
1
);
}
if
(
options
.
foreground
===
false
)
{
prio
=
Math
.
min
(
prio
,
0
);
}
options
.
priority
=
prio
;
return
options
;
};
/**
* Convert the passed values to their required type, modifying them
* directly for Android and passing the converted list back for iOS.
*
...
...
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