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);
Get GUID
To get the GUID that is used by Smartech SDK to identify the user, you can call the getGuid()
method.
Smartech.getGuid(function(response){
//Grab the response
}, function(error){
});
To Fetch Advertising Id
If an app wants to fetch Advertising Id of the device using Smartech SDK, follow the steps below.
Adding Dependency
implementation 'com.google.android.gms:play-services-ads:17.2.1'
Adding Meta tags
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="YOUR_ADMOB_APP_ID"/>
<meta-data
android:name="SMT_USE_AD_ID"
android:value="1_OR_0_VALUE"/>
Note:
- To get "AdMob App ID" please refer this: https://developers.google.com/admob/android/quick-start
- This tag accepts either ‘0’ or ‘1’ as value. If an app wants Smartech SDK to fetch Advertising Id of the device, use ‘1’ as value otherwise use '0'.
Updated about 4 years ago