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.

[[NetCoreSharedManager sharedInstance] optOut:true];
NetCoreSharedManager.sharedInstance().optOut(true)

Opt-In From Tracking

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

[[NetCoreSharedManager sharedInstance] optOut:false];
NetCoreSharedManager.sharedInstance().optOut(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] getDeviceToken];
[[NetCoreSharedManager sharedInstance] getGUID];

//To print device push token use following method
[[NetCoreSharedManager sharedInstance] printDeviceToken];
NetCoreSharedManager.sharedInstance().getDeviceToken()
NetCoreSharedManager.sharedInstance().getGUID()

//To print device push token use following method
NetCoreSharedManager.sharedInstance().printDeviceToken()

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.

Configure Universal Link with Smartech

You need to pass the universal link value to the SDK that you have added in your Capabilities -> Associated Domains section Eg. applinks:https://www.netcoresmartech.com then enter only domain name as https://www.netcoresmartech.com, you can pass multiple domain names.

[[NetCoreSharedManager sharedInstance] setAssociateDomain:@[@"type-your-universal-link"]];
NetCoreSharedManager.sharedInstance()?.setAssociateDomain(["type-your-universal-link"]);

Handling Deep Link and Custom Payload

To handle deep links or custom payload you need to implement a delegate method of NetCorePushTaskManagerDelegate. The function name is handleSmartechDeeplink.
Implement the SmartechManagerDelegate and confirm the protocol of it.

You need to implement the delegate

@interface AppDelegate () <UNUserNotificationCenterDelegate, NetCorePushTaskManagerDelegate>

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

}

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 ?? [:])
}