Results 1 to 5 of 5

Thread: [iOS SDK] Background routing

  1. #1
    Neuer skobbler
    Join Date
    10.12.2015
    Posts
    3

    [iOS SDK] Background routing

    I installed and tried the FrameworkiOSDemo app on my iPhone and tested the routing system.
    If I try to lock the phone while the navigation is in progress, it stops util I unlock the phone (aka the app becomes active).

    Is it possible to have the routing service active also when the app is running in background?

  2. #2
    Oberskobbler
    Join Date
    22.07.2014
    Posts
    399
    You have in the demo project an example:
    [SKPositionerService sharedInstance].worksInBackground = _configuration.allowBackgroundNavigation;
    if (self.configuration.allowBackgroundNavigation) {
    //notify the user that the navigaiton will continue while in background
    UILocalNotification *backgroundLocalNotification = [[UILocalNotification alloc] init];

    backgroundLocalNotification.alertBody = NSLocalizedString(kSKTBackgroundNavigationLocalNot ificationKey, nil);
    backgroundLocalNotification.userInfo = @{ kBackgroundLocalNotificationKey : kBackgroundLocalNotificationKey };
    [[UIApplication sharedApplication] scheduleLocalNotification:backgroundLocalNotificat ion];
    }

    And in the SDKTools documentation: http://developer.skobbler.com/gettin...iosTools#sec08

  3. #3
    Neuer skobbler
    Join Date
    10.12.2015
    Posts
    3
    Thank you Adela!

    I'm going a little off topic now.. what if I would like to have the detailed route data (steps, turns, symbols etc.)?
    I saw that it's possible to get these informations by sending a REST request to the web service, but I can't figure out how to get them using the SDK.

  4. #4
    Oberskobbler
    Join Date
    22.07.2014
    Posts
    399
    Hi Lorenzo,

    The SKRouteAdvice class stores information about a route advice: http://developer.skobbler.com/getting-started/ios#sec19

    Code:
    - (void)routingService:(SKRoutingService *)routingService didFinishRouteCalculationWithInfo:(SKRouteInformation*)routeInformation{
                 NSLog(@"Route is calculated.");
                 [routingService zoomToRouteWithInsets:UIEdgeInsetsZero duration:1]; // zoom to currrent route
                 NSArray *adviceList = [[SKRoutingService sharedInstance] routeAdviceListWithDistanceFormat:SKDistanceFormatMetric]; // array of SKRouteAdvice
                 }

  5. #5
    Neuer skobbler
    Join Date
    10.12.2015
    Posts
    3
    Thank you again Adela! You've been super helpful, have a good one!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •