Loading README.md +1 −0 Changes for README.md: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ More informations can be found [here](https://build.phonegap.com/plugins/331). - [feature:] Repeat with custom intervals on Android. - **[bugfix:]** Callbacks are called with the ID as a number and not as a string. - [enhancement:] The background callback on Android is called, even the app is not running when the notification is tapped. - [enhancement:] Notifications are repeated more precisely. #### Version 0.6.3 (12.12.2013) - [bugfix:] Black screen on Android. Loading src/android/LocalNotification.java +0 −4 Changes for src/android/LocalNotification.java: 0 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -114,12 +114,8 @@ public class LocalNotification extends CordovaPlugin { AlarmManager am = getAlarmManager(); PendingIntent pi = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT); if (options.getInterval() > 0) { am.setRepeating(AlarmManager.RTC_WAKEUP, triggerTime, options.getInterval(), pi); } else { am.set(AlarmManager.RTC_WAKEUP, triggerTime, pi); } } /** * Cancel a specific notification that was previously registered. Loading src/android/Options.java +13 −1 Changes for src/android/Options.java: 13 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ package de.appplant.cordova.plugin.localnotification; import java.util.Calendar; import java.util.Date; import org.json.JSONException; import org.json.JSONObject; import android.app.Activity; Loading Loading @@ -76,6 +77,17 @@ public class Options { return this; } /** * Setzt die neue Zeit an Hand des Intervalls. */ public Options moveDate () { try { options.put("date", (getDate() + interval) / 1000); } catch (JSONException e) {} return this; } /** * Gibt die Eigenschaften als JSONObjekt an. */ Loading @@ -84,7 +96,7 @@ public class Options { } /** * Gibt die Zeit in Sekunden an, wann die Notification aufpoppen soll. * Gibt die Zeit in Millisekunden an, wann die Notification aufpoppen soll. */ public long getDate() { return options.optLong("date", 0) * 1000; Loading src/android/Receiver.java +2 −0 Changes for src/android/Receiver.java: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -76,6 +76,8 @@ public class Receiver extends BroadcastReceiver { LocalNotification.unpersist(options.getId()); } else if (isFirstAlarmInFuture()) { return; } else { LocalNotification.add(options.moveDate()); } Builder notification = buildNotification(); Loading Loading
README.md +1 −0 Changes for README.md: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ More informations can be found [here](https://build.phonegap.com/plugins/331). - [feature:] Repeat with custom intervals on Android. - **[bugfix:]** Callbacks are called with the ID as a number and not as a string. - [enhancement:] The background callback on Android is called, even the app is not running when the notification is tapped. - [enhancement:] Notifications are repeated more precisely. #### Version 0.6.3 (12.12.2013) - [bugfix:] Black screen on Android. Loading
src/android/LocalNotification.java +0 −4 Changes for src/android/LocalNotification.java: 0 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -114,12 +114,8 @@ public class LocalNotification extends CordovaPlugin { AlarmManager am = getAlarmManager(); PendingIntent pi = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT); if (options.getInterval() > 0) { am.setRepeating(AlarmManager.RTC_WAKEUP, triggerTime, options.getInterval(), pi); } else { am.set(AlarmManager.RTC_WAKEUP, triggerTime, pi); } } /** * Cancel a specific notification that was previously registered. Loading
src/android/Options.java +13 −1 Changes for src/android/Options.java: 13 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ package de.appplant.cordova.plugin.localnotification; import java.util.Calendar; import java.util.Date; import org.json.JSONException; import org.json.JSONObject; import android.app.Activity; Loading Loading @@ -76,6 +77,17 @@ public class Options { return this; } /** * Setzt die neue Zeit an Hand des Intervalls. */ public Options moveDate () { try { options.put("date", (getDate() + interval) / 1000); } catch (JSONException e) {} return this; } /** * Gibt die Eigenschaften als JSONObjekt an. */ Loading @@ -84,7 +96,7 @@ public class Options { } /** * Gibt die Zeit in Sekunden an, wann die Notification aufpoppen soll. * Gibt die Zeit in Millisekunden an, wann die Notification aufpoppen soll. */ public long getDate() { return options.optLong("date", 0) * 1000; Loading
src/android/Receiver.java +2 −0 Changes for src/android/Receiver.java: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -76,6 +76,8 @@ public class Receiver extends BroadcastReceiver { LocalNotification.unpersist(options.getId()); } else if (isFirstAlarmInFuture()) { return; } else { LocalNotification.add(options.moveDate()); } Builder notification = buildNotification(); Loading