Install Flutter demo app

Telematics SDK

A flutter plugin for tracking the person's driving behavior such as speeding, turning, braking and several other things on iOS and Android.

Disclaimer: This project uses Telematics SDK which belongs to DATA MOTION PTE. LTD.
When using Telematics SDK refer to these terms of use

Getting Started

Initial app setup & credentials

For commercial use, you need to create a sandbox account DataHub and get InstanceId auth keys to work with our API.

Android

AndroidManifest.xml

add to file ./app/src/main/AndroidManifest.xml props:

  1. 'xmlns:tools="http://schemas.android.com/tools"' into manifest tag
  2. 'tools:replace="android:label"' into __application tag

as shown below:

<manifest
    xmlns:tools="http://schemas.android.com/tools">
    <application
        tools:replace="android:label">
        ...
    </application>
    ...
</manifest>

add network permissions

<manifest>
...
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
...

Proguard

-keep public class com.raxeltelematics.** {*;}

Android Advanced

SetTrackingSettings

  1. Override application class extends TelematicsSDKApp

    import com.telematicssdk.TelematicsSDKApp
    
    class App: TelematicsSDKApp() {
        //...
    }
    
  2. add to tag application of file ./app/src/main/AndroidManifest.xml this class name:

    <application
            android:name=".App">
        ...
    </application>
    
    
  3. add Raxel repository into (module)/gradle.build

    dependencies {
        //...
        implementation "com.telematicssdk:tracking: 2.2.231"
    }
    

iOS

Add permissions in your project's ios/Runner/Info.plist:

    <key>UIBackgroundModes</key>
    <array>
        <string>fetch</string>
        <string>location</string>
        <string>remote-notification</string>
    </array>
    <key>NSMotionUsageDescription</key>
    <string>Please, provide permissions for this Demo</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Please, provide permissions for this Demo</string>
    <key>NSLocationAlwaysUsageDescription</key>
    <string>Please, provide permissions for this Demo</string>
    <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
    <string>Please, provide permissions for this Demo</string>
    <key>BGTaskSchedulerPermittedIdentifiers</key>
    <array>
        <string>sdk.damoov.apprefreshtaskid</string>
        <string>sdk.damoov.appprocessingtaskid</string>
    </array>

Starting from iOS version 15 and above, as well as Flutter 2.0.6, modification of AppDelegate.swift is required

You must request permissions for the application before GeneratedPluginRegistrant

Example AppDelegate.swift

import Flutter
import UIKit
import RaxelPulse

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
      // Documentation: https://docs.damoov.com/docs/-download-the-sdk-and-install-it-in-your-environment#setting-up-the-permissions-wizard
      RPPermissionsWizard.returnInstance().launch(finish: { _ in
          RPEntry.initialize(withRequestingPermissions: true)
          let token = NSString(string: "Please, enter your Token")
          RPEntry.instance().virtualDeviceToken = token
          let options = launchOptions ?? [:]
          RPEntry.application(application, didFinishLaunchingWithOptions: options)
      })
      
      GeneratedPluginRegistrant.register(with: self)
      return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

Links

https://damoov.com/


Did this page help you?