|
|
@@ -100,7 +100,7 @@
|
|
|
// NSNumber* id = [options objectForKey:@"id"];
|
|
|
// UNNotificationRequest* notification;
|
|
|
//
|
|
|
-// notification = [self.center getNotificationWithId:id];
|
|
|
+// notification = [_center getNotificationWithId:id];
|
|
|
//
|
|
|
// if (!notification)
|
|
|
// continue;
|
|
|
@@ -151,16 +151,16 @@
|
|
|
[self.commandDelegate runInBackground:^{
|
|
|
for (NSNumber* id in command.arguments) {
|
|
|
UNNotificationRequest* notification;
|
|
|
-
|
|
|
- notification = [self.center getNotificationWithId:id];
|
|
|
-
|
|
|
+
|
|
|
+ notification = [_center getNotificationWithId:id];
|
|
|
+
|
|
|
if (!notification)
|
|
|
continue;
|
|
|
-
|
|
|
- [self.center clearNotification:notification];
|
|
|
+
|
|
|
+ [_center clearNotification:notification];
|
|
|
[self fireEvent:@"clear" notification:notification];
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
[self execCallback:command];
|
|
|
}];
|
|
|
}
|
|
|
@@ -173,7 +173,7 @@
|
|
|
- (void) clearAll:(CDVInvokedUrlCommand*)command
|
|
|
{
|
|
|
[self.commandDelegate runInBackground:^{
|
|
|
- [self.center clearAllNotifications];
|
|
|
+ [_center clearAllNotifications];
|
|
|
[self.app setApplicationIconBadgeNumber:0];
|
|
|
[self fireEvent:@"clearall"];
|
|
|
[self execCallback:command];
|
|
|
@@ -192,13 +192,13 @@
|
|
|
[self.commandDelegate runInBackground:^{
|
|
|
for (NSNumber* id in command.arguments) {
|
|
|
UNNotificationRequest* notification;
|
|
|
-
|
|
|
- notification = [self.center getNotificationWithId:id];
|
|
|
-
|
|
|
+
|
|
|
+ notification = [_center getNotificationWithId:id];
|
|
|
+
|
|
|
if (!notification)
|
|
|
continue;
|
|
|
-
|
|
|
- [self.center cancelNotification:notification];
|
|
|
+
|
|
|
+ [_center cancelNotification:notification];
|
|
|
[self fireEvent:@"cancel" notification:notification];
|
|
|
}
|
|
|
|
|
|
@@ -214,7 +214,7 @@
|
|
|
- (void) cancelAll:(CDVInvokedUrlCommand*)command
|
|
|
{
|
|
|
[self.commandDelegate runInBackground:^{
|
|
|
- [self.center cancelAllNotifications];
|
|
|
+ [_center cancelAllNotifications];
|
|
|
[self.app setApplicationIconBadgeNumber:0];
|
|
|
[self fireEvent:@"cancelall"];
|
|
|
[self execCallback:command];
|
|
|
@@ -321,12 +321,12 @@
|
|
|
byType:(APPNotificationType)type;
|
|
|
{
|
|
|
[self.commandDelegate runInBackground:^{
|
|
|
- NSArray* ids = [self.center getNotificationIdsByType:type];
|
|
|
-
|
|
|
+ NSArray* ids = [_center getNotificationIdsByType:type];
|
|
|
+
|
|
|
CDVPluginResult* result;
|
|
|
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
|
|
|
messageAsArray:ids];
|
|
|
-
|
|
|
+
|
|
|
[self.commandDelegate sendPluginResult:result
|
|
|
callbackId:command.callbackId];
|
|
|
}];
|
|
|
@@ -383,11 +383,11 @@
|
|
|
|
|
|
NSArray* notifications;
|
|
|
notifications = [_center getNotificationOptionsByType:type andId:ids];
|
|
|
-
|
|
|
+
|
|
|
CDVPluginResult* result;
|
|
|
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
|
|
|
messageAsDictionary:[notifications firstObject]];
|
|
|
-
|
|
|
+
|
|
|
[self.commandDelegate sendPluginResult:result
|
|
|
callbackId:command.callbackId];
|
|
|
}];
|
|
|
@@ -497,7 +497,7 @@
|
|
|
UNAuthorizationOptions options =
|
|
|
(UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert);
|
|
|
|
|
|
- [self.center requestAuthorizationWithOptions:options completionHandler:^(BOOL granted, NSError* e) {
|
|
|
+ [_center requestAuthorizationWithOptions:options completionHandler:^(BOOL granted, NSError* e) {
|
|
|
[self check:command];
|
|
|
}];
|
|
|
}
|