Telematics SDK | Developer portal
  • Get started
  • 4 Steps to Integrate SDK
  • Product Wiki
  • License
  • FAQ
  • PRODUCT DESCRIPTION
    • How it works
    • SDK Features
    • Scoring
      • Risk driving Scoring
        • Event detection
        • Trip rating
        • Overall scoring
      • Eco Scoring
    • Dataset
      • Dataset | User statistics API
      • Data samples
        • Summary - Processed track details (Rich track details)
        • Processed track waypoints (Rich track points)
        • Summary - list of Processed tracks
        • Incoming track events
        • Incoming track points (waypoints)
        • Summary - list of Incoming tracks
      • Dataset Decription
        • Bluetooth OBD - Vehicle Dataset
        • LastKnownPoints
        • IncomingTrackPoints
        • IncomingTrackEvents
        • Enriched telematics data
          • RichTracks
          • RichTrackPoints
          • RichTrackEvents
          • RichTrackDetails
          • UserStatisticDrivingDetails
        • Raw telematics data from SDK
    • Reporting
      • Drivecoins summary
      • Trip summary
      • Scoring summary
      • User state
      • Fraud
      • Trip waypoints
      • Trip events
    • External Articles
      • Why mobile telematics hits hardware telematics
  • Step 1: Create Datahub Account
  • Step 2: SDK Installation
    • Get started
    • iOS SDK installation
      • *Set up Your Development Environment
      • *Configure Your Project
      • *App Delegate
      • *Configure Framework
      • *React Native Installation
        • Create the iOS bridge
      • Add list of trips to your ViewController
      • Add statistics data to your ViewController
      • *What’s different in iOS 13?
      • *iOS 13 Permissions Wizard
      • *SDK Enable \ Disable \ Disable With Upload
      • *Incoming Tags
      • *Tracking Status
      • *SDK Delegates
      • *SDK Modes
      • *Using the Debugging Tools in Simulator
    • Android SDK installation
      • *Getting started
        • *Set up Your Development Environment
        • *Setup and enable SDK
        • *Permissions wizard
        • *Permissions dialog
        • *Configure SDK variables for notifications
      • *Subscribe to tracking events
      • *Incoming tags managing
      • *Migration from SDK v1.6.x to SDK v2.0.x
    • *Check SDK Installation
      • iOS Simulator
      • DataTool
      • ZenRoad
    • *Demo Applications
      • iOS | Open Source Demo Application
      • iOS | SDK Demo Application
      • iOS | Swift | SDK Demo Application
      • Android | SDK Demo Application
      • Android | Java | SDK Demo Application
      • Flutter | SDK Demo Application
    • SDK Changelog
      • Android SDK Changelog
      • iOS SDK Changelog
    • Permissions Guides
      • First Launch
        • iOS 13 (and higher) Permissions Guide
        • iOS 12 (and lower) Permissions Guide
        • Android 9 Permissions Guide
        • Android 9 XIaomi Permissions Guide
        • Android 10 Permissions Guide
      • *Troubleshooting
        • iOS — Troubleshooting
          • iOS — Troubleshooting
        • Android — Troubleshooting
          • Samsung — Troubleshooting
          • Oppo — Troubleshooting
          • Huawei — Troubleshooting
          • Xiaomi — Troubleshotting
          • OnePlus — Troubleshooting
          • Meizu — Troubleshooting
          • Asus — Troubleshooting
          • Vivo — Troubleshooting
          • Wiko — Troubleshooting
  • Step 3: Register SDK users
    • User Registration (API)
  • Step 4: API | User Statistics, Scores, Trips
    • Step 4: Get Statistics, Scorings and Trip Data
    • API Authorization
    • Statistics and Scoring APIs
      • Get started - Statistics and Scoring API
      • User | Individual Scorings and Statistics
      • Admin | User(s) - Scorings and Statistics
      • Admin | Consolidated Scorings and Statistics
    • Trips API
      • Get a short list of tracks
      • Get a list of tracks with paging
      • Get a list of tracks by IDs
      • Get a single track with waypoints
      • Get the most earliest track
      • Track Statuses
  • SDK Features
    • *Bluetooth Device - Get started
      • *Get Started
      • *Android - ELM API
      • *iOS - ELM API
    • Trip Tags - Get started
      • Tags for trips via mobile app
        • Android - Tags for trips
        • iOS - Tags for trips
      • Tags for period
      • Trip log by tags
  • PLATFORM FEATURES
    • *User Management
      • *User Registration
      • *Check User Existence
      • *User Management
    • *Vehicle Management
      • *Directories
      • *Vehicles
    • FNOL, Inspections & Damage Recognition
      • Get started
      • Profiles
      • Claims
      • Vehicle inspections
        • Dictionary of vehicle photos
      • Photo processing
    • *Leaderboard
      • *Summary Leaderboard
      • *Leaderboard by factors
      • Swagger - Leaderboard
    • *Streaks
    • *SNS
      • *How to register AWS SNS
    • 3rd party data processing
      • Swagger - Incoming getaway
    • *User & Permissions Status | Heartbeats
  • Other
    • Response Codes
    • Resources swaggers
      • Swagger: User service
      • Swagger: Scorings and Statistics API
      • Swagger: Telematics data
      • Swagger: Leaderboard
      • Swagger: Vehicle Management
      • Driving details
      • Swagger: FNOL, Inspections & Damage Recognition
      • Swagger: Heartbeats
    • Archive
      • Get started
      • Statistics and Scorings API
      • Step 5: Get statistics and trip data [ARCHIVED]
      • User Statistics API [Archived]
      • SDK - Statistics API [ARCHIVED]
        • Get the data to the Android app
          • Android Telematics data (Tracks)
            • Check current running track state
            • Get start date for current recording trip
            • Register tracking state listener (for onStartTracking/onStopTracking events)
            • Register speed violations listener
            • Get flag for registered speed violations listener
            • Get registered speed limit in km/h or default
            • Get registered speed violations timeout in ms or default
            • Get Tracks
            • Get detailed trips information
            • Get available user roles
            • Change a user role (any of TrackOriginDictionary.code)
          • Android User Statistics
            • Get Dashboard info
            • Get detailed Dashboard
            • Get Driving time statistics
            • Get Speeding statistics
            • Get Mileage statistics
            • Get Distracted Phone Usage statistics
        • Get the data to the iOS app
          • Other methods
          • iOS Telematics data (tracks)
            • Request all Tracks with specified offset and limit
            • Request all Tracks with specified offset and limit. No filter will be used in request
            • Request Track info with specified Track Token
            • Request Track origins dictionary
            • Change Track Origin Code
            • Share Track
          • iOS User Statistics
            • Get shared Track
            • Request main statistics data for all possible statistic types
            • NS_ENUM
            • Request main statistics data for all possible statistic types
            • Properties and Protocols
      • Get all DeviceTokens
    • Report a bug
    • Data Hub
    • Talk to sales
  • Postman collection
