Skip to content

Commit be5b6f1

Browse files
authored
docs: fix delivery vehicle reporter documentation (#62)
* docs: fix DeliveryVehicleReporter documentation * chore: remove unnecessary setVehicleState method from DeliveryDriverController on iOS * docs: fixes to the example app
1 parent 1847878 commit be5b6f1

File tree

6 files changed

+21
-30
lines changed

6 files changed

+21
-30
lines changed

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,8 @@ Note: The `initialize` method takes a `onGetTokenCallback` field as parameter. T
175175
The vehicle reporter allows developers to enable/disable location reporting to Fleet Engine.
176176
177177
```typescript
178-
const vehicleReporter = deliveryApi.getRidesharingVehicleReporter()
178+
const vehicleReporter = deliveryApi.getDeliveryVehicleReporter()
179179
await vehicleReporter.setLocationTrackingEnabled(true);
180-
await vehicleReporter.setVehicleState(VehicleState.ONLINE);
181180
```
182181
183182
#### Getting a `DeliveryVehicleManager`
@@ -207,33 +206,33 @@ To get the DriverSDK version being used, you can call the **getDriverSdkVersion*
207206
const sdkVersion = await driverApi.getDriverSdkVersion();
208207
```
209208
210-
### List of sample functions in ODRD
209+
### List of functions in ODRD
211210
212211
| Function | Description |
213212
| ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
214-
| `RidesharingDriverApi.initialize` | create the instance of RidesharingAPI. |
213+
| `RidesharingDriverApi.initialize` | Create the instance of RidesharingAPI. |
215214
| `RidesharingDriverApi.getRidesharingVehicleReporter` | Vehicle reporter for the vehicle that reports location and vehicle state to Fleet Engine. An app is allowed only one vehicle reporter. |
216215
| `RidesharingVehicleReporter.setLocationTrackingEnabled(boolean)` | Enable/disabled location tracking(logs). |
217216
| `RidesharingVehicleReporter.setVehicleState(VehicleState)` | Set vehicle state to Online/Offline to Fleet Engine. |
218217
| `RidesharingVehicleReporter.setLocationReportingInterval(number)` | Set the reporting interval(seconds). |
219-
| `RidesharingDriverApi.getDriverSdkVersion()` | get native driversdk version. |
220-
| `RidesharingDriverApi.clearInstance()` | clear the api instance. |
221-
| `RidesharingDriverApi.setAbnormalTerminationReporting(boolean)` | enable/disable abnormal termination reporting. |
218+
| `RidesharingDriverApi.getDriverSdkVersion()` | Get native driversdk version. |
219+
| `RidesharingDriverApi.clearInstance()` | Clear the api instance. |
220+
| `RidesharingDriverApi.setAbnormalTerminationReporting(boolean)` | Enable/disable abnormal termination reporting. |
222221
223222
224-
### List of sample functions in LMFS
223+
### List of functions in LMFS
225224
226225
| Function | Description |
227226
| ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
228-
| `DeliveryDriverApi.initialize` | create the instance of DeliveryDriverAPI. |
227+
| `DeliveryDriverApi.initialize` | Create the instance of DeliveryDriverAPI. |
229228
| `DeliveryDriverApi.getDeliveryVehicleReporter` | Vehicle reporter for a delivery vehicle that reports location and stop information. An app is allowed only one vehicle reporter. |
230229
| `DeliveryDriverApi.getDeliveryVehicleManager` | Returns a vehicle manager that can be used to fetch the delivery vehicle from Fleet Engine |
231230
| `DeliveryVehicleReporter.setLocationTrackingEnabled(boolean)` | Enable/disabled location tracking(logs). |
232231
| `DeliveryVehicleReporter.setLocationReportingInterval(number)` | Set the log interval(seconds). |
233-
| `DeliveryVehicleReporter.getDriverSdkVersion()` | get delivery driversdk version. | |
232+
| `DeliveryVehicleReporter.getDriverSdkVersion()` | Get delivery driversdk version. | |
234233
| `DeliveryVehicleManager.getDeliveryVehicle()` | Fetch the delivery vehicle from Fleet Engine |
235-
| `DeliveryVehicleReporter.clearInstance()` | clear instance. |
236-
| `DeliveryVehicleReporter.setAbnormalTerminationReporting(boolean)` | enable/disable abnormal termination reporting. |
234+
| `DeliveryVehicleReporter.clearInstance()` | Clear instance. |
235+
| `DeliveryVehicleReporter.setAbnormalTerminationReporting(boolean)` | Enable/disable abnormal termination reporting. |
237236
238237
### Requesting and handling permissions
239238

example/LMFS/ios/Podfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Disable new arch as it is not supported by the current version of package
2+
ENV['RCT_NEW_ARCH_ENABLED'] = '0'
3+
14
def node_require(script)
25
# Resolve script with node to allow for hoisting
36
require Pod::Executable.execute_command('node', ['-p',

example/LMFS/src/checkPermissions.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,8 @@ const usePermissions = () => {
3030
const check = async () => {
3131
const toRequestPermissions =
3232
Platform.OS === 'android'
33-
? [
34-
PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION,
35-
PERMISSIONS.ANDROID.READ_MEDIA_IMAGES,
36-
]
37-
: [PERMISSIONS.IOS.LOCATION_ALWAYS, PERMISSIONS.IOS.PHOTO_LIBRARY];
33+
? [PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION]
34+
: [PERMISSIONS.IOS.LOCATION_ALWAYS];
3835

3936
try {
4037
const permissionStatuses = await requestMultiple(toRequestPermissions);

example/ODRD/ios/Podfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Disable new arch as it is not supported by the current version of package
2+
ENV['RCT_NEW_ARCH_ENABLED'] = '0'
3+
14
def node_require(script)
25
# Resolve script with node to allow for hoisting
36
require Pod::Executable.execute_command('node', ['-p',

example/ODRD/src/checkPermissions.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,8 @@ const usePermissions = () => {
3030
const check = async () => {
3131
const toRequestPermissions =
3232
Platform.OS === 'android'
33-
? [
34-
PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION,
35-
PERMISSIONS.ANDROID.READ_MEDIA_IMAGES,
36-
]
37-
: [PERMISSIONS.IOS.LOCATION_ALWAYS, PERMISSIONS.IOS.PHOTO_LIBRARY];
33+
? [PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION]
34+
: [PERMISSIONS.IOS.LOCATION_ALWAYS];
3835

3936
try {
4037
const permissionStatuses = await requestMultiple(toRequestPermissions);

ios/DeliveryDriverController.m

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,6 @@ - (void)createDeliveryDriverInstance:(NSString *)providerId vehicleId:(NSString
5353
lmfsEventDispatch = [DriverEventDispatcher allocWithZone:nil];
5454
}
5555

56-
- (void)setVehicleState:(BOOL)isOnline {
57-
if (isOnline) {
58-
[_vehicleReporter updateVehicleState:GMTDVehicleStateOnline];
59-
} else {
60-
[_vehicleReporter updateVehicleState:GMTDVehicleStateOffline];
61-
}
62-
}
63-
6456
- (void)setLocationTrackingEnabled:(BOOL)isEnabled {
6557
[_vehicleReporter setLocationTrackingEnabled:isEnabled];
6658
}

0 commit comments

Comments
 (0)