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
ebbfc4d0
Commit
ebbfc4d0
authored
Jan 01, 2015
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Auto increment badge number on iOS
parent
fe66fcaf
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
APPLocalNotification.m
src/ios/APPLocalNotification.m
+2
-2
APPLocalNotificationOptions.m
src/ios/APPLocalNotificationOptions.m
+7
-1
local-notification.js
www/local-notification.js
+1
-1
No files found.
src/ios/APPLocalNotification.m
View file @
ebbfc4d0
...
@@ -360,7 +360,6 @@
...
@@ -360,7 +360,6 @@
*/
*/
-
(
void
)
didReceiveLocalNotification
:
(
NSNotification
*
)
localNotification
-
(
void
)
didReceiveLocalNotification
:
(
NSNotification
*
)
localNotification
{
{
UIApplication
*
app
=
[
UIApplication
sharedApplication
];
UILocalNotification
*
notification
=
[
localNotification
object
];
UILocalNotification
*
notification
=
[
localNotification
object
];
BOOL
autoCancel
=
notification
.
options
.
autoCancel
;
BOOL
autoCancel
=
notification
.
options
.
autoCancel
;
...
@@ -368,7 +367,8 @@
...
@@ -368,7 +367,8 @@
NSString
*
event
=
(
timeInterval
<=
1
&&
deviceready
)
?
@"trigger"
:
@"click"
;
NSString
*
event
=
(
timeInterval
<=
1
&&
deviceready
)
?
@"trigger"
:
@"click"
;
app
.
applicationIconBadgeNumber
-=
1
;
[
UIApplication
sharedApplication
]
.
applicationIconBadgeNumber
-=
1
;
[
self
fireEvent
:
event
localNotification
:
notification
];
[
self
fireEvent
:
event
localNotification
:
notification
];
...
...
src/ios/APPLocalNotificationOptions.m
View file @
ebbfc4d0
...
@@ -101,7 +101,13 @@
...
@@ -101,7 +101,13 @@
*/
*/
-
(
NSInteger
)
badgeNumber
-
(
NSInteger
)
badgeNumber
{
{
return
[[
dict
objectForKey
:
@"badge"
]
intValue
];
NSInteger
number
=
[[
dict
objectForKey
:
@"badge"
]
intValue
];
if
(
number
==
-
1
)
{
number
=
1
+
[
UIApplication
sharedApplication
].
applicationIconBadgeNumber
;
}
return
number
;
}
}
#pragma mark -
#pragma mark -
...
...
www/local-notification.js
View file @
ebbfc4d0
...
@@ -64,7 +64,7 @@ exports._defaults = {
...
@@ -64,7 +64,7 @@ exports._defaults = {
message
:
''
,
message
:
''
,
title
:
''
,
title
:
''
,
autoCancel
:
false
,
autoCancel
:
false
,
badge
:
0
,
badge
:
-
1
,
id
:
'0'
,
id
:
'0'
,
json
:
''
,
json
:
''
,
repeat
:
''
repeat
:
''
...
...
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