Skip to content

Commit

Permalink
More principled fix for the transition notify crash
Browse files Browse the repository at this point in the history
See discussion at e-mission#18 (comment)
This fixes e-mission#18
  • Loading branch information
shankari committed Apr 4, 2020
1 parent 490a6a2 commit 88cc83f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
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.1">
version="1.2.2">

<name>TransitionNotification</name>
<description>Transition notification. Specially good for trip start and trip end notifications </description>
Expand Down
3 changes: 1 addition & 2 deletions src/ios/BEMTransitionNotifier.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ - (void)pluginInitialize
- (void)fireGenericTransitionFor:(NSString*) transition withUserInfo:(NSDictionary*) userInfo {
[LocalNotificationManager addNotification:[NSString stringWithFormat:@"Received platform-specific notification %@", transition] showUI:FALSE];

if ([TripDiaryStateMachine instance].currState == kWaitingForTripStartState &&
([transition isEqualToString:CFCTransitionExitedGeofence] ||
if (([transition isEqualToString:CFCTransitionExitedGeofence] ||
[transition isEqualToString:CFCTransitionVisitEnded])) {
NSDictionary* autogenData = [self getTripStartData];
return [self postNativeAndNotify:TRIP_STARTED withData:autogenData];
Expand Down

0 comments on commit 88cc83f

Please sign in to comment.