Advanced
Location Tracking
Smartech SDK allows the user to track location using setUserLocation()
method which takes context, Latitude and Longitude as parameters.
NOTE:
Data type of Latitude and Longitude should be double.
Smartech.setUserLocation(LATITUDE_DOUBLE_VALUE, LONGITUDE_DOUBLE_VALUE);
// Sample code for reference purpose only
Smartech.setUserLocation(19.0760, 72.8777);
GDPR Compliance
Smartech believes privacy is a fundamental human right, which is why Smartech SDK has optOut()
method, once called will stop tracking user's events, displaying of In-App Messages and receiving push notifications sent from the panel.
Opt-Out From Tracking
To opt-out of tracking call the optOut()
method by passing true
value. Once you have opted out of tracking you need to explicitly opt-in, until opted in no communication will happen with the panel.
Smartech.optOut(true);
Opt-In For Tracking
To opt-in for tracking, call the optOut()
method by passing false
value.
Smartech.optOut(false);
Opt Tracking
To opt-out of tracking call the optTracking()
method by passing false
value. Once you have opted out of tracking you need to explicitly opt-in, until opted in no communication will happen with the panel. To opt-in for tracking, call the optTracking()
method by passing true
value.
Smartech.optTracking(true);
For checking whether user has opted out of Tracking or not, we can use below method.
Smartech.hasOptedTracking(function (response) {
console.log("status :" + response);
});
Opt Push Notifications
Smartech SDK has optPushNotification() method to opt-in or opt-out for Push Notifications sent from the panel.
Passing false in the parameter will opt-out for Push Notifications. For opt-in pass true in the parameter.
Smartech.optPushNotification(true);
For checking whether user has opted out of Push Notifications or not, we can use below method.
Smartech.hasOptedPushNotification(function (response) {
console.log("status :" + response);
});
Opt In-App Messages
To opt-in or opt-out In-App messages sent from the panel, SDK provides optInAppMessage() method. Passing false in the parameter will opt-out for In-App messages. To opt-in again pass true in the parameter.
Smartech.optInAppMessage(true);
For checking whether user has opted out of InApp or not, we can use below method.
Smartech.hasOptedInAppMessage(function (response) {
console.log("status :" + response);
});
Get GUID
To get the GUID which is used by Smartech SDK to identify the user, you can call the getGUID()
method.
Smartech.getGUID(function(response){
//Grab the response
}, function(error){
});
Updated over 3 years ago