Powered by GitBook
On this page
  • Add all setup call of RaxelPulse SDK to callback method
  • Add Push Notifications call to this call back after init of RaxelPulse
  • Permissions Wizard Customisation

Was this helpful?

  1. Step 2: SDK Installation
  2. iOS SDK installation

*iOS 13 Permissions Wizard

Integration needed

New call

Implemented new class RPPermissionsWizard. Please, call it instance by returnInstance and use launchWithFinish for Objective-c or launch for Swift method with callback.

Objective-c:

[[RPPermissionsWizard returnInstance] launchWithFinish:^(BOOL showWizzard) {
}];

Swift:

RPPermissionsWizard.returnInstance().launch(finish: { showWizzard in
})

Add all setup call of RaxelPulse SDK to callback method

Objective-c:

[[RPPermissionsWizard returnInstance] launchWithFinish:^(BOOL showWizzard)
 {        [RPEntry initializeWithRequestingPermissions:YES];
        [RPEntry instance].virtualDeviceToken = @"_____";
        .... etc
    }];

Swift:

RPPermissionsWizard.returnInstance().launch(finish: { _ in
            RPEntry.initialize(withRequestingPermissions: true)
            let token = NSString(string: "______")
            RPEntry.instance().virtualDeviceToken = token
            let options = launchOptions ?? [:]
            RPEntry.application(application, didFinishLaunchingWithOptions:
options)
            .... etc
        })

Add Push Notifications call to this call back after init of RaxelPulse

Objective-c:

[[RPPermissionsWizard returnInstance] launchWithFinish:^(BOOL showWizzard) {
        [RPEntry initializeWithRequestingPermissions:YES];
        [RPEntry instance].virtualDeviceToken = @"_____";
        .... etc
    }];

Swift:

RPPermissionsWizard.returnInstance().launch(finish: { _ in
            RPEntry.initialize(withRequestingPermissions: true)
            let token = NSString(string: "______")
            RPEntry.instance().virtualDeviceToken = token
            let options = launchOptions ?? [:]
            RPEntry.application(application, didFinishLaunchingWithOptions:
options)
            .... etc
        })

or you can use RPPermissionsWizard handlers

Objective-c:

