Skip to content

Implementing the MDXNetwork Explicit SDK into your application

To implement the MDXNetwork Explicit SDK into your application, do the following:

  1. Add MdxCore.framework, MdxNetwork.framework and CitrixLogger.framework to your project. On the project properties, under the General tab, add all 3 frameworks listed above to the Embedded Binaries section.
  2. On the project properties under the Info tab, add a new URL Type with URL Scheme which starts with com.citrix.sso.[uniquename].
  3. On the project properties under the Build Settings tab set Enable BitCode to No
  4. On the project properties under Capabilities tab set Keychain Sharing to On
  5. Add com.citrix.mdx to the list of Keychain Groups
  6. Import <MdxNetwork/MdxNetwork.h> and <MdxCore/MdxCore.h> into your AppDelegate.m file.

    //
    //  AppDelegate.m
    //  Your App Name here
    //
    //  Created by Your Name Here on 3/21/19.
    //  Copyright © 2019 Your Company Name Here, LLC. All rights        reserved.
    //
    
    #import "AppDelegate.h"
    #import <MdxCore/MdxCore.h>
    #import <MdxNetwork/MdxNetwork.h>
    
  7. In your AppDelegate.mfile, override [AppDelegate application: openURL: options:] call so that it calls MdxConfigManager in the following manner:

    - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
    {
        return [MdxConfigManager application:app openURL:url options:options];
    }
    
  8. Still in the AppDelegate.m in your application didFinishLaunchingWithOptions add a call to [SmartNetwork initializeSmartNetwork].

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
    {
        // Override point for customization after application launch.
        [SmartNetwork initializeSmartNetwork];
        return YES;
    }
    
  9. Back on the project properties under the Build Phases tab add a new Run Script phase with the following script.

    # Type a script or drag a script file from your workspace to insert its path.
    export STOREURL="http://www.citrix.com"
    export APPTYPE="sdkapp"
    export PACKAGEID="" #Please run uuidgen at the command line and paste the output value in the PACKAGEID variable
    export APPIDPREFIX="" #Your apple developer team ID - NPB9J4KRXA
    export TOOLKIT_DIR="$PROJECT_DIR/Frameworks/MdxCore.framework"
    #Ensure that the TOOLKIT_DIR property points to the location where the MdxCore.framework resides. The default is the Frameworks folder in your project.
    if [ -z "${PACKAGEID}" ]
    then
    echo "PACKAGEID variable was not found or was empty, please run uuidgen at the command line and paste the output value in the PACKAGEID variable in your post build script."
    exit 1
    else
    "$TOOLKIT_DIR/CGAppCLPrepTool" SdkPrep -in "$CONFIGURATION_BUILD_DIR/$EXECUTABLE_FOLDER_PATH" -out "$CONFIGURATION_BUILD_DIR/$EXECUTABLE_NAME.mdx" -storeURL "${STOREURL}" -appType "${APPTYPE}" -packageId "${PACKAGEID}" -entitlements "$SRCROOT/$PROJECT/$PROJECT.entitlements" -appIdPrefix "${APPIDPREFIX}" -minPlatform "9.0"
    fi
    
  10. Ensure that you run uuidgen command in your command line and paste the newly generated uuid in the PACKAGEID field.

  11. Ensure that you put your app id prefix in the APPIDPREFIX field. This ID can be found in the Apple Developer portal under the AppIDs section. This is usually the team ID but it can be different.
  12. Ensure that the TOOLKIT_DIR property points to the location where the MdxCore.framework resides. The default is the Frameworks folder in your project.

Note

You are required to have Icons set up for your app. And in particular your a 60x60 icon (this is your 20x20@3x icon) must be in a PNG format and must be named "AppIcon60x60.png"