diff --git a/package.json b/package.json index 3c63ce4..fc13232 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-em-datacollection", - "version": "1.9.2", + "version": "1.9.5", "description": "The main tracking for the e-mission platform", "license": "BSD-3-clause", "cordova": { diff --git a/plugin.xml b/plugin.xml index 28211e2..8f62e5f 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,7 +1,7 @@ + version="1.9.5"> DataCollection Background data collection FTW! This is the part that I really diff --git a/src/ios/Location/TripDiaryStateMachine.m b/src/ios/Location/TripDiaryStateMachine.m index c04f739..6fa06dd 100644 --- a/src/ios/Location/TripDiaryStateMachine.m +++ b/src/ios/Location/TripDiaryStateMachine.m @@ -259,6 +259,8 @@ -(void) handleStart:(NSString*) transition withUserInfo:(NSDictionary*) userInfo [TripDiaryStateMachine getStateName:self.currState]]]; [TripDiaryActions startTracking:transition withLocationMgr:self.locMgr]; [TripDiaryActions deleteGeofence:self.locMgr]; + [[NSNotificationCenter defaultCenter] postNotificationName:CFCTransitionNotificationName + object:CFCTransitionTripStarted]; } else { [LocalNotificationManager addNotification:[NSString stringWithFormat: @"ERROR: Got transition %@ in state %@ without fleet mode", @@ -266,8 +268,6 @@ -(void) handleStart:(NSString*) transition withUserInfo:(NSDictionary*) userInfo [TripDiaryStateMachine getStateName:self.currState]]]; } - [[NSNotificationCenter defaultCenter] postNotificationName:CFCTransitionNotificationName - object:CFCTransitionTripStarted]; } else if ([transition isEqualToString:CFCTransitionInitComplete]) { // Geofence has been successfully created and we are inside it so we are about to move to // the WAITING_FOR_TRIP_START state. @@ -357,6 +357,8 @@ - (void) handleWaitingForTripStart:(NSString*) transition withUserInfo:(NSDicti [TripDiaryStateMachine getStateName:self.currState]]]; [TripDiaryActions startTracking:transition withLocationMgr:self.locMgr]; [TripDiaryActions deleteGeofence:self.locMgr]; + [[NSNotificationCenter defaultCenter] postNotificationName:CFCTransitionNotificationName + object:CFCTransitionTripStarted]; } else { [LocalNotificationManager addNotification:[NSString stringWithFormat: @"ERROR: Got transition %@ in state %@ without fleet mode", @@ -364,8 +366,6 @@ - (void) handleWaitingForTripStart:(NSString*) transition withUserInfo:(NSDicti [TripDiaryStateMachine getStateName:self.currState]]]; } - [[NSNotificationCenter defaultCenter] postNotificationName:CFCTransitionNotificationName - object:CFCTransitionTripStarted]; } else if ([transition isEqualToString:CFCTransitionVisitEnded]) { if ([ConfigManager instance].ios_use_visit_notifications_for_detection) {