Skip to content

Commit

Permalink
Add default values to the transition that we create
Browse files Browse the repository at this point in the history
Otherwise the notification schedule fails with error reading
ints or booleans from a null object
shankari committed Apr 4, 2020
1 parent ea62c2a commit ec75e28
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
id="edu.berkeley.eecs.emission.cordova.transitionnotify"
version="1.2.2">
version="1.2.3">

<name>TransitionNotification</name>
<description>Transition notification. Specially good for trip start and trip end notifications </description>
6 changes: 6 additions & 0 deletions src/android/TransitionNotificationReceiver.java
Original file line number Diff line number Diff line change
@@ -158,6 +158,12 @@ public void notifyEvent(Context context, String eventName, JSONObject autogenDat
if (currData == null) {
currData = new JSONObject();
currNotifyConfig.put("data", currData);
JSONObject currTrigger = new JSONObject();
currTrigger.put("type", "calendar");
currNotifyConfig.put("trigger", currTrigger);
JSONObject pb = new JSONObject();
pb.put("enabled", false);
currNotifyConfig.put("progressBar", pb);
}
mergeObjects(currData, autogenData);
}

0 comments on commit ec75e28

Please sign in to comment.