[[RPPermissionsWizard returnInstance] setupHandlersWithUserNotificationResponce:^(BOOL granted, NSError * _Nullable error) {
        if (error != nil) {
            NSLog(@"error while requesting notification permission. Error code
%li, error description %@",
                  error.code, error.description);
        }
        NSLog(@"receiving notification is granted: %d", granted);
    } motionManagerResponce:^(BOOL granted, NSError * _Nullable error) {
        NSLog(@"receiving motion is granted: %d", granted);
    } locationManagerResponce:^(CLAuthorizationStatus status) {
        NSLog(@"receiving location status: %d", status);
    }];

Swift:

              RPPermissionsWizard.returnInstance().setupHandlers(
                    userNotificationResponce: { (granted, error) in
                        DispatchQueue.main.async {
                            if granted {
                             UIApplication.shared.registerForRemoteNotifications()
                                observer.onNext(true)
                            } else {
                                observer.onNext(false)
                            }
                            observer.onCompleted()
                        }
                },
                    motionManagerResponce: { (granted, error) in
                },
                    locationManagerResponce: { (status) in
                })

Required Permissions Granted

Added isAllRequiredPermissionsGranted property for get state of SDK permissions needed. Objective-c:

BOOL isAllFine = RPEntry.isAllRequiredPermissionsGranted()

Swift:

BOOL isAllFine = [RPEntry isAllRequiredPermissionsGranted]; 

Permissions Wizard Customisation

If you not changed next property Wizard used default values from itself.

Implemented new class RPSettings. Please, call it instance by returnInstance and use property:

wizardBgColor - background color of screen view

wizardMaintextColor - main text color

wizardAlertTextColor - main text color in example alert

wizardAlertButtonColor - button text color in alert

wizardAlertActiveButtonColor - active button text color in alert

wizardAlertActiveButtonBgColor - active button background color in alert

wizardAlertCorners - alert corner radius in CGFloat

Default Values:

.White

public var wizardBgColor                 : UIColor = UIColor.groupTableViewBackground
public var wizardMaintextColor           : UIColor = UIColor.black
public var wizardAlertBackgroundColor    : UIColor = UIColor.white
public var wizardAlertTextColor          : UIColor = UIColor(hex: "6F8593")
public var wizardAlertButtonTextColor    : UIColor = UIColor(hex: "0984ff")
public var wizardAlertActiveButtonTextColor: UIColor = UIColor.white
public var wizardAlertActiveButtonBgColor : UIColor = UIColor(hex: "FF9300")
public var wizardAlertCorners             : CGFloat = 7.0
public var wizardNextButtonBgColor        : UIColor = UIColor(red:
0.10980392156862745, green: 0.10980392156862745, blue: 0.11764705882352941,
alpha: 1.0)
public var wizardNextButtonTextColor      : UIColor = UIColor.white

.Dark worked only when you not customising following alert colors:

wizardAlertBackgroundColor wizardAlertTextColor wizardAlertActiveButtonBgColor

.Dark style used next Default:

wizardAlertBackgroundColor = UIColor(red: 0.17254901960784313, green: 0.17254901960784313, blue: 0.1803921568627451, alpha: 1.0)
wizardAlertTextColor = UIColor.white
wizardAlertActiveButtonBgColor = UIColor(hex: "8e8e93")
wizardAlertActiveButtonTextColor = UIColor(hex: "0984ff")

How to use Settings:

Objective-c:

[RPSettings returnInstance].wizardAlertActiveButtonBgColor = 
  [UIColor colorWithRed: 0.79 
           green       : 0.22 
           blue        : 0.17 
           alpha       : 1.0];

Swift:

RPSettings.returnInstance.wizardAlertActiveButtonBgColor = UIColor.red

Custom text on Wizard pages:

Objective-c:

NSMutableAttributedString *firstButton = [[NSMutableAttributedString alloc] initWithString:@"Ok"];

NSMutableAttributedString *secondButton = [[NSMutableAttributedString alloc] initWithString:@"Cancel"];

NSArray<NSMutableAttributedString *> *buttonsList = [[NSArray alloc] initWithObjects:firstButton, secondButton, nil];

RPPageTexts *whileInUsePage = [[RPPageTexts alloc] initWithPageText:[[NSMutableAttributedString alloc] initWithString:@"Attention Required!\n\nYou will receive a popup shortly. This popup will aks you for access to your location even when you are not using the app.\n\nPlease, choose “Always While Using App” for <appName> to automatically detect when you start a trip."] alertText:[[NSMutableAttributedString alloc] initWithString:@"Allow <appName> to access your location?\n\nWe use location service for evaluating your driving manner. Be enabling “Always While Using App” on location, the app will be able to automatically determine when you have started and ended a drive"] buttonsText:buttonsList selected:1];

