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
7022f6af
Commit
7022f6af
authored
Sep 05, 2017
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added silent option for ios
parent
16de6fea
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
3 deletions
+20
-3
APPLocalNotification.m
src/ios/APPLocalNotification.m
+5
-1
APPNotificationOptions.h
src/ios/APPNotificationOptions.h
+1
-0
APPNotificationOptions.m
src/ios/APPNotificationOptions.m
+10
-0
local-notification-util.js
www/local-notification-util.js
+4
-2
No files found.
src/ios/APPLocalNotification.m
View file @
7022f6af
...
@@ -507,7 +507,11 @@
...
@@ -507,7 +507,11 @@
[
self
fireEvent
:
@"trigger"
notification
:
notification
.
request
];
[
self
fireEvent
:
@"trigger"
notification
:
notification
.
request
];
}
}
completionHandler
(
UNNotificationPresentationOptionBadge
|
UNNotificationPresentationOptionSound
|
UNNotificationPresentationOptionAlert
);
if
(
notification
.
request
.
options
.
silent
)
{
completionHandler
(
UNNotificationPresentationOptionNone
);
}
else
{
completionHandler
(
UNNotificationPresentationOptionBadge
|
UNNotificationPresentationOptionSound
|
UNNotificationPresentationOptionAlert
);
}
}
}
/**
/**
...
...
src/ios/APPNotificationOptions.h
View file @
7022f6af
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
@property
(
readonly
,
getter
=
subtitle
)
NSString
*
subtitle
;
@property
(
readonly
,
getter
=
subtitle
)
NSString
*
subtitle
;
@property
(
readonly
,
getter
=
badge
)
NSNumber
*
badge
;
@property
(
readonly
,
getter
=
badge
)
NSNumber
*
badge
;
@property
(
readonly
,
getter
=
text
)
NSString
*
text
;
@property
(
readonly
,
getter
=
text
)
NSString
*
text
;
@property
(
readonly
,
getter
=
silent
)
BOOL
silent
;
@property
(
readonly
,
getter
=
sound
)
UNNotificationSound
*
sound
;
@property
(
readonly
,
getter
=
sound
)
UNNotificationSound
*
sound
;
@property
(
readonly
,
getter
=
userInfo
)
NSDictionary
*
userInfo
;
@property
(
readonly
,
getter
=
userInfo
)
NSDictionary
*
userInfo
;
@property
(
readonly
,
getter
=
actions
)
NSArray
<
UNNotificationAction
*>
*
actions
;
@property
(
readonly
,
getter
=
actions
)
NSArray
<
UNNotificationAction
*>
*
actions
;
...
...
src/ios/APPNotificationOptions.m
View file @
7022f6af
...
@@ -115,6 +115,16 @@
...
@@ -115,6 +115,16 @@
}
}
/**
/**
* Show notification in foreground.
*
* @return [ BOOL ]
*/
-
(
BOOL
)
silent
{
return
[[
dict
objectForKey
:
@"silent"
]
boolValue
];
}
/**
* The badge number for the notification.
* The badge number for the notification.
*
*
* @return [ NSNumber* ]
* @return [ NSNumber* ]
...
...
www/local-notification-util.js
View file @
7022f6af
...
@@ -30,8 +30,9 @@ exports._defaults = {
...
@@ -30,8 +30,9 @@ exports._defaults = {
sound
:
'res://platform_default'
,
sound
:
'res://platform_default'
,
badge
:
undefined
,
badge
:
undefined
,
data
:
undefined
,
data
:
undefined
,
trigger
:
{
type
:
'calendar'
}
,
silent
:
false
,
actions
:
[],
actions
:
[],
trigger
:
{
type
:
'calendar'
},
actionGroupId
:
undefined
,
actionGroupId
:
undefined
,
attachments
:
[]
attachments
:
[]
};
};
...
@@ -201,7 +202,8 @@ exports.convertTrigger = function (options) {
...
@@ -201,7 +202,8 @@ exports.convertTrigger = function (options) {
var
isCal
=
trigger
.
type
==
'calendar'
;
var
isCal
=
trigger
.
type
==
'calendar'
;
if
(
isCal
&&
!
date
)
{
if
(
isCal
&&
!
date
)
{
date
=
this
.
getValueFor
(
options
,
'trigger'
,
'at'
,
'firstAt'
,
'date'
);
date
=
this
.
getValueFor
(
options
,
'at'
,
'firstAt'
,
'date'
);
date
=
date
||
isObject
&&
!
cfg
.
getTime
?
new
Date
()
:
options
.
trigger
;
date
=
date
||
new
Date
();
date
=
date
||
new
Date
();
}
}
...
...
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