Silent SDK Commands

Get Location


Anytime you send the below frame from app.synerise.com, the SDK can send the SNRAppearedInLocationEvent event automatically.

"data": {
    "issuer": "Synerise",
    "message-type": "dynamic-content",
    "content-type": "silent-sdk-command",
    "content": {
        "class_name": "com.synerise.sdk.injector.Injector",
        "method_name": "GET_LOCATION",
        "method_parameters": []
    }
}

To enable this functionality, your application needs permission to use localization services.

Check Apple Developer Documentation - CoreLocation for details.

You also need to configure the following settings:

Synerise.settings.tracker.locationAutomatic = true

Custom Implementation

You can specify additional custom actions or send suitable event by yourself. You need to implement optional method from SNRTrackerDelegate.

//MARK: - TrackerDelegate

extension ApplicationController: TrackerDelegate {
	func snr_locationUpdateRequired() -> Void {
		// your custom code for Silent Localization Command
        // get your coordinates
        let latitude: CLLocationDegrees = CLLocationDegrees(0.0)
        let longitude: CLLocationDegrees = CLLocationDegrees(0.0)
        let location: CLLocation = CLLocation(latitude: latitude, longitude: longitude)

        let event: AppearedInLocationEvent = AppearedInLocationEvent(label: "LABEL", location: location)

        Tracker.send(event)
	}
}
Note: If you want to manage location command by yourself only - set Synerise.settings.tracker.locationAutomatic to false. Then, after a silent command is received, only your custom implementation is invoked.

Sign Out


Anytime you send the below frame from app.synerise.com, the SDK sign out the client.

"data": {
    "issuer": "Synerise",
    "message-type": "dynamic-content",
    "content-type": "silent-sdk-command",
    "content": {
        "class_name": "com.synerise.sdk.injector.Injector",
        "method_name": "SIGN_OUT",
        "method_parameters": []
    }
}

😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.