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
984f0d80
Commit
984f0d80
authored
Jun 07, 2014
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pragma macros
parent
e3fca1da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
48 deletions
+63
-48
APPLocalNotification.m
src/ios/APPLocalNotification.m
+63
-48
No files found.
src/ios/APPLocalNotification.m
View file @
984f0d80
...
@@ -77,6 +77,9 @@
...
@@ -77,6 +77,9 @@
@synthesize
deviceready
,
eventQueue
,
applicationState
,
scheduledNotifications
;
@synthesize
deviceready
,
eventQueue
,
applicationState
,
scheduledNotifications
;
#pragma mark -
#pragma mark Plugin interface methods
/**
/**
* Executes all queued events.
* Executes all queued events.
*/
*/
...
@@ -110,8 +113,8 @@
...
@@ -110,8 +113,8 @@
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
0
.
3
*
NSEC_PER_SEC
),
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
0
.
3
*
NSEC_PER_SEC
),
dispatch_get_main_queue
(),
^
{
dispatch_get_main_queue
(),
^
{
[
self
cancelNotification
:
notification
fireEvent
:
NO
];
[
self
cancelNotification
:
notification
fireEvent
:
NO
];
});
});
}
}
[
self
scheduleNotificationWithProperties
:
properties
];
[
self
scheduleNotificationWithProperties
:
properties
];
...
@@ -216,6 +219,9 @@
...
@@ -216,6 +219,9 @@
}];
}];
}
}
#pragma mark -
#pragma mark Plugin core methods
/**
/**
* Schedules a new local notification and fies the coresponding event.
* Schedules a new local notification and fies the coresponding event.
*
*
...
@@ -286,52 +292,6 @@
...
@@ -286,52 +292,6 @@
}
}
/**
/**
* Retrurns a key-value dictionary for repeat intervals.
*
* @return {NSMutableDictionary}
*/
-
(
NSMutableDictionary
*
)
repeatDict
{
NSMutableDictionary
*
repeatDict
=
[[
NSMutableDictionary
alloc
]
init
];
[
repeatDict
setObject
:
[
NSNumber
numberWithInt
:
NSCalendarUnitSecond
]
forKey
:
@"secondly"
];
[
repeatDict
setObject
:
[
NSNumber
numberWithInt
:
NSCalendarUnitMinute
]
forKey
:
@"minutely"
];
[
repeatDict
setObject
:
[
NSNumber
numberWithInt
:
NSCalendarUnitHour
]
forKey
:
@"hourly"
];
[
repeatDict
setObject
:
[
NSNumber
numberWithInt
:
NSCalendarUnitDay
]
forKey
:
@"daily"
];
[
repeatDict
setObject
:
[
NSNumber
numberWithInt
:
NSWeekCalendarUnit
]
forKey
:
@"weekly"
];
[
repeatDict
setObject
:
[
NSNumber
numberWithInt
:
NSCalendarUnitMonth
]
forKey
:
@"monthly"
];
[
repeatDict
setObject
:
[
NSNumber
numberWithInt
:
NSCalendarUnitYear
]
forKey
:
@"yearly"
];
[
repeatDict
setObject
:
[
NSNumber
numberWithInt
:
NSCalendarUnitEra
]
forKey
:
@""
];
return
repeatDict
;
}
/**
* Returns the userDict for a local notification.
*
* @param {NSMutableDictionary} options
* The properties for the local notification
* @return {NSDictionary}
*/
-
(
NSDictionary
*
)
userDict
:
(
NSMutableDictionary
*
)
options
{
NSString
*
id
=
[
options
objectForKey
:
@"id"
];
NSString
*
ac
=
[
options
objectForKey
:
@"autoCancel"
];
NSString
*
js
=
[
options
objectForKey
:
@"json"
];
return
[
NSDictionary
dictionaryWithObjectsAndKeys
:
id
,
@"id"
,
ac
,
@"autoCancel"
,
js
,
@"json"
,
nil
];
}
/**
* Creates an notification object based on the given properties.
* Creates an notification object based on the given properties.
*
*
* @param {NSMutableDictionary} properties
* @param {NSMutableDictionary} properties
...
@@ -379,6 +339,9 @@
...
@@ -379,6 +339,9 @@
return
notification
;
return
notification
;
}
}
#pragma mark -
#pragma mark Plugin delegate and life cycle methods
/**
/**
* Calls the cancel or trigger event after a local notification was received.
* Calls the cancel or trigger event after a local notification was received.
* Cancels the local notification if autoCancel was set to true.
* Cancels the local notification if autoCancel was set to true.
...
@@ -457,6 +420,55 @@
...
@@ -457,6 +420,55 @@
[
self
cancelAllNotificationsWhichAreOlderThen
:
432000
];
[
self
cancelAllNotificationsWhichAreOlderThen
:
432000
];
}
}
#pragma mark -
#pragma mark Plugin helper methods
/**
* Retrurns a key-value dictionary for repeat intervals.
*
* @return {NSMutableDictionary}
*/
-
(
NSMutableDictionary
*
)
repeatDict
{
NSMutableDictionary
*
repeatDict
=
[[
NSMutableDictionary
alloc
]
init
];
[
repeatDict
setObject
:
[
NSNumber
numberWithInt
:
NSCalendarUnitSecond
]
forKey
:
@"secondly"
];
[
repeatDict
setObject
:
[
NSNumber
numberWithInt
:
NSCalendarUnitMinute
]
forKey
:
@"minutely"
];
[
repeatDict
setObject
:
[
NSNumber
numberWithInt
:
NSCalendarUnitHour
]
forKey
:
@"hourly"
];
[
repeatDict
setObject
:
[
NSNumber
numberWithInt
:
NSCalendarUnitDay
]
forKey
:
@"daily"
];
[
repeatDict
setObject
:
[
NSNumber
numberWithInt
:
NSWeekCalendarUnit
]
forKey
:
@"weekly"
];
[
repeatDict
setObject
:
[
NSNumber
numberWithInt
:
NSCalendarUnitMonth
]
forKey
:
@"monthly"
];
[
repeatDict
setObject
:
[
NSNumber
numberWithInt
:
NSCalendarUnitYear
]
forKey
:
@"yearly"
];
[
repeatDict
setObject
:
[
NSNumber
numberWithInt
:
NSCalendarUnitEra
]
forKey
:
@""
];
return
repeatDict
;
}
/**
* Returns the userDict for a local notification.
*
* @param {NSMutableDictionary} options
* The properties for the local notification
* @return {NSDictionary}
*/
-
(
NSDictionary
*
)
userDict
:
(
NSMutableDictionary
*
)
options
{
NSString
*
id
=
[
options
objectForKey
:
@"id"
];
NSString
*
ac
=
[
options
objectForKey
:
@"autoCancel"
];
NSString
*
js
=
[
options
objectForKey
:
@"json"
];
return
[
NSDictionary
dictionaryWithObjectsAndKeys
:
id
,
@"id"
,
ac
,
@"autoCancel"
,
js
,
@"json"
,
nil
];
}
/**
/**
* Checks weather the given string is empty or not.
* Checks weather the given string is empty or not.
*
*
...
@@ -553,6 +565,9 @@
...
@@ -553,6 +565,9 @@
return
notificationsWithoutNIL
;
return
notificationsWithoutNIL
;
}
}
#pragma mark -
#pragma mark Plugin callback methods
/**
/**
* Simply invokes the callback without any parameter.
* Simply invokes the callback without any parameter.
*/
*/
...
...
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