Updated on 2023-03-23 GMT+08:00

Quick Integration

  1. Decompress all the downloaded software packages to obtain HWMUISDK for integration and HWMUISDKNativeDemo.

    Figure 1 Decompressed files

    AW_PortraitSDK.framework in HWMUISDK is used for background blurring. To integrate the background blurring function, contact Huawei sales personnel.

  2. Start the Xcode.
  3. Choose File > New > Project, choose App > Next, enter app information, and click Create to create a project.
  4. Add HWMUISDK.framework and OpenSourceIntegration.framework obtained in 1 to the project.

    Choose TARGETS > General. Then, change the value in the Embed column of HWMUISDK.framework to Embed & Sign.

    Figure 2 Effect after the adding

  5. Configure project files.

    1. Enable the sandbox configuration items. If the app is not to be released to the app store, the sandbox can be disabled.

      Set the values of the sandbox configuration item keys to true.

      com.apple.security.app-sandbox

      com.apple.security.device.audio-input

      com.apple.security.device.camera

      com.apple.security.files.user-selected.read-write

      com.apple.security.files.downloads.read-write

      com.apple.security.network.client

      com.apple.security.network.server
      Figure 3 Enabling sandbox configuration items

    2. In Build Settings, add the following two relative paths to Runpath Search Paths:

      @executable_path/../Frameworks

      @executable_path/../Frameworks/HWMUISDK.framework/Versions/A/Frameworks

      Figure 4 Adding configuration items to Runpath Search Paths
    3. In Build Phases, modify Run Script to provide the library re-signature and make it consistent with the app signature.

      cd "$BUILT_PRODUCTS_DIR"/

      # Replace xxxx with your app name.

      cd ./xxxx.app/Contents/Frameworks/

      echo "####### HWMUISDK.framework xattr #######"

      xattr -r -d com.apple.quarantine ./HWMUISDK.framework

      xattr -r -d com.apple.quarantine ./OpenSourceIntegration.framework

      echo "####### finish ###########"

      echo "####### HWMUISDK.framework codeSgin #######"

      codesign -f -s "$EXPANDED_CODE_SIGN_IDENTITY" --timestamp=none ./*.framework

      codesign -f -s "$EXPANDED_CODE_SIGN_IDENTITY" --timestamp=none ./HWMUISDK.framework/Versions/A/Frameworks/*.framework

      codesign -f -s "$EXPANDED_CODE_SIGN_IDENTITY" --timestamp=none ./HWMUISDK.framework/Versions/A/Frameworks/HWMNativeSDK.framework/Versions/A/Frameworks/WKTUP.framework/Versions/A/Frameworks/*.dylib

      codesign -f -s "$EXPANDED_CODE_SIGN_IDENTITY" --timestamp=none ./HWMUISDK.framework/Versions/A/Frameworks/HWMNativeSDK.framework/Versions/A/Frameworks/WKTUP.framework

      codesign -f -s "$EXPANDED_CODE_SIGN_IDENTITY" --timestamp=none ./HWMUISDK.framework/Versions/A/Frameworks/HWMNativeSDK.framework/Versions/A/Frameworks/WKTUP.framework/Versions/A/Frameworks/*.framework

      Figure 5 Modifying the library signature

    4. In the Info.plist file, configure the usage prompts (set the language as required) and the attributes related to exiting. The following keys need to be configured:
      • Privacy - Camera Usage Description (Camera usage prompt)
      • Privacy - Microphone Usage Description (Microphone usage prompt)

      • Application can be killed immediately when user is shutting down or logging out: Set it to NO.
      Figure 6 Info.plist configuration effect