Loading README.md +1 −0 Changes for README.md: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ More informations can be found [here](https://build.phonegap.com/plugins/331). - [enhancement:] Added 'hourly' as a new repeat time aliase. - [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. #### Version 0.6.3 (12.12.2013) - [bugfix:] Black screen on Android. Loading src/android/ReceiverActivity.java +18 −3 Changes for src/android/ReceiverActivity.java: 18 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -21,6 +21,9 @@ package de.appplant.cordova.plugin.localnotification; import java.util.Timer; import java.util.TimerTask; import org.json.JSONException; import org.json.JSONObject; Loading Loading @@ -73,10 +76,22 @@ public class ReceiverActivity extends Activity { private void invokeBackgroundCallback (Options options) { String function = options.getBackground(); if (TextUtils.isEmpty(function)) return; final String js = "setTimeout('" + function + "(\"" + options.getId() + "\")',0)"; // after reboot, LocalNotification.webView is always null // may be call background callback later if (!TextUtils.isEmpty(function) && LocalNotification.webView != null) { LocalNotification.webView.sendJavascript("setTimeout('" + function + "(\"" + options.getId() + "\")',0)"); // call background callback later if (LocalNotification.webView == null) { new Timer().schedule(new TimerTask() { @Override public void run() { LocalNotification.webView.sendJavascript(js); } }, 4000); } else { LocalNotification.webView.sendJavascript(js); } } } Loading
README.md +1 −0 Changes for README.md: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ More informations can be found [here](https://build.phonegap.com/plugins/331). - [enhancement:] Added 'hourly' as a new repeat time aliase. - [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. #### Version 0.6.3 (12.12.2013) - [bugfix:] Black screen on Android. Loading
src/android/ReceiverActivity.java +18 −3 Changes for src/android/ReceiverActivity.java: 18 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -21,6 +21,9 @@ package de.appplant.cordova.plugin.localnotification; import java.util.Timer; import java.util.TimerTask; import org.json.JSONException; import org.json.JSONObject; Loading Loading @@ -73,10 +76,22 @@ public class ReceiverActivity extends Activity { private void invokeBackgroundCallback (Options options) { String function = options.getBackground(); if (TextUtils.isEmpty(function)) return; final String js = "setTimeout('" + function + "(\"" + options.getId() + "\")',0)"; // after reboot, LocalNotification.webView is always null // may be call background callback later if (!TextUtils.isEmpty(function) && LocalNotification.webView != null) { LocalNotification.webView.sendJavascript("setTimeout('" + function + "(\"" + options.getId() + "\")',0)"); // call background callback later if (LocalNotification.webView == null) { new Timer().schedule(new TimerTask() { @Override public void run() { LocalNotification.webView.sendJavascript(js); } }, 4000); } else { LocalNotification.webView.sendJavascript(js); } } }