Quellcode durchsuchen

Fix incompatibility with cordova version 3.5-3.0

Sebastián Katzer vor 10 Jahren
Ursprung
Commit
744b513c79
2 geänderte Dateien mit 7 neuen und 1 gelöschten Zeilen
  1. 1 0
      CHANGELOG.md
  2. 6 1
      src/android/LocalNotification.java

+ 1 - 0
CHANGELOG.md

@@ -5,6 +5,7 @@ Please also read the [Upgrade Guide](https://github.com/katzer/cordova-plugin-lo
 
 #### Version 0.8.1 (not yet released)
 
+- Fix incompatibility with cordova version 3.5-3.0
 - Fire `clear` instead of `cancel` event when clicked on repeating notifications
 - Do not fire `clear` or `cancel` event when clicked on persistent notifications
 

+ 6 - 1
src/android/LocalNotification.java

@@ -27,6 +27,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.cordova.CallbackContext;
+import org.apache.cordova.CordovaInterface;
 import org.apache.cordova.CordovaPlugin;
 import org.apache.cordova.CordovaWebView;
 import org.apache.cordova.PluginResult;
@@ -60,9 +61,13 @@ public class LocalNotification extends CordovaPlugin {
 
     /**
      * Called after plugin construction and fields have been initialized.
+     * Prefer to use pluginInitialize instead since there is no value in
+     * having parameters on the initialize() function.
+     *
+     * pluginInitialize is not available for cordova 3.0-3.5 !
      */
     @Override
-    protected void pluginInitialize() {
+    public void initialize (CordovaInterface cordova, CordovaWebView webView) {
         LocalNotification.webView = super.webView;
     }