These docs are for v1.0. Click to read the latest docs for v2.0.

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.

NetcoreSDK.setUserLocation(LATITUDE_DOUBLE_VALUE,  LONGITUDE_DOUBLE_VALUE);

// Sample code for reference purpose only
NetcoreSDK.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.

NetcoreSDK.optOut(true);

Opt-In For Tracking

To opt-in for tracking, call the optOut() method by passing false value.

NetcoreSDK.optOut(false);

Get GUID

To get the GUID which is used by Smartech SDK to identify the user, you can call the getGUID() method.

NetcoreSDK.getGUID()
    .then(value => {
   	//Grab the value
    }).catch(reason => console.log(reason));

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:

  1. To get "AdMob App ID" please refer this: https://developers.google.com/admob/android/quick-start
  2. 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'.

Implementing Deeplink In The React Native (Android)

To implement deeplink, follow the steps below:
Let's suppose that we want a URI like smartech://home
1. First, add given snippet inside AndroidManifest.xml file within the Activity Tag.

<intent-filter>
	<action android:name = "android.intent.action.VIEW"/>
	<category android:name = "android.intent.category.DEFAULT"/>
	<category android:name = "android.intent.category.BROWSABLE"/>
	<data android:scheme = "<scheme>"/>
</intent-filter>

// Sample code for reference purpose only
<intent-filter>
	<action android:name= "android.intent.action.VIEW"/>
	<category android:name= "android.intent.category.DEFAULT"/>
	<category android:name= "android.intent.category.BROWSABLE"/>
	<data android:scheme = "smartech"/>
</intent-filter>

2. Provide path in your navigator.

const AppNavigator = createStackNavigator({
  HomeScreen: { screen: Home, path: 'home'}
});