Переглянути джерело

Callback functions should be undefined by default.

Sebastián Katzer 12 роки тому
батько
коміт
0065f5af0b
2 змінених файлів з 3 додано та 3 видалено
  1. 1 1
      src/ios/APPLocalNotification.m
  2. 2 2
      www/local-notification.js

+ 1 - 1
src/ios/APPLocalNotification.m

@@ -158,7 +158,7 @@
     NSString* callbackType            = isActive ? @"foreground" : @"background";
     NSString* callbackFn              = [notification.userInfo objectForKey:callbackType];
 
-    if (callbackFn.length > 0)
+    if (callbackFn && callbackFn.length > 0)
     {
         NSString* callback = [NSString stringWithFormat:@"setTimeout('%@(%@)',0)", callbackFn, id];
 

+ 2 - 2
www/local-notification.js

@@ -26,8 +26,8 @@ LocalNotification.prototype = {
             badge:      0,
             id:         0,
             repeat:     '',
-            background: '',
-            foreground: ''
+            background: undefined,
+            foreground: undefined
         };
 
         switch (device.platform) {