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

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

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