public void InitializeExactTarget(UIApplication application, NSDictionary launchOptions) { /* * successful = [[ETPush pushManager] configureSDKWithAppID:kETAppID_Debug * andAccessToken:kETAccessToken_Debug * withAnalytics:YES * andLocationServices:NO * andProximityServices:NO * andCloudPages:YES * withPIAnalytics:YES * error:&error]; */ var successful = ETPush.PushManager().ConfigureSDKWithAppID( kETAppID_Debug, kETAccessToken_Debug, true, false, false, true, true, out NSError error ); if (!successful || error != null) { var alertViewController = UIAlertController.Create("Failed to configure ExactTarget", error?.Description, UIAlertControllerStyle.Alert); alertViewController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); Window.RootViewController.PresentViewController(alertViewController, true, null); } else { /* * [[ETPush pushManager] registerUserNotificationSettings:settings]; * [[ETPush pushManager] registerForRemoteNotifications]; * * [[ETPush pushManager] setOpenDirectDelegate:self]; * [[ETPush pushManager] setCloudPageWithAlertDelegate:self]; * * [[ETPush pushManager] applicationLaunchedWithOptions:launchOptions]; */ var notificationSettings = UIUserNotificationSettings.GetSettingsForTypes( UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, null ); ETPush.PushManager().RegisterUserNotificationSettings(notificationSettings); ETPush.PushManager().RegisterForRemoteNotifications(); openDirectDelegate = new ETOpenDirectDelegate(); cloudPageDelegate = new ETCloudPageWithAlertDelegate(); ETPush.PushManager().OpenDirectDelegate = openDirectDelegate; ETPush.PushManager().CloudPageWithAlertDelegate = cloudPageDelegate; ETPush.PushManager().ApplicationLaunchedWithOptions(launchOptions); } }
public override void PerformFetch(UIApplication application, System.Action <UIBackgroundFetchResult> completionHandler) { ETPush.PushManager().RefreshWithFetchCompletionHandler(completionHandler); }
public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, System.Action <UIBackgroundFetchResult> completionHandler) { ETPush.PushManager().HandleNotification(userInfo, application.ApplicationState); completionHandler?.Invoke(UIBackgroundFetchResult.NoData); }
public override void HandleAction(UIApplication application, string actionIdentifier, NSDictionary remoteNotificationInfo, System.Action completionHandler) { ETPush.PushManager().HandleNotification(remoteNotificationInfo, application.ApplicationState); completionHandler?.Invoke(); }
public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo) { ETPush.PushManager().HandleNotification(userInfo, application.ApplicationState); }
public override void ReceivedLocalNotification(UIApplication application, UILocalNotification notification) { ETPush.PushManager().HandleLocalNotification(notification); }
public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error) { ETPush.PushManager().ApplicationDidFailToRegisterForRemoteNotificationsWithError(error); }
public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken) { ETPush.PushManager().RegisterDeviceToken(deviceToken); }
public override void DidRegisterUserNotificationSettings(UIApplication application, UIUserNotificationSettings notificationSettings) { ETPush.PushManager().DidRegisterUserNotificationSettings(notificationSettings); }