fix crash on samsung devices, 500 alarms limit

parent 3e611de2
......@@ -37,6 +37,7 @@ import org.json.JSONObject;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.lang.Exception;
import de.appplant.cordova.plugin.notification.Manager;
import de.appplant.cordova.plugin.notification.Notification;
......@@ -213,10 +214,18 @@ public class LocalNotification extends CordovaPlugin {
for (int i = 0; i < notifications.length(); i++) {
JSONObject options = notifications.optJSONObject(i);
Notification notification =
getNotificationMgr().schedule(options, TriggerReceiver.class);
try {
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