diff --git a/README.md b/README.md index cac6393..e0f0368 100644 --- a/README.md +++ b/README.md @@ -175,9 +175,8 @@ Note: The `initialize` method takes a `onGetTokenCallback` field as parameter. T The vehicle reporter allows developers to enable/disable location reporting to Fleet Engine. ```typescript - const vehicleReporter = deliveryApi.getRidesharingVehicleReporter() + const vehicleReporter = deliveryApi.getDeliveryVehicleReporter() await vehicleReporter.setLocationTrackingEnabled(true); - await vehicleReporter.setVehicleState(VehicleState.ONLINE); ``` #### Getting a `DeliveryVehicleManager` @@ -207,33 +206,33 @@ To get the DriverSDK version being used, you can call the **getDriverSdkVersion* const sdkVersion = await driverApi.getDriverSdkVersion(); ``` -### List of sample functions in ODRD +### List of functions in ODRD | Function | Description | | ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -| `RidesharingDriverApi.initialize` | create the instance of RidesharingAPI. | +| `RidesharingDriverApi.initialize` | Create the instance of RidesharingAPI. | | `RidesharingDriverApi.getRidesharingVehicleReporter` | Vehicle reporter for the vehicle that reports location and vehicle state to Fleet Engine. An app is allowed only one vehicle reporter. | | `RidesharingVehicleReporter.setLocationTrackingEnabled(boolean)` | Enable/disabled location tracking(logs). | | `RidesharingVehicleReporter.setVehicleState(VehicleState)` | Set vehicle state to Online/Offline to Fleet Engine. | | `RidesharingVehicleReporter.setLocationReportingInterval(number)` | Set the reporting interval(seconds). | -| `RidesharingDriverApi.getDriverSdkVersion()` | get native driversdk version. | -| `RidesharingDriverApi.clearInstance()` | clear the api instance. | -| `RidesharingDriverApi.setAbnormalTerminationReporting(boolean)` | enable/disable abnormal termination reporting. | +| `RidesharingDriverApi.getDriverSdkVersion()` | Get native driversdk version. | +| `RidesharingDriverApi.clearInstance()` | Clear the api instance. | +| `RidesharingDriverApi.setAbnormalTerminationReporting(boolean)` | Enable/disable abnormal termination reporting. | -### List of sample functions in LMFS +### List of functions in LMFS | Function | Description | | ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | -| `DeliveryDriverApi.initialize` | create the instance of DeliveryDriverAPI. | +| `DeliveryDriverApi.initialize` | Create the instance of DeliveryDriverAPI. | | `DeliveryDriverApi.getDeliveryVehicleReporter` | Vehicle reporter for a delivery vehicle that reports location and stop information. An app is allowed only one vehicle reporter. | | `DeliveryDriverApi.getDeliveryVehicleManager` | Returns a vehicle manager that can be used to fetch the delivery vehicle from Fleet Engine | | `DeliveryVehicleReporter.setLocationTrackingEnabled(boolean)` | Enable/disabled location tracking(logs). | | `DeliveryVehicleReporter.setLocationReportingInterval(number)` | Set the log interval(seconds). | -| `DeliveryVehicleReporter.getDriverSdkVersion()` | get delivery driversdk version. | | +| `DeliveryVehicleReporter.getDriverSdkVersion()` | Get delivery driversdk version. | | | `DeliveryVehicleManager.getDeliveryVehicle()` | Fetch the delivery vehicle from Fleet Engine | -| `DeliveryVehicleReporter.clearInstance()` | clear instance. | -| `DeliveryVehicleReporter.setAbnormalTerminationReporting(boolean)` | enable/disable abnormal termination reporting. | +| `DeliveryVehicleReporter.clearInstance()` | Clear instance. | +| `DeliveryVehicleReporter.setAbnormalTerminationReporting(boolean)` | Enable/disable abnormal termination reporting. | ### Requesting and handling permissions diff --git a/example/LMFS/ios/Podfile b/example/LMFS/ios/Podfile index aab5cdb..67195a3 100644 --- a/example/LMFS/ios/Podfile +++ b/example/LMFS/ios/Podfile @@ -1,3 +1,6 @@ +# Disable new arch as it is not supported by the current version of package +ENV['RCT_NEW_ARCH_ENABLED'] = '0' + def node_require(script) # Resolve script with node to allow for hoisting require Pod::Executable.execute_command('node', ['-p', diff --git a/example/LMFS/src/checkPermissions.ts b/example/LMFS/src/checkPermissions.ts index 6ce195b..62ad130 100644 --- a/example/LMFS/src/checkPermissions.ts +++ b/example/LMFS/src/checkPermissions.ts @@ -30,11 +30,8 @@ const usePermissions = () => { const check = async () => { const toRequestPermissions = Platform.OS === 'android' - ? [ - PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION, - PERMISSIONS.ANDROID.READ_MEDIA_IMAGES, - ] - : [PERMISSIONS.IOS.LOCATION_ALWAYS, PERMISSIONS.IOS.PHOTO_LIBRARY]; + ? [PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION] + : [PERMISSIONS.IOS.LOCATION_ALWAYS]; try { const permissionStatuses = await requestMultiple(toRequestPermissions); diff --git a/example/ODRD/ios/Podfile b/example/ODRD/ios/Podfile index aab5cdb..67195a3 100644 --- a/example/ODRD/ios/Podfile +++ b/example/ODRD/ios/Podfile @@ -1,3 +1,6 @@ +# Disable new arch as it is not supported by the current version of package +ENV['RCT_NEW_ARCH_ENABLED'] = '0' + def node_require(script) # Resolve script with node to allow for hoisting require Pod::Executable.execute_command('node', ['-p', diff --git a/example/ODRD/src/checkPermissions.ts b/example/ODRD/src/checkPermissions.ts index 6ce195b..62ad130 100644 --- a/example/ODRD/src/checkPermissions.ts +++ b/example/ODRD/src/checkPermissions.ts @@ -30,11 +30,8 @@ const usePermissions = () => { const check = async () => { const toRequestPermissions = Platform.OS === 'android' - ? [ - PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION, - PERMISSIONS.ANDROID.READ_MEDIA_IMAGES, - ] - : [PERMISSIONS.IOS.LOCATION_ALWAYS, PERMISSIONS.IOS.PHOTO_LIBRARY]; + ? [PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION] + : [PERMISSIONS.IOS.LOCATION_ALWAYS]; try { const permissionStatuses = await requestMultiple(toRequestPermissions); diff --git a/ios/DeliveryDriverController.m b/ios/DeliveryDriverController.m index b87df3b..7320a57 100644 --- a/ios/DeliveryDriverController.m +++ b/ios/DeliveryDriverController.m @@ -53,14 +53,6 @@ - (void)createDeliveryDriverInstance:(NSString *)providerId vehicleId:(NSString lmfsEventDispatch = [DriverEventDispatcher allocWithZone:nil]; } -- (void)setVehicleState:(BOOL)isOnline { - if (isOnline) { - [_vehicleReporter updateVehicleState:GMTDVehicleStateOnline]; - } else { - [_vehicleReporter updateVehicleState:GMTDVehicleStateOffline]; - } -} - - (void)setLocationTrackingEnabled:(BOOL)isEnabled { [_vehicleReporter setLocationTrackingEnabled:isEnabled]; }