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
19d5b97a
Commit
19d5b97a
authored
Jun 29, 2017
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Proper action identifier handling in delegate
parent
ebee0373
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
APPLocalNotification.m
src/ios/APPLocalNotification.m
+19
-8
APPNotificationContent.m
src/ios/APPNotificationContent.m
+1
-0
No files found.
src/ios/APPLocalNotification.m
View file @
19d5b97a
...
@@ -626,16 +626,18 @@
...
@@ -626,16 +626,18 @@
withCompletionHandler
:(
void
(
^
)())
completionHandler
withCompletionHandler
:(
void
(
^
)())
completionHandler
{
{
UNNotificationRequest
*
notification
=
response
.
notification
.
request
;
UNNotificationRequest
*
notification
=
response
.
notification
.
request
;
NSString
*
action
=
response
.
actionIdentifier
;
NSString
*
event
=
action
;
[
self
fireEvent
:
@"click"
notification
:
notification
];
if
([
action
isEqualToString
:
UNNotificationDefaultActionIdentifier
])
{
event
=
@"click"
;
}
if
([
action
isEqualToString
:
UNNotificationDismissActionIdentifier
])
{
event
=
@"clear"
;
}
// if ([notification.options isRepeating]) {
[
self
fireEvent
:
event
notification
:
notification
];
// [_center clearNotification:notification];
// [self fireEvent:@"clear" notification:notification];
// } else {
// [_center cancelNotification:notification];
// [self fireEvent:@"cancel" notification:notification];
// }
completionHandler
();
completionHandler
();
}
}
...
@@ -653,6 +655,15 @@
...
@@ -653,6 +655,15 @@
_center
=
[
UNUserNotificationCenter
currentNotificationCenter
];
_center
=
[
UNUserNotificationCenter
currentNotificationCenter
];
_center
.
delegate
=
self
;
_center
.
delegate
=
self
;
UNNotificationCategory
*
generalCategory
=
[
UNNotificationCategory
categoryWithIdentifier
:
@"GENERAL"
actions
:@[]
intentIdentifiers
:
@[]
options
:
UNNotificationCategoryOptionCustomDismissAction
];
// Register the notification categories.
[
_center
setNotificationCategories
:[
NSSet
setWithObjects
:
generalCategory
,
nil
]];
}
}
#pragma mark -
#pragma mark -
...
...
src/ios/APPNotificationContent.m
View file @
19d5b97a
...
@@ -65,6 +65,7 @@ static char optionsKey;
...
@@ -65,6 +65,7 @@ static char optionsKey;
self
.
body
=
options
.
text
;
self
.
body
=
options
.
text
;
self
.
sound
=
options
.
sound
;
self
.
sound
=
options
.
sound
;
self
.
badge
=
options
.
badge
;
self
.
badge
=
options
.
badge
;
self
.
categoryIdentifier
=
@"GENERAL"
;
}
}
#pragma mark -
#pragma mark -
...
...
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