Skip to content

Instantly share code, notes, and snippets.

@zxshinxz
Created September 26, 2015 13:25
Show Gist options
  • Save zxshinxz/36b6da59a9e4efa50857 to your computer and use it in GitHub Desktop.
Save zxshinxz/36b6da59a9e4efa50857 to your computer and use it in GitHub Desktop.
fix local notification
change LocalNotification.java
both
/plugins/de.appplant.cordova.plugin.local-notification/src/android/LocalNotification.java
/platforms/android/src/de/appplant/cordova/plugin/localnotification/LocalNotification.java
private static synchronized void sendJavascript(final String js) {
if (!deviceready) {
eventQueue.add(js);
return;
}
webView.getView().post(new Runnable(){
public void run(){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
webView.sendJavascript(js);
} else {
webView.loadUrl("javascript:" + js);
}
}
});
// webView.post(new Runnable(){
// public void run(){
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
// webView.evaluateJavascript(js, null);
// } else {
// webView.loadUrl("javascript:" + js);
// }
// }
// });
}
//THEN DELETE
platforms/android/libs/android-support-v4.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment