Initialize Smartech SDK
- Import Smartech SDK in AppDelegate.m or AppDelegate class.
#import <NetCorePush/NetCorePush.h>
import NetCorePush
- Setup the Smartech App ID and App Group.
NSString *const kSmartechAppID = @"APP ID THAT YOU GET FROM SMARTECH PANEL";
NSString *const kAppGroup = @"group.com.yourcompanyname.productname";
let kSmartechAppID = "APP ID THAT YOU GET FROM SMARTECH PANEL"
let kAppGroup = "group.com.yourcompanyname.productname"
- Call method to initialize Smartech SDK in didFinishLaunchingWithOptions
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//...
[[NetCoreSharedManager sharedInstance] setUpAppGroup:kAppGroup];
[[NetCoreSharedManager sharedInstance] handleApplicationLaunchEvent:launchOptions forApplicationId:kSmartechAppID];
if (@available(iOS 10.0, *)) {
[UNUserNotificationCenter currentNotificationCenter].delegate = self;
}
[NetCorePushTaskManager sharedInstance].delegate = (id)self;
//...
return YES;
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions:[UIApplication.LaunchOptionsKey: Any]?) -> Bool {
//...
NetCoreSharedManager.sharedInstance().setUpAppGroup(kAppGroup)
NetCoreSharedManager.sharedInstance().handleApplicationLaunchEvent(launchOptions, forApplicationId: kSmartechAppID)
NetCorePushTaskManager.sharedInstance().delegate = self
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self
}
//...
return true
}
Updated over 4 years ago