Loading src/android/notification/Builder.java +1 −1 Changes for src/android/notification/Builder.java: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -158,7 +158,7 @@ public class Builder { return; Intent deleteIntent = new Intent(context, clearReceiver) .setAction(options.getId()) .setAction(options.getIdStr()) .putExtra(Options.EXTRA, options.toString()); PendingIntent dpi = PendingIntent.getBroadcast( Loading src/android/notification/Notification.java +7 −7 Changes for src/android/notification/Notification.java: 7 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ public class Notification { * Get notification ID. */ public int getId () { return options.getIdAsInt(); return options.getId(); } /** Loading Loading @@ -168,7 +168,7 @@ public class Notification { // Intent gets called when the Notification gets fired Intent intent = new Intent(context, receiver) .setAction(options.getId()) .setAction(options.getIdStr()) .putExtra(Options.EXTRA, options.toString()); PendingIntent pi = PendingIntent.getBroadcast( Loading Loading @@ -208,13 +208,13 @@ public class Notification { */ public void cancel() { Intent intent = new Intent(context, receiver) .setAction(options.getId()); .setAction(options.getIdStr()); PendingIntent pi = PendingIntent. getBroadcast(context, 0, intent, 0); getAlarmMgr().cancel(pi); getNotMgr().cancel(options.getIdAsInt()); getNotMgr().cancel(options.getId()); unpersist(); } Loading @@ -232,7 +232,7 @@ public class Notification { */ @SuppressWarnings("deprecation") private void showNotification () { int id = getOptions().getIdAsInt(); int id = getOptions().getId(); if (Build.VERSION.SDK_INT <= 15) { // Notification for HoneyComb to ICS Loading Loading @@ -309,7 +309,7 @@ public class Notification { private void persist () { SharedPreferences.Editor editor = getPrefs().edit(); editor.putString(options.getId(), options.toString()); editor.putString(options.getIdStr(), options.toString()); if (Build.VERSION.SDK_INT < 9) { editor.commit(); Loading @@ -324,7 +324,7 @@ public class Notification { private void unpersist () { SharedPreferences.Editor editor = getPrefs().edit(); editor.remove(options.getId()); editor.remove(options.getIdStr()); if (Build.VERSION.SDK_INT < 9) { editor.commit(); Loading src/android/notification/Options.java +6 −10 Changes for src/android/notification/Options.java: 6 added lines, 10 removed lines. Original line number Diff line number Diff line Loading @@ -203,21 +203,17 @@ public class Options { } /** * ID for the local notification. * ID for the local notification as a number. */ public String getId() { return options.optString("id", "0"); public Integer getId() { return options.optInt("id", 0); } /** * ID for the local notification. * ID for the local notification as a string. */ public int getIdAsInt() { try { return Integer.parseInt(getId()); } catch (Exception ignore) { return 0; } public String getIdStr() { return getId().toString(); } /** Loading src/ios/APPLocalNotification.m +5 −5 Changes for src/ios/APPLocalNotification.m: 5 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ [self.commandDelegate runInBackground:^{ for (NSDictionary* options in notifications) { NSString* id = [options objectForKey:@"id"]; NSNumber* id = [options objectForKey:@"id"]; UILocalNotification* notification; notification = [self.app localNotificationWithId:id]; Loading Loading @@ -133,7 +133,7 @@ - (void) cancel:(CDVInvokedUrlCommand*)command { [self.commandDelegate runInBackground:^{ for (NSString* id in command.arguments) { for (NSNumber* id in command.arguments) { UILocalNotification* notification; notification = [self.app localNotificationWithId:id]; Loading Loading @@ -170,7 +170,7 @@ - (void) clear:(CDVInvokedUrlCommand*)command { [self.commandDelegate runInBackground:^{ for (NSString* id in command.arguments) { for (NSNumber* id in command.arguments) { UILocalNotification* notification; notification = [self.app localNotificationWithId:id]; Loading Loading @@ -241,7 +241,7 @@ type:(APPLocalNotificationType)type; { [self.commandDelegate runInBackground:^{ NSString* id = [command argumentAtIndex:0]; NSNumber* id = [command argumentAtIndex:0]; BOOL exist; CDVPluginResult* result; Loading Loading @@ -528,7 +528,7 @@ */ - (void) cancelForerunnerLocalNotification:(UILocalNotification*)notification { NSString* id = notification.options.id; NSNumber* id = notification.options.id; UILocalNotification* forerunner; forerunner = [self.app localNotificationWithId:id]; Loading src/ios/APPLocalNotificationOptions.h +1 −1 Changes for src/ios/APPLocalNotificationOptions.h: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ - (id) initWithDict:(NSDictionary*)dict; @property (readonly, getter=id) NSString* id; @property (readonly, getter=id) NSNumber* id; @property (readonly, getter=badgeNumber) NSInteger badgeNumber; @property (readonly, getter=alertBody) NSString* alertBody; @property (readonly, getter=soundName) NSString* soundName; Loading Loading
src/android/notification/Builder.java +1 −1 Changes for src/android/notification/Builder.java: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -158,7 +158,7 @@ public class Builder { return; Intent deleteIntent = new Intent(context, clearReceiver) .setAction(options.getId()) .setAction(options.getIdStr()) .putExtra(Options.EXTRA, options.toString()); PendingIntent dpi = PendingIntent.getBroadcast( Loading
src/android/notification/Notification.java +7 −7 Changes for src/android/notification/Notification.java: 7 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ public class Notification { * Get notification ID. */ public int getId () { return options.getIdAsInt(); return options.getId(); } /** Loading Loading @@ -168,7 +168,7 @@ public class Notification { // Intent gets called when the Notification gets fired Intent intent = new Intent(context, receiver) .setAction(options.getId()) .setAction(options.getIdStr()) .putExtra(Options.EXTRA, options.toString()); PendingIntent pi = PendingIntent.getBroadcast( Loading Loading @@ -208,13 +208,13 @@ public class Notification { */ public void cancel() { Intent intent = new Intent(context, receiver) .setAction(options.getId()); .setAction(options.getIdStr()); PendingIntent pi = PendingIntent. getBroadcast(context, 0, intent, 0); getAlarmMgr().cancel(pi); getNotMgr().cancel(options.getIdAsInt()); getNotMgr().cancel(options.getId()); unpersist(); } Loading @@ -232,7 +232,7 @@ public class Notification { */ @SuppressWarnings("deprecation") private void showNotification () { int id = getOptions().getIdAsInt(); int id = getOptions().getId(); if (Build.VERSION.SDK_INT <= 15) { // Notification for HoneyComb to ICS Loading Loading @@ -309,7 +309,7 @@ public class Notification { private void persist () { SharedPreferences.Editor editor = getPrefs().edit(); editor.putString(options.getId(), options.toString()); editor.putString(options.getIdStr(), options.toString()); if (Build.VERSION.SDK_INT < 9) { editor.commit(); Loading @@ -324,7 +324,7 @@ public class Notification { private void unpersist () { SharedPreferences.Editor editor = getPrefs().edit(); editor.remove(options.getId()); editor.remove(options.getIdStr()); if (Build.VERSION.SDK_INT < 9) { editor.commit(); Loading
src/android/notification/Options.java +6 −10 Changes for src/android/notification/Options.java: 6 added lines, 10 removed lines. Original line number Diff line number Diff line Loading @@ -203,21 +203,17 @@ public class Options { } /** * ID for the local notification. * ID for the local notification as a number. */ public String getId() { return options.optString("id", "0"); public Integer getId() { return options.optInt("id", 0); } /** * ID for the local notification. * ID for the local notification as a string. */ public int getIdAsInt() { try { return Integer.parseInt(getId()); } catch (Exception ignore) { return 0; } public String getIdStr() { return getId().toString(); } /** Loading
src/ios/APPLocalNotification.m +5 −5 Changes for src/ios/APPLocalNotification.m: 5 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ [self.commandDelegate runInBackground:^{ for (NSDictionary* options in notifications) { NSString* id = [options objectForKey:@"id"]; NSNumber* id = [options objectForKey:@"id"]; UILocalNotification* notification; notification = [self.app localNotificationWithId:id]; Loading Loading @@ -133,7 +133,7 @@ - (void) cancel:(CDVInvokedUrlCommand*)command { [self.commandDelegate runInBackground:^{ for (NSString* id in command.arguments) { for (NSNumber* id in command.arguments) { UILocalNotification* notification; notification = [self.app localNotificationWithId:id]; Loading Loading @@ -170,7 +170,7 @@ - (void) clear:(CDVInvokedUrlCommand*)command { [self.commandDelegate runInBackground:^{ for (NSString* id in command.arguments) { for (NSNumber* id in command.arguments) { UILocalNotification* notification; notification = [self.app localNotificationWithId:id]; Loading Loading @@ -241,7 +241,7 @@ type:(APPLocalNotificationType)type; { [self.commandDelegate runInBackground:^{ NSString* id = [command argumentAtIndex:0]; NSNumber* id = [command argumentAtIndex:0]; BOOL exist; CDVPluginResult* result; Loading Loading @@ -528,7 +528,7 @@ */ - (void) cancelForerunnerLocalNotification:(UILocalNotification*)notification { NSString* id = notification.options.id; NSNumber* id = notification.options.id; UILocalNotification* forerunner; forerunner = [self.app localNotificationWithId:id]; Loading
src/ios/APPLocalNotificationOptions.h +1 −1 Changes for src/ios/APPLocalNotificationOptions.h: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ - (id) initWithDict:(NSDictionary*)dict; @property (readonly, getter=id) NSString* id; @property (readonly, getter=id) NSNumber* id; @property (readonly, getter=badgeNumber) NSInteger badgeNumber; @property (readonly, getter=alertBody) NSString* alertBody; @property (readonly, getter=soundName) NSString* soundName; Loading