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
aa4e07b0
Commit
aa4e07b0
authored
Nov 08, 2017
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore delegates if triggered by push notifications (ios)
parent
16c9c426
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
APPLocalNotification.m
src/ios/APPLocalNotification.m
+19
-10
No files found.
src/ios/APPLocalNotification.m
View file @
aa4e07b0
...
@@ -504,10 +504,15 @@
...
@@ -504,10 +504,15 @@
willPresentNotification
:
(
UNNotification
*
)
notification
willPresentNotification
:
(
UNNotification
*
)
notification
withCompletionHandler
:
(
void
(
^
)(
UNNotificationPresentationOptions
))
completionHandler
withCompletionHandler
:
(
void
(
^
)(
UNNotificationPresentationOptions
))
completionHandler
{
{
APPNotificationOptions
*
options
=
notification
.
request
.
options
;
UNNotificationRequest
*
toast
=
notification
.
request
;
if
([
toast
.
trigger
isKindOfClass
:
UNPushNotificationTrigger
.
class
])
return
;
APPNotificationOptions
*
options
=
toast
.
options
;
if
(
!
[
notification
.
request
wasUpdated
])
{
if
(
!
[
notification
.
request
wasUpdated
])
{
[
self
fireEvent
:
@"trigger"
notification
:
notification
.
reque
st
];
[
self
fireEvent
:
@"trigger"
notification
:
toa
st
];
}
}
if
(
options
.
silent
)
{
if
(
options
.
silent
)
{
...
@@ -525,14 +530,18 @@
...
@@ -525,14 +530,18 @@
*/
*/
-
(
void
)
userNotificationCenter
:
(
UNUserNotificationCenter
*
)
center
-
(
void
)
userNotificationCenter
:
(
UNUserNotificationCenter
*
)
center
didReceiveNotificationResponse
:
(
UNNotificationResponse
*
)
response
didReceiveNotificationResponse
:
(
UNNotificationResponse
*
)
response
withCompletionHandler
:
(
void
(
^
)())
completionHandler
withCompletionHandler
:
(
void
(
^
)(
void
))
completionHandler
{
{
UNNotificationRequest
*
notification
=
response
.
notification
.
request
;
UNNotificationRequest
*
toast
=
response
.
notification
.
request
;
NSMutableDictionary
*
data
=
[[
NSMutableDictionary
alloc
]
init
];
NSString
*
action
=
response
.
actionIdentifier
;
NSString
*
event
=
action
;
completionHandler
();
completionHandler
();
if
([
toast
.
trigger
isKindOfClass
:
UNPushNotificationTrigger
.
class
])
return
;
NSMutableDictionary
*
data
=
[[
NSMutableDictionary
alloc
]
init
];
NSString
*
action
=
response
.
actionIdentifier
;
NSString
*
event
=
action
;
if
([
action
isEqualToString
:
UNNotificationDefaultActionIdentifier
])
{
if
([
action
isEqualToString
:
UNNotificationDefaultActionIdentifier
])
{
event
=
@"click"
;
event
=
@"click"
;
...
@@ -542,11 +551,11 @@
...
@@ -542,11 +551,11 @@
}
}
if
(
!
deviceready
&&
[
event
isEqualToString
:
@"click"
])
{
if
(
!
deviceready
&&
[
event
isEqualToString
:
@"click"
])
{
_launchDetails
=
@[
notification
.
options
.
id
,
event
];
_launchDetails
=
@[
toast
.
options
.
id
,
event
];
}
}
if
(
!
[
event
isEqualToString
:
@"clear"
])
{
if
(
!
[
event
isEqualToString
:
@"clear"
])
{
[
self
fireEvent
:
@"clear"
notification
:
notification
];
[
self
fireEvent
:
@"clear"
notification
:
toast
];
}
}
if
([
response
isKindOfClass
:
UNTextInputNotificationResponse
.
class
])
{
if
([
response
isKindOfClass
:
UNTextInputNotificationResponse
.
class
])
{
...
@@ -554,7 +563,7 @@
...
@@ -554,7 +563,7 @@
forKey
:
@"text"
];
forKey
:
@"text"
];
}
}
[
self
fireEvent
:
event
notification
:
notification
data
:
data
];
[
self
fireEvent
:
event
notification
:
toast
data
:
data
];
}
}
#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