IMS SDK Product Document
  • Getting Started
    • iOS
      • Requirements
      • Importing the SDK
      • Permissions
      • Initializing the SDK
      • Using the SDK
        • Using Push Notifications
          • Push notification certificate and profile creation guide
    • Android
      • Requirements
      • Import the SDK
      • Permissions
      • Obfuscation
      • Initialize the SDK
      • Using the SDK
        • Trip Detection and Recording
          • Trip Manager Configuration
            • Using TripDetector.AWARENESS
            • Trip Manager Device Support
          • Trip Manager Control
          • Trip Manager Status
        • Bluetooth and Other Devices
    • React Native
      • Requirements
      • Import the SDK
      • Permissions
      • Initialize the SDK
        • Android
        • iOS
      • Using the SDK
        • Trip Manager
        • Device service
    • Flutter
      • Requirements
      • Import the SDK
      • Permissions
      • Initialize the SDK
      • Using the SDK
  • Security
  • App misuse
  • Time Driven Without Phone
  • DriveSync Portal
    • Requirement
    • User
    • Device
    • Driving Alert
    • Push Notification
    • Invitations
    • Subscription
    • Trip
    • Location
    • Driving Summary
    • Discount
    • Scoring
    • Vehicle
    • Leaderboard
    • Rewards
    • Submit consent to EULA
    • Legal documents and FAQ
    • Named Driver
    • Wedge
  • Known Issues
    • iOS
    • Android
      • 1.17.0
      • 1.18.0
      • 1.22.0
  • Releases
    • 1.13.0
      • iOS
      • Android
    • 1.14.0
      • Android
    • 1.15.0
      • iOS
      • Android
    • 1.15.1
    • 1.16.0
      • iOS
      • Android
    • 1.17.0
      • iOS
      • Android
    • 1.18
      • iOS
      • Android
    • 1.18.1
    • 1.19.0
      • iOS
      • Android
    • 1.20.0
      • Android
      • iOS
    • 1.21.0
      • Android
      • iOS
    • 1.22.0
      • Android
      • iOS
    • 1.23.0
      • Android
      • iOS
    • 1.24.0
      • Android
      • iOS
    • 1.24.1
      • iOS
  • Migration
    • iOS
      • 1.15.x -> 1.16.0
      • 1.16.0 -> 1.17.0
      • 1.17.0 -> 1.18.0
      • 1.18.0 -> 1.19.0
      • 1.19.0 -> 1.20.0
      • 1.20.0 -> 1.21.0
      • 1.21.0 -> 1.22.0
      • 1.22.0 -> 1.23.0
      • 1.23.0 -> 1.24.0
      • 1.24.0 -> 1.24.1
    • Android
      • 1.15.x -> 1.16
      • 1.16 -> 1.17
      • 1.17 -> 1.18
      • 1.18 -> 1.19
      • 1.19 -> 1.20
      • 1.20 -> 1.21
      • 1.21 -> 1.22
      • 1.22 -> 1.23
      • 1.23 -> 1.24
  • Support
Powered by GitBook
On this page
  • Fetch
  • Concrete Example
  • Associate
  • Concrete Example
  • Delete
  • Concrete Example
  • Update
  • Concrete Example
  1. DriveSync Portal

Wedge

SDK introduces WedgeService for automatic wedge associations.

Fetch

Use the API to retrieve the array of associated wedges to a user. Returns associated wedges with callback.

To fetch the associated wedges, the following API can be used.

Concrete Example

let service = WedgeService()
service.fetchWedges(then: { result in
    switch result {
    case: .success(_)
        // successfully retrieved
    case: .failure(_)
        // failure error
    }
})
val service = WedgeService()
service.fetchWedges() { result: Result<Content?>? ->
    if (result?.value == null || result.throwable != null) {
        // failure
    } else {
        // Success
        val content = result.value
        completionHandler(content)
    }
})

Associate

The following API can be used to associate the wedge to a user. Returns an associated wedge with callback.

Parameters:

  • name: Wedge name

  • deviceId: Wedge unique identifier

  • vehicleId: Vehicle id

  • battery: Wedge battery level

  • firmware: Wedge firmware version

Concrete Example

let service = WedgeService()
service.associateWedge(name: String,
                       deviceId: String,
                       vehicleId: String,
                       battery: Int,
                       firmware: String) { result in
    switch result {
    case: .success(_)
        // successfully updated
    case: .failure(_)
        // failure error
    }
}
val service = WedgeService()
service.associateWedge(name: String,
                       deviceId: String,
                       vehicleId: String,
                       battery: Int,
                       firmware: String) { result: Result<Content?>? ->
    if (result?.value == null || result.throwable != null) {
        // failure
    } else {
        // Success
        val content = result.value
        completionHandler(content)
    }
}

Delete

To delete the associated wedge, the following API can be used.

Parameters:

  • deviceAssociationId: Association id which associates wedge to a user

To delete the associated wedge, first host app needs to retrieve the deviceAssociatioId provided when the fetch API call is made and need to provide the retrieved deviceAssociatioId as an argument to deleteWedge API

Concrete Example

let service = WedgeService()
service.deleteWedge(for deviceAssociatioId: String) { result in
    switch result {
    case: .success(_)
        // successfully updated
    case: .failure(_)
        // failure error
    }
})
val service = WedgeService()
service.deleteWedge(deviceAssociationId: String) { result: Result<Content?>? ->
    if (result?.value == null || result.throwable != null) {
        // failure
    } else {
        // Success
        val content = result.value
        completionHandler(content)
    }
}

Update

The following API can be used to update the wedge's battery and firmware. Returns the updated wedge with callback.

Parameters:

  • deviceAssociationId: Association id which associates wedge to a user

  • battery: Updated battery level

  • firmware: Updated firmware version

To update the wedge details, first host app needs to retrieve the deviceAssociatioId provided when the fetch API call is made and need to provide the retrieved deviceAssociatioId as an argument to updateWedge API

Concrete Example

let service = WedgeService()
service.updateWedge(for deviceAssociatioId: String, battery: Int, firmware: String) { result in
    switch result {
    case: .success(_)
        // successfully updated
    case: .failure(_)
        // failure error
    }
})
val service = WedgeService()
service.updateWedge(deviceAssociationId: String,
                    battery: Int,
                    firmware: String) { result: Result<Content?>? ->
    if (result?.value == null || result.throwable != null) {
        // failure
    } else {
        // Success
        val content = result.value
        completionHandler(content)
    }
}

PreviousNamed DriverNextKnown Issues

Last updated 5 months ago