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
44c82937
Commit
44c82937
authored
Feb 14, 2014
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cancel callbacks have not been fired after all notifications have been canceled on iOS
parent
a3ff269d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
APPLocalNotification.m
src/ios/APPLocalNotification.m
+15
-13
No files found.
src/ios/APPLocalNotification.m
View file @
44c82937
...
@@ -57,7 +57,7 @@ NSString *const kAPP_LOCALNOTIFICATION = @"APP_LOCALNOTIFICATION";
...
@@ -57,7 +57,7 @@ NSString *const kAPP_LOCALNOTIFICATION = @"APP_LOCALNOTIFICATION";
NSString
*
id
=
[
notification
.
userInfo
objectForKey
:
@"id"
];
NSString
*
id
=
[
notification
.
userInfo
objectForKey
:
@"id"
];
NSString
*
json
=
[
notification
.
userInfo
objectForKey
:
@"json"
];
NSString
*
json
=
[
notification
.
userInfo
objectForKey
:
@"json"
];
[
self
cancelNotificationWithId
:
id
];
[
self
cancelNotificationWithId
:
id
fireEvent
:
NO
];
[
self
archiveNotification
:
notification
];
[
self
archiveNotification
:
notification
];
[
self
fireEvent
:
@"add"
id
:
id
json
:
json
];
[
self
fireEvent
:
@"add"
id
:
id
json
:
json
];
...
@@ -77,10 +77,7 @@ NSString *const kAPP_LOCALNOTIFICATION = @"APP_LOCALNOTIFICATION";
...
@@ -77,10 +77,7 @@ NSString *const kAPP_LOCALNOTIFICATION = @"APP_LOCALNOTIFICATION";
NSArray
*
arguments
=
[
command
arguments
];
NSArray
*
arguments
=
[
command
arguments
];
NSString
*
id
=
[
arguments
objectAtIndex
:
0
];
NSString
*
id
=
[
arguments
objectAtIndex
:
0
];
UILocalNotification
*
notification
=
[
self
cancelNotificationWithId
:
id
];
[
self
cancelNotificationWithId
:
id
fireEvent
:
YES
];
NSString
*
json
=
[
notification
.
userInfo
objectForKey
:
@"json"
];
[
self
fireEvent
:
@"cancel"
id
:
id
json
:
json
];
}];
}];
}
}
...
@@ -96,7 +93,7 @@ NSString *const kAPP_LOCALNOTIFICATION = @"APP_LOCALNOTIFICATION";
...
@@ -96,7 +93,7 @@ NSString *const kAPP_LOCALNOTIFICATION = @"APP_LOCALNOTIFICATION";
{
{
if
([
key
hasPrefix
:
kAPP_LOCALNOTIFICATION
])
if
([
key
hasPrefix
:
kAPP_LOCALNOTIFICATION
])
{
{
[
[
NSUserDefaults
standardUserDefaults
]
removeObjectForKey
:
key
];
[
self
cancelNotificationWithId
:
key
fireEvent
:
YES
];
}
}
}
}
...
@@ -112,11 +109,14 @@ NSString *const kAPP_LOCALNOTIFICATION = @"APP_LOCALNOTIFICATION";
...
@@ -112,11 +109,14 @@ NSString *const kAPP_LOCALNOTIFICATION = @"APP_LOCALNOTIFICATION";
*
*
* @param {NSString} id Die ID der Notification
* @param {NSString} id Die ID der Notification
*/
*/
-
(
UILocalNotification
*
)
cancelNotificationWithId
:(
NSString
*
)
id
-
(
void
)
cancelNotificationWithId
:(
NSString
*
)
id
fireEvent
:(
BOOL
)
fireEvent
{
{
if
(
!
[
self
strIsNullOrEmpty
:
id
])
if
(
!
[
self
strIsNullOrEmpty
:
id
])
{
{
NSString
*
key
=
[
kAPP_LOCALNOTIFICATION
stringByAppendingString
:
id
];
NSString
*
key
=
([
id
hasPrefix
:
kAPP_LOCALNOTIFICATION
])
?
id
:
[
kAPP_LOCALNOTIFICATION
stringByAppendingString
:
id
];
NSData
*
data
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
key
];
NSData
*
data
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
key
];
if
(
data
)
if
(
data
)
...
@@ -126,11 +126,14 @@ NSString *const kAPP_LOCALNOTIFICATION = @"APP_LOCALNOTIFICATION";
...
@@ -126,11 +126,14 @@ NSString *const kAPP_LOCALNOTIFICATION = @"APP_LOCALNOTIFICATION";
[[
NSUserDefaults
standardUserDefaults
]
removeObjectForKey
:
key
];
[[
NSUserDefaults
standardUserDefaults
]
removeObjectForKey
:
key
];
[[
UIApplication
sharedApplication
]
cancelLocalNotification
:
notification
];
[[
UIApplication
sharedApplication
]
cancelLocalNotification
:
notification
];
return
notification
;
if
(
fireEvent
)
{
NSString
*
json
=
[
notification
.
userInfo
objectForKey
:
@"json"
];
[
self
fireEvent
:
@"cancel"
id
:
id
json
:
json
];
}
}
}
}
}
return
NULL
;
}
}
/**
/**
...
@@ -211,7 +214,6 @@ NSString *const kAPP_LOCALNOTIFICATION = @"APP_LOCALNOTIFICATION";
...
@@ -211,7 +214,6 @@ NSString *const kAPP_LOCALNOTIFICATION = @"APP_LOCALNOTIFICATION";
notification
.
applicationIconBadgeNumber
=
badge
;
notification
.
applicationIconBadgeNumber
=
badge
;
if
(
!
[
self
strIsNullOrEmpty
:
msg
])
if
(
!
[
self
strIsNullOrEmpty
:
msg
])
{
{
if
(
!
[
self
strIsNullOrEmpty
:
title
])
if
(
!
[
self
strIsNullOrEmpty
:
title
])
...
@@ -257,7 +259,7 @@ NSString *const kAPP_LOCALNOTIFICATION = @"APP_LOCALNOTIFICATION";
...
@@ -257,7 +259,7 @@ NSString *const kAPP_LOCALNOTIFICATION = @"APP_LOCALNOTIFICATION";
if
(
autoCancel
&&
!
isActive
)
if
(
autoCancel
&&
!
isActive
)
{
{
[
self
cancelNotificationWithId
:
id
];
[
self
cancelNotificationWithId
:
id
fireEvent
:
YES
];
}
}
[
self
fireEvent
:
event
id
:
id
json
:
json
];
[
self
fireEvent
:
event
id
:
id
json
:
json
];
...
...
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