From fbf7f862a50af8f77aaabcfa51d7c82e305fb59b Mon Sep 17 00:00:00 2001 From: David Laird Date: Thu, 3 Feb 2022 14:46:19 -0500 Subject: [PATCH 1/3] Remove subscription to containment notifications, so containment toast alerts appear by default. --- SimpleBrowserApp/AppDelegate.m | 45 +++------------------------------- 1 file changed, 4 insertions(+), 41 deletions(-) diff --git a/SimpleBrowserApp/AppDelegate.m b/SimpleBrowserApp/AppDelegate.m index 2a200bb..53569ec 100644 --- a/SimpleBrowserApp/AppDelegate.m +++ b/SimpleBrowserApp/AppDelegate.m @@ -30,16 +30,15 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( { [self handleNetworkNotification:notification]; } - else if([[notification Source] isEqualToString:CTXMAMNotificationSource_Containment]) - { - [self handleContainmentNotification:notification]; - } else { // Handle any other unhandled notifications } }; - [[CTXMAMNotificationCenter mainNotificationCenter] registerForNotificationsFromSource:CTXMAMNotificationSource_All usingNotificationBlock:notificationHandler]; + + [[CTXMAMNotificationCenter mainNotificationCenter] registerForNotificationsFromSource:CTXMAMNotificationSource_Core usingNotificationBlock:notificationHandler]; + [[CTXMAMNotificationCenter mainNotificationCenter] registerForNotificationsFromSource:CTXMAMNotificationSource_Network usingNotificationBlock:notificationHandler]; + [CTXMAMCore setDelegate:self]; [CTXMAMCore initializeSDKsWithCompletionBlock:^(NSError * _Nullable nilOrError) { @@ -84,42 +83,6 @@ - (void)applicationWillTerminate:(UIApplication *)application { [CTXMAMCore logoffApp]; } -#pragma mark - Containment SDK -- (void) handleContainmentNotification:(CTXMAMNotification *)notification -{ - switch(notification.Error.code) { - case CTXAlertAppContainment_GEOFENCE_LocationServicesRequired : - case CTXAlertAppContainment_GEOFENCE_OutsideOfAcceptedArea : - // For these events, usage of the app may be restricted. They will be handled by delegate callback. - break; - case CTXAlertAppContainment_None : - case CTXAlertAppContainment_DISABLECOPY : - case CTXAlertAppContainment_DISABLEPASTE : - case CTXAlertAppContainment_DISABLEOPENIN : - case CTXAlertAppContainment_DISABLEICLOUD_FM : - case CTXAlertAppContainment_DISABLEICLOUD_KC : - case CTXAlertAppContainment_DISABLEPRINTING : - case CTXAlertAppContainment_DISABLECAMERA : - case CTXAlertAppContainment_DISABLEPHOTOLIBRARY : - case CTXAlertAppContainment_DISABLESMS : - case CTXAlertAppContainment_DISABLELOCATION : - case CTXAlertAppContainment_DISABLEMIC : - case CTXAlertAppContainment_DISABLE_SOCIAL_MEDIA : - case CTXAlertAppContainment_INBOUNDDOCEX : - case CTXAlertAppContainment_SECUREMAIL_NotInstalled : - case CTXAlertAppContainment_SECUREMAIL_Upgrade : - case CTXAlertAppContainment_MAILBLOCKED : - case CTXAlertAppContainment_Unknown : - { - // For these events, just display a notification - NSString *alertMsg = [notification Message]; - NSLog(@"CTXMAM Containment Notification: [%@]", alertMsg); - [self showAlertMsg:alertMsg isFatal:NO]; - } - break; - } -} - #pragma mark - Network SDK - (void) handleNetworkNotification:(CTXMAMNotification *)notification { From f66bfb05fecde57d7ad16be7a3e1c4b6975cdd24 Mon Sep 17 00:00:00 2001 From: David Laird Date: Thu, 3 Feb 2022 16:43:36 -0500 Subject: [PATCH 2/3] Update AppDelegate.m --- SimpleBrowserApp/AppDelegate.m | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/SimpleBrowserApp/AppDelegate.m b/SimpleBrowserApp/AppDelegate.m index 53569ec..03c1cae 100644 --- a/SimpleBrowserApp/AppDelegate.m +++ b/SimpleBrowserApp/AppDelegate.m @@ -18,26 +18,16 @@ @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. - - CTXMAMNotificationEventBlock notificationHandler = ^(CTXMAMNotification * _Nonnull notification) - { - //Do something with the notification - if([[notification Source] isEqualToString:CTXMAMNotificationSource_Core]) - { - //Do something; - } - else if([[notification Source] isEqualToString:CTXMAMNotificationSource_Network]) - { - [self handleNetworkNotification:notification]; - } - else - { - // Handle any other unhandled notifications - } - }; - [[CTXMAMNotificationCenter mainNotificationCenter] registerForNotificationsFromSource:CTXMAMNotificationSource_Core usingNotificationBlock:notificationHandler]; - [[CTXMAMNotificationCenter mainNotificationCenter] registerForNotificationsFromSource:CTXMAMNotificationSource_Network usingNotificationBlock:notificationHandler]; + [[CTXMAMNotificationCenter mainNotificationCenter] registerForNotificationsFromSource:CTXMAMNotificationSource_Core + usingNotificationBlock:^(CTXMAMNotification * _Nonnull notification) { + NSLog(@"%@", [notification Message]); + }]; + + [[CTXMAMNotificationCenter mainNotificationCenter] registerForNotificationsFromSource:CTXMAMNotificationSource_Network + usingNotificationBlock:^(CTXMAMNotification * _Nonnull notification) { + [self handleNetworkNotification:notification]; + }]; [CTXMAMCore setDelegate:self]; From 091402325b8ac0c763756950cafaa43f47c73a29 Mon Sep 17 00:00:00 2001 From: David Laird Date: Thu, 10 Feb 2022 10:02:14 -0500 Subject: [PATCH 3/3] Add ipa into mdx script --- SimpleBrowserApp.xcodeproj/project.pbxproj | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/SimpleBrowserApp.xcodeproj/project.pbxproj b/SimpleBrowserApp.xcodeproj/project.pbxproj index 9b88acb..9300469 100644 --- a/SimpleBrowserApp.xcodeproj/project.pbxproj +++ b/SimpleBrowserApp.xcodeproj/project.pbxproj @@ -293,6 +293,7 @@ 6E3D0A3A2243E0240096198B /* Resources */, 6EFD6BF42244286D00E023D8 /* Embed Frameworks */, 6E3D0A7D22440BE30096198B /* Create MDX File */, + 24D4139327B55D5D006653D0 /* Embed IPA Into MDX */, ); buildRules = ( ); @@ -429,6 +430,24 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 24D4139327B55D5D006653D0 /* Embed IPA Into MDX */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Embed IPA Into MDX"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Type a script or drag a script file from your workspace to insert its path.\nexport TOOLKIT_DIR=\"$PROJECT_DIR/Tools\"\nexport IPA_FILE_PATH=\"\"\n\nif [ -z \"${IPA_FILE_PATH}\" ]\nthen\n echo \"IPA_FILE_PATH variable was not found or was empty. If you wish to embed an IPA into the MDX, please generate an IPA and paste the full path, including the .ipa, into the IPA_FILE_PATH variable in the \\\"Embed IPA Into MDX\\\" post build script in \\\"Build Phases\\\".\"\n exit 0\nfi\n\n\"$TOOLKIT_DIR/CGAppCLPrepTool\" SetInfo -in \"$CONFIGURATION_BUILD_DIR/$EXECUTABLE_NAME.mdx\" -out \"$CONFIGURATION_BUILD_DIR/$EXECUTABLE_NAME-exported.mdx\" -embedBundle \"${IPA_FILE_PATH}\"\n"; + }; 6E3D0A7D22440BE30096198B /* Create MDX File */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647;