Generate 3rd party NFIs for iOS platform
Pre-requisites
- Get latest iOS NFI tool from Volt MX support team
- Python 3.9.6 on Mac machine
- GYP tool (can be generated using ./install.sh in NFI tool)
- Pre-compiled xcframework or native objective-c project that needs NFI conversion.
NFI tool Unzip
Unzip NFI tool received from Volt MX support team. It would look like below:
NFI Generation for third party framework
- A pre-compiled xcframework can be directly given as input to NFI tool.
- In case, we have native iOS Objective-c code we will have to generate a framework for the project for supported architectures(both simulator and device).
- Convert framework to xcframework with below command
Input for NFI tool
- If you are creating NFI framework for the first-time, open the terminal in the Scripts folder of the NFI tool, and enter the ./install.sh command to install the GYP tool.
Update contents of Config.plist
- config.plist file is an artifact that is part of the Scripts folder of NFI Generation Tool.
- Make sure SDK_DIR points to iPhoneOS SDK path by using
xcrun --sdk iphoneos --show-sdk-path
- SDK_VERSION: The iOS SDK Version in Xcode, using which the bindings are generated.
- TARGET_VERSION: The Minimum Deployment Target.
- Parameters of config.plist are as below:
Config.plist parameters for ThirdPartyBuildFrameworks
Parameter | Type | Value |
---|---|---|
Mode | String | XCFWKS |
ThirdPartyBuildHeaders | Array | Set of headers files in xcframework |
ThirdPartyBuildHeadersCommonPath | String | Folder path of the third party xcframework headers |
ThirdPartyRootDir | String | Path of the folder containing the third party xcframework |
enabled | Boolean | If set to Yes, JSBindings will be generated |
Example for Third Party framework parameters
- Consider below as your xcframework structure.
For above xcframework, third party framework parameters will be as below:
- Mode will be String – XCFWKS
- ThirdPartyBuildHeaders will be an array with 2 items. Logger.h and NFIDemoLogger.h
- ThirdPartyBuildHeadersCommonPath will be <path_before_xcframework>/DemoLogger.xcframework/ios-arm64/DemoLogger.framework/Headers
- ThirdPartyRootDir will be till <path_before_xcframework>
- Enabled should be to YES for generating JS Bindings. If there are multiple frameworks and you want to generate only one set YES for enabled to that one only, rest all should be set to NO.
Generate NFI framework
- Once required parameters are set, we can save config.plist file.
- Run below command on scripts folder using terminal to generate NFI framework.
python3 build_tp.pyc
Generated NFI Location
- On successful generation of NFI framework zip file will be available in products folder of NFI tool.
Whats Next
After successful generation of NFI, how to use NFI in VoltMX Iris can be followed here: