Commit a744504c by PC Dreams (Paulo Cristo) Committed by Sebastián Katzer

fix crash on samsung devices, 500 alarms limit

parent 251a7ccf
...@@ -37,6 +37,7 @@ import org.json.JSONObject; ...@@ -37,6 +37,7 @@ import org.json.JSONObject;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.lang.Exception;
import de.appplant.cordova.plugin.notification.Manager; import de.appplant.cordova.plugin.notification.Manager;
import de.appplant.cordova.plugin.notification.Notification; import de.appplant.cordova.plugin.notification.Notification;
...@@ -227,10 +228,18 @@ public class LocalNotification extends CordovaPlugin { ...@@ -227,10 +228,18 @@ public class LocalNotification extends CordovaPlugin {
for (int i = 0; i < notifications.length(); i++) { for (int i = 0; i < notifications.length(); i++) {
JSONObject options = notifications.optJSONObject(i); JSONObject options = notifications.optJSONObject(i);
Notification notification = try {
getNotificationMgr().schedule(options, TriggerReceiver.class); Notification notification =
getNotificationMgr().schedule(options, TriggerReceiver.class);
fireEvent("schedule", notification); fireEvent("schedule", notification);
}
catch(Exception generic) {
//silently ignore the exception
//on some samsung devices there is a known bug where a 500 alarms limit can crash the app
//http://developer.samsung.com/forum/board/thread/view.do?boardName=General&messageId=280286&listLines=15&startId=zzzzz%7E&searchSubId=0000000001
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment