فهرست منبع

Merge branch 'master' of https://github.com/katzer/cordova-plugin-local-notifications

PC Dreams (Paulo Cristo) 9 سال پیش
والد
کامیت
7489876df0

+ 2 - 1
plugin.xml

@@ -20,7 +20,8 @@
     <!-- cordova -->
     <engines>
         <engine name="cordova" version=">=3.6.0" />
-        <engine name="cordova-plugman" version=">=4.3.0" />
+        <!-- TODO next version: Probably I meant cordova-lib -->
+        <!-- <engine name="cordova-plugman" version=">=4.3.0" /> -->
         <engine name="cordova-windows" version=">=4.2.0" />
     </engines>
 

+ 6 - 2
src/android/notification/Builder.java

@@ -117,6 +117,7 @@ public class Builder {
     public Notification build() {
         Uri sound     = options.getSoundUri();
         int smallIcon = options.getSmallIcon();
+        int ledColor  = options.getLedColor();
         NotificationCompat.Builder builder;
 
         builder = new NotificationCompat.Builder(context)
@@ -127,8 +128,11 @@ public class Builder {
                 .setTicker(options.getText())
                 .setAutoCancel(options.isAutoClear())
                 .setOngoing(options.isOngoing())
-                .setColor(options.getColor())
-                .setLights(options.getLedColor(), 100, 100);
+                .setColor(options.getColor());
+
+        if (ledColor != 0) {
+            builder.setLights(ledColor, 100, 100);
+        }
 
         if (sound != null) {
             builder.setSound(sound);

+ 2 - 2
src/android/notification/Options.java

@@ -132,7 +132,7 @@ public class Options {
         if (options.has("iconUri") && !options.optBoolean("updated"))
             return;
 
-        Uri iconUri  = assets.parse(options.optString("icon", "icon"));
+        Uri iconUri  = assets.parse(options.optString("icon", "res://icon"));
         Uri soundUri = assets.parseSound(options.optString("sound", null));
 
         try {
@@ -242,7 +242,7 @@ public class Options {
         String hex = options.optString("led", null);
 
         if (hex == null) {
-            return NotificationCompat.DEFAULT_LIGHTS;
+            return 0;
         }
 
         int aRGB = Integer.parseInt(hex, 16);

+ 3 - 0
src/ios/APPLocalNotificationOptions.h

@@ -20,6 +20,9 @@
  *
  * @APPPLANT_LICENSE_HEADER_END@
  */
+ 
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
 
 @interface APPLocalNotificationOptions : NSObject
 

+ 1 - 1
www/local-notification-util.js

@@ -67,7 +67,7 @@ exports.applyPlatformSpecificOptions = function () {
         defaults.smallIcon = undefined;
         defaults.ongoing   = false;
         defaults.autoClear = true;
-        defaults.led       = 'FF0000';
+        defaults.led       = undefined;
         defaults.color     = undefined;
         break;
     }

+ 1 - 1
www/local-notification.js

@@ -372,5 +372,5 @@ exports.on = function (event, callback, scope) {
  *      The function to be exec as callback
  */
 exports.un = function (event, callback) {
-    this.core.un(event, callback, scope);
+    this.core.un(event, callback);
 };