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

GDPR Compliance

Smartech believes that privacy is a fundamental human right, which is why Smartech SDK has optOut method, once called by passing true as parameter 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 Smartech panel.

[[Smartech sharedInstance] setOptOutStatus:true];
Smartech.sharedInstance().setOptOutStatus(true)

Opt-In From Tracking

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

[[Smartech sharedInstance] setOptOutStatus:false];
Smartech.sharedInstance().setOptOutStatus(false)

Get GUID or Device token & Log Device Push Token

If you need any additional information like device push token or device GUID you can implement the following methods, also to print device push token you can check in the following methods.

[[NetCoreSharedManager sharedInstance] getDevicePushToken];
[[NetCoreSharedManager sharedInstance] getDeviceGuid];

//To print device push token use following method
[[NetCoreSharedManager sharedInstance] printDevicePushToken];
Smartech.sharedInstance().getDevicePushToken()
Smartech.sharedInstance().getDeviceGuid()

//To print device push token use following method
Smartech.sharedInstance().printDevicePushToken()

What is universal link and how to configure it

Universal Links are standard web links (https://mydomain.com) that point to both a web page and a piece of content inside an app. When a Universal Link is opened, iOS checks to see if any installed app is registered for that domain. You can follow this link to configure the Universal link.

Handling Deep Link and Custom Payload

To handle deep links or custom payload you need to implement a delegate method of SmartechDelegate. The function name is handleDeeplinkActionWithURLString:andCustomPayload.
Implement the SmartechDelegate and confirm the protocol of it.

You need to implement the delegate

@interface AppDelegate () <UNUserNotificationCenterDelegate, SmartechDelegate>

@end
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate, SmartechDelegate {

}

Implement the delegate method in AppDelegate

- (void)handleDeeplinkActionWithURLString:(NSString *)deepLinkURLString andCustomPayload:(NSDictionary *)customPayload {
  NSLog(@"Netcore: Deeplink: %@",deepLinkURLString);
  NSLog(@"Netcore: Custom Payload: %@",customPayload);
}
func handleDeeplinkAction(withURLString deepLinkURLString: String, andCustomPayload customPayload: [AnyHashable : Any]?) {
  print(deepLinkURLString)
  print(customPayload ?? [:])
}