소스 검색

Callbacks are called with the ID as a number and not as a string

Sebastián Katzer 12 년 전
부모
커밋
dc5089c9b2
3개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 1
      README.md
  2. 1 1
      src/android/Receiver.java
  3. 1 1
      src/android/ReceiverActivity.java

+ 2 - 1
README.md

@@ -54,11 +54,12 @@ More informations can be found [here](https://build.phonegap.com/plugins/331).
 - [bugfix:] `cancel` on iOS did not work.
 - [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.
 
 #### Version 0.6.3 (12.12.2013)
 - [bugfix:] Black screen on Android.
 - [bugfix:] App throws an error on reboot on Android.
-- Calling `cancel` on Android with an invalid String as ID does not throw an error anymore.
+- [enhancement:] Calling `cancel` on Android with an invalid String as ID does not throw an error anymore.
 
 #### Version 0.6.2 (04.12.2013)
 - Release under the Apache 2.0 license.

+ 1 - 1
src/android/Receiver.java

@@ -183,7 +183,7 @@ public class Receiver extends BroadcastReceiver {
         // after reboot, LocalNotification.webView is always null
         // may be call foreground callback later
         if (!TextUtils.isEmpty(function) && LocalNotification.webView != null) {
-            LocalNotification.webView.sendJavascript(function + "(" + options.getId() + ")");
+            LocalNotification.webView.sendJavascript("setTimeout('" + function + "(\"" + options.getId() + "\")',0)");
         }
     }
 }

+ 1 - 1
src/android/ReceiverActivity.java

@@ -76,7 +76,7 @@ public class ReceiverActivity extends Activity {
         // 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)");
+            LocalNotification.webView.sendJavascript("setTimeout('" + function + "(\"" + options.getId() + "\")',0)");
         }
     }
 }