*SDK Delegates

Applicable for SDK version 5.9.5 and higher

RPLocationDelegate

Usage example:

@interface AppDelegate () <RPLocationDelegate> {
        [RPEntry instance].locationDelegate = self;
}

Delegate method:

- (void)onLocationChanged:(CLLocation *)location {
    // Enter your code here to use location objectfrom SDK
}

- (void)onNewEvents:(NSMutableArray *)events {
    for (RPEventPoint *temp in events) {
        NSString *tempString = self.loggerView.text;
        tempString = [NSString stringWithFormat:@"%@\n%@", tempString, temp.type];
        dispatch_async(dispatch_get_main_queue(), ^{
            [self.loggerView setText:tempString];
        });
    }
}

Applicable for SDK version 5.8.0 and higher

RPLowPowerModeDelegate

Usage exameple:

@interface AppDelegate () <RPLowPowerModeDelegate> {
        [RPEntry instance].lowPowerModeDelegate = self;
}

Delegate method:

- (void)lowPowerMode:(Boolean)state {
    if (state) {
        // You can create push in this place and fire about this, as example 
        
        UNMutableNotificationContent *content = [[UNMutableNotificationContent alloc] init];
        content.title = @"Low Power Mode";
        content.body = [NSString stringWithFormat:@"Your trips may be not recorded. Please, follow to Settings=>Battery=>Low Power"];
        UNTimeIntervalNotificationTrigger *trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:1 repeats:NO];
        UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:@"overspeed" content:content trigger:trigger];

        [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:nil]; 
    }
}

RPAccuracyAuthorizationDelegate

Usage example:

@interface AppDelegate () <RPAccuracyAuthorizationDelegate> {
        [RPEntry instance].accuracyAuthorizationDelegate = self;
}

Delegate method:

- (void)wrongAccuracyAuthorization {
    // You can create push in this place and fire about this, as example 
        
    UNMutableNotificationContent *content = [[UNMutableNotificationContent alloc] init];
    content.title = @"Precise Location is off";
    content.body = [NSString stringWithFormat:@"Your trips may be not recorded. Please, follow to App Settings=>Location=>Precise Location"];
    UNTimeIntervalNotificationTrigger *trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:1 repeats:NO];
    UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:@"overspeed" content:content trigger:trigger];

    [[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:nil];

}

Applicable for SDK version 5.7.0 and higher

RPLocationDelegate

Usage example:

@interface AppDelegate () <RPLocationDelegate> {
        [RPEntry instance].locationDelegate = self;
}

Delegate method:

- (void)onLocationChanged:(CLLocation *)location {
    // Enter your code here to use location objectfrom SDK
}

Last updated