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
71228b66
Commit
71228b66
authored
Jan 06, 2015
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add internal `isRepeating method`
parent
ed982a76
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
2 deletions
+30
-2
APPLocalNotificationOptions.h
src/ios/APPLocalNotificationOptions.h
+2
-0
APPLocalNotificationOptions.m
src/ios/APPLocalNotificationOptions.m
+14
-1
UILocalNotification+APPLocalNotification.h
src/ios/UILocalNotification+APPLocalNotification.h
+2
-0
UILocalNotification+APPLocalNotification.m
src/ios/UILocalNotification+APPLocalNotification.m
+12
-1
No files found.
src/ios/APPLocalNotificationOptions.h
View file @
71228b66
...
...
@@ -35,5 +35,7 @@
// Encode the user info dict to JSON
-
(
NSString
*
)
encodeToJSON
;
// If it's a repeating notification
-
(
BOOL
)
isRepeating
;
@end
src/ios/APPLocalNotificationOptions.m
View file @
71228b66
...
...
@@ -82,7 +82,7 @@
-
(
BOOL
)
autoCancel
{
if
(
IsAtLeastiOSVersion
(
@"8.0"
)){
return
self
.
repeatInterval
==
NSCalendarUnitEra
;
return
!
[
self
isRepeating
]
;
}
else
{
return
[[
dict
objectForKey
:
@"autoCancel"
]
boolValue
];
}
...
...
@@ -201,6 +201,9 @@
return
NSCalendarUnitEra
;
}
#pragma mark -
#pragma mark Methods
/**
* The notification's user info dict.
*/
...
...
@@ -231,6 +234,16 @@
withString
:
@""
];
}
/**
* If it's a repeating notification.
*/
-
(
BOOL
)
isRepeating
{
NSCalendarUnit
interval
=
self
.
repeatInterval
;
return
!
(
interval
==
NSCalendarUnitEra
||
interval
==
0
);
}
#pragma mark -
#pragma mark Helpers
...
...
src/ios/UILocalNotification+APPLocalNotification.h
View file @
71228b66
...
...
@@ -33,5 +33,7 @@
-
(
BOOL
)
wasInThePast
;
// If the notification was already triggered
-
(
BOOL
)
wasTriggered
;
// If it's a repeating notification
-
(
BOOL
)
isRepeating
;
@end
src/ios/UILocalNotification+APPLocalNotification.m
View file @
71228b66
...
...
@@ -61,6 +61,9 @@ static char optionsKey;
self
.
soundName
=
options
.
soundName
;
}
#pragma mark -
#pragma mark Methods
/**
* The options provided by the plug-in.
*/
...
...
@@ -128,7 +131,7 @@ static char optionsKey;
int
timespan
=
[
now
timeIntervalSinceDate
:
fireDate
];
if
(
self
.
repeatInterval
!=
NSCalendarUnitEra
)
{
if
(
[
self
isRepeating
]
)
{
timespan
=
timespan
%
[
self
repeatIntervalInSeconds
];
}
...
...
@@ -156,4 +159,12 @@ static char optionsKey;
return
isLaterThanOrEqualTo
;
}
/**
* If it's a repeating notification.
*/
-
(
BOOL
)
isRepeating
{
return
[
self
.
options
isRepeating
];
}
@end
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