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
c88dd6ec
Commit
c88dd6ec
authored
Nov 10, 2017
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Invoke callback for schedule/update with boolean arg if the permission
is granted [Fixes #1187]
parent
7ba39d66
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
15 deletions
+22
-15
LocalNotification.java
src/android/LocalNotification.java
+2
-2
APPLocalNotification.m
src/ios/APPLocalNotification.m
+6
-4
LocalNotificationProxy.js
src/windows/LocalNotificationProxy.js
+2
-2
local-notification-core.js
www/local-notification-core.js
+12
-7
No files found.
src/android/LocalNotification.java
View file @
c88dd6ec
...
@@ -142,11 +142,11 @@ public class LocalNotification extends CordovaPlugin {
...
@@ -142,11 +142,11 @@ public class LocalNotification extends CordovaPlugin {
}
else
}
else
if
(
action
.
equalsIgnoreCase
(
"schedule"
))
{
if
(
action
.
equalsIgnoreCase
(
"schedule"
))
{
schedule
(
args
);
schedule
(
args
);
c
ommand
.
success
(
);
c
heck
(
command
);
}
else
}
else
if
(
action
.
equals
(
"update"
))
{
if
(
action
.
equals
(
"update"
))
{
update
(
args
);
update
(
args
);
c
ommand
.
success
(
);
c
heck
(
command
);
}
else
}
else
if
(
action
.
equals
(
"cancel"
))
{
if
(
action
.
equals
(
"cancel"
))
{
cancel
(
args
);
cancel
(
args
);
...
...
src/ios/APPLocalNotification.m
View file @
c88dd6ec
...
@@ -101,7 +101,7 @@
...
@@ -101,7 +101,7 @@
[
self
scheduleNotification
:
notification
];
[
self
scheduleNotification
:
notification
];
}
}
[
self
execCallba
ck
:
command
];
[
self
che
ck
:
command
];
}];
}];
}
}
...
@@ -131,8 +131,8 @@
...
@@ -131,8 +131,8 @@
[
self
fireEvent
:
@"update"
notification
:
notification
];
[
self
fireEvent
:
@"update"
notification
:
notification
];
}
}
[
self
execCallba
ck
:
command
];
[
self
che
ck
:
command
];
}];
}];
}
}
...
@@ -613,7 +613,9 @@
...
@@ -613,7 +613,9 @@
}
}
/**
/**
* Simply invokes the callback without any parameter.
* Invokes the callback without any parameter.
*
* @return [ Void ]
*/
*/
-
(
void
)
execCallback
:
(
CDVInvokedUrlCommand
*
)
command
-
(
void
)
execCallback
:
(
CDVInvokedUrlCommand
*
)
command
{
{
...
...
src/windows/LocalNotificationProxy.js
View file @
c88dd6ec
...
@@ -107,7 +107,7 @@ exports.schedule = function (success, error, args) {
...
@@ -107,7 +107,7 @@ exports.schedule = function (success, error, args) {
exports
.
fireEvent
(
'add'
,
toast
);
exports
.
fireEvent
(
'add'
,
toast
);
}
}
success
(
);
exports
.
check
(
success
,
error
);
};
};
/**
/**
...
@@ -133,7 +133,7 @@ exports.update = function (success, error, args) {
...
@@ -133,7 +133,7 @@ exports.update = function (success, error, args) {
exports
.
fireEvent
(
'update'
,
toast
);
exports
.
fireEvent
(
'update'
,
toast
);
}
}
success
(
);
exports
.
check
(
success
,
error
);
};
};
/**
/**
...
...
www/local-notification-core.js
View file @
c88dd6ec
...
@@ -61,11 +61,13 @@ exports.requestPermission = function (callback, scope) {
...
@@ -61,11 +61,13 @@ exports.requestPermission = function (callback, scope) {
*/
*/
exports
.
schedule
=
function
(
msgs
,
callback
,
scope
,
args
)
{
exports
.
schedule
=
function
(
msgs
,
callback
,
scope
,
args
)
{
var
fn
=
function
(
granted
)
{
var
fn
=
function
(
granted
)
{
if
(
!
granted
)
return
;
var
toasts
=
this
.
toArray
(
msgs
);
var
toasts
=
this
.
toArray
(
msgs
);
if
(
!
granted
&&
callback
)
{
callback
.
call
(
scope
||
this
,
false
);
return
;
}
for
(
var
toast
of
toasts
)
{
for
(
var
toast
of
toasts
)
{
this
.
mergeWithDefaults
(
toast
);
this
.
mergeWithDefaults
(
toast
);
this
.
convertProperties
(
toast
);
this
.
convertProperties
(
toast
);
...
@@ -93,13 +95,16 @@ exports.schedule = function (msgs, callback, scope, args) {
...
@@ -93,13 +95,16 @@ exports.schedule = function (msgs, callback, scope, args) {
*/
*/
exports
.
update
=
function
(
msgs
,
callback
,
scope
,
args
)
{
exports
.
update
=
function
(
msgs
,
callback
,
scope
,
args
)
{
var
fn
=
function
(
granted
)
{
var
fn
=
function
(
granted
)
{
if
(
!
granted
)
return
;
var
toasts
=
this
.
toArray
(
msgs
);
var
toasts
=
this
.
toArray
(
msgs
);
if
(
!
granted
&&
callback
)
{
callback
.
call
(
scope
||
this
,
false
);
return
;
}
for
(
var
toast
of
toasts
)
{
for
(
var
toast
of
toasts
)
{
this
.
convertProperties
(
toast
);
}
this
.
convertProperties
(
toast
);
}
this
.
exec
(
'update'
,
toasts
,
callback
,
scope
);
this
.
exec
(
'update'
,
toasts
,
callback
,
scope
);
};
};
...
...
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