RPPageTexts *motionPage = [[RPPageTexts alloc] initWithPageText:[[NSMutableAttributedString alloc] initWithString:@"Attention Required!\n\nThen, You will receive a popup to grant us access to your Motion & Fitness activity. We need this information to create a driving score.\n\nPlease, choose “OK” for <appName> to grant us access to Motion & Fitness activity."] alertText:[[NSMutableAttributedString alloc] initWithString:@"<appName> Would Like to Access Your Motion & Fitness Activity\n\nWe use motion sensors for evaluating your driving manner"] buttonsText:buttonsList selected:1];

RPPageTexts *pushPage = [[RPPageTexts alloc] initWithPageText:[[NSMutableAttributedString alloc] initWithString:@"Attention Required!\n\nAs the next step, You will receive a popup to grant us rights to send you important notifications. You are always able to turn off notifications by categories in the App settings menu.\n\nPlease, choose “Allow” for <appName> to keep you informed on important events."] alertText:[[NSMutableAttributedString alloc] initWithString:@"<appName> Would Like to Send You Notifications\n\nNotifications may include alerts, sounds and icon badges. These can be configured in Settings"] buttonsText:buttonsList selected:1];

RPPageTexts *alwaysPage = [[RPPageTexts alloc] initWithPageText:[[NSMutableAttributedString alloc] initWithString:@"Attention Required!\n\nYou will receive a popup shortly for <appName> to have access to your location even when you are not using the app.\n\nFor the app to work properly\n“Change to Always Allow”"] alertText:[[NSMutableAttributedString alloc] initWithString:@"Allow <appName> to also access your location even when you are not using the app?\n\nWe use location service for generating a driving score. Be enabling “Always” on location, the app will be able to automatically determine when you have started and ended a drive"] buttonsText:buttonsList selected:1];

NSArray<RPPageTexts *> *customPages = [[NSArray alloc] initWithObjects:whileInUsePage, motionPage, pushPage, alwaysPage, nil];

[RPSettings returnInstance].wizardPages = customPages;

Swift:

let whileInUsePage = RPPageTexts(pageText: NSMutableAttributedString(string: "Attention Required!\n\nYou will receive a popup shortly. This popup will aks you for access to your location even when you are not using the app.\n\nPlease, choose “Always While Using App” for <appName> to automatically detect when you start a trip."), alertText: NSMutableAttributedString(string: "Allow <appName> to access your location?\n\nWe use location service for evaluating your driving manner. Be enabling “Always While Using App” on location, the app will be able to automatically determine when you have started and ended a drive"), buttonsText: [NSMutableAttributedString(string: "Always While Using App”), NSMutableAttributedString(string: "Allow Once”), NSMutableAttributedString(string: "Don’t Allow”)], selected: 0)

let motionPage = RPPageTexts(pageText: NSMutableAttributedString(string: "Attention Required!\n\nThen, You will receive a popup to grant us access to your Motion & Fitness activity. We need this information to create a driving score.\n\nPlease, choose “OK” for <appName> to grant us access to Motion & Fitness activity."), alertText: NSMutableAttributedString(string: "<appName> Would Like to Access Your Motion & Fitness Activity\n\nWe use motion sensors for evaluating your driving manner"), buttonsText: [NSMutableAttributedString(string: "Don’t Allow”), NSMutableAttributedString(string: "OK”)], selected: 1)

let pushPage = RPPageTexts(pageText: NSMutableAttributedString(string: "Attention Required!\n\nAs the next step, You will receive a popup to grant us rights to send you important notifications. You are always able to turn off notifications by categories in the App settings menu.\n\nPlease, choose “Allow” for <appName> to keep you informed on important events."), alertText: NSMutableAttributedString(string: "<appName> Would Like to Send You Notifications\n\nNotifications may include alerts, sounds and icon badges. These can be configured in Settings"), buttonsText: [NSMutableAttributedString(string: "Don’t Allow”), NSMutableAttributedString(string: "Allow”)], selected: 1)

let alwaysPage = RPPageTexts(pageText: NSMutableAttributedString(string: "Attention Required!\n\nYou will receive a popup shortly for <appName> to have access to your location even when you are not using the app.\n\nFor the app to work properly\n“Change to Always Allow”"), alertText: NSMutableAttributedString(string: "Allow <appName> to also access your location even when you are not using the app?\n\nWe use location service for generating a driving score. Be enabling “Always” on location, the app will be able to automatically determine when you have started and ended a drive"), buttonsText: [NSMutableAttributedString(string: "Keep Only While Using”), NSMutableAttributedString(string: "Change to Always Allow”)], selected: 1)

RPSettings.returnInstance().wizardPages = [whileInUsePage, motionPage, pushPage, alwaysPage]
Previous*What’s different in iOS 13?Next*SDK Enable \ Disable \ Disable With Upload

Last updated 4 years ago

Was this helpful?