Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions example/LMFS/ios/Podfile
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
7 changes: 2 additions & 5 deletions example/LMFS/src/checkPermissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions example/ODRD/ios/Podfile
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
7 changes: 2 additions & 5 deletions example/ODRD/src/checkPermissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 0 additions & 8 deletions ios/DeliveryDriverController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
Loading