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);
            }
        }
Esempio n. 2
0
 public override void PerformFetch(UIApplication application, System.Action <UIBackgroundFetchResult> completionHandler)
 {
     ETPush.PushManager().RefreshWithFetchCompletionHandler(completionHandler);
 }
Esempio n. 3
0
        public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, System.Action <UIBackgroundFetchResult> completionHandler)
        {
            ETPush.PushManager().HandleNotification(userInfo, application.ApplicationState);

            completionHandler?.Invoke(UIBackgroundFetchResult.NoData);
        }
Esempio n. 4
0
        public override void HandleAction(UIApplication application, string actionIdentifier, NSDictionary remoteNotificationInfo, System.Action completionHandler)
        {
            ETPush.PushManager().HandleNotification(remoteNotificationInfo, application.ApplicationState);

            completionHandler?.Invoke();
        }
Esempio n. 5
0
 public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo)
 {
     ETPush.PushManager().HandleNotification(userInfo, application.ApplicationState);
 }
Esempio n. 6
0
 public override void ReceivedLocalNotification(UIApplication application, UILocalNotification notification)
 {
     ETPush.PushManager().HandleLocalNotification(notification);
 }
Esempio n. 7
0
 public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error)
 {
     ETPush.PushManager().ApplicationDidFailToRegisterForRemoteNotificationsWithError(error);
 }
Esempio n. 8
0
 public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
 {
     ETPush.PushManager().RegisterDeviceToken(deviceToken);
 }
Esempio n. 9
0
 public override void DidRegisterUserNotificationSettings(UIApplication application, UIUserNotificationSettings notificationSettings)
 {
     ETPush.PushManager().DidRegisterUserNotificationSettings(notificationSettings);
 }