Class Veery

activate(service : Int)

Turn the Veery agent into the geolocation mode required by your application (foreground, background, geo-predictive, ...).

If not called, the geolocation (and the Veery agent) will remain inactive.

From Veery for iOS version 1.4.0 you can replace the call to "activate" by a call to activateWithOptin

Parameters

Param name Type Usage
mode int Veery.DEACTIVATE_ALL : Veery will turn off as well as the geolocation proceses.
Veery.FOREGROUND_GEOLOC : Veery will turn on with geolocation active only when the app is in foreground. (Requires IOS Veery 1.3.3 or higher)
Veery.BACKGROUND_GEOLOC : Veery will turn on with geolocation active also when the app is in background. (Requires IOS Veery 1.3.3 or higher)
Veery.COLLECT : Veery will be connected to the backend for historization. (Requires IOS Veery 1.3.3 or higher)
Veery.ROUTE_MATCH : Veery will receive trips computations. (Requires IOS Veery 1.3.3 or higher)
Veery.POINT_OF_INTEREST : Veery will receive Point of interest. (Requires IOS Veery 1.3.3 or higher)
Veery.PREDICTION : Veery will receive Predictions. (Requires IOS Veery 1.3.3 or higher)
------------------- BACKWARD COMPATIBILITY (older than IOS Veery 1.3.3)
Veery.FOREGROUND : This is equivalent to Veery.FOREGROUND_GEOLOC
Veery.BACKGROUND : This is equivalent to Veery.BACKGROUND_GEOLOC
Veery.BACKEND : This is equivalent to BACKGROUND + Veery.COLLECT + Veery.ROUTE_MATCH
Veery.GEOPROFILE : This is equivalent to BACKEND + Veery.POINT_OF_INTEREST + Veery.PREDICTION

Note

If Backend Services is requested without Geolocation mode the Veery.BACKGROUND_GEOLOC is used by default.

Returns

Void

Usage / Example

    class ViewController: UIViewController, VeeryDelegate {// Implement Veery Delegate

        // TODO : Inside the principal class (!!not inside a function)
        let veery = Veery()

        override func viewDidLoad() {
            super.viewDidLoad()
            // TODO : Init the delegate
            veery.delegate = self
            // TODO : declare your API Key Secret
            veery.setApiKeySecret("SuPeRScrET12345789GhJ")

            // TODO : Activate the required function levels (user will be requested to accept geolocation)
            //veery.activate(service: Veery.GEOPROFILE)
    // Requires ios veery 1.3.3
    veery.activate(service: Veery.BACKGROUND_GEOLOC |
                Veery.COLLECT |
                Veery.ROUTE_MATCH |
                Veery.POINT_OF_INTEREST |
                Veery.PREDICTION)

            //OR
            veery.activate(service: Veery.BACKGROUND_GEOLOC +
             Veery.COLLECT +
             Veery.ROUTE_MATCH +
             Veery.POINT_OF_INTEREST +
             Veery.PREDICTION)

            // .......

        }
    }

User interaction

Veery.Forground and Higher : if not previously given by the user, it will request the necessary authorization to get Geolocation iosAuthorization

Veery.BACKEND and Higher : if not previsously given by the user, it will request the necessary authorization to use Notifications.