It should work by following the same instructions I have provided in this answer, just adjusted to yours.
Note: The same warnings I have written there apply here as well. Namely: on each build performed in MobileFirst Studio the file cordova_plugins.js is being re-generated, thus you will lose the required changes that you will perform in this file, and you will be required to re-do them over and over again.
One possible solution to that is to upgrade to the soon-to-be released MobileFirst Platform Foundation 7.1, which introduces support for another class of application type - Cordova applications, with MobileFirst SDK integrated as a plug-in, thus enabling you to use Cordova Plug-man (or any other method) to install 3rd party plug-ins as you would in any Cordova-based application. Cordova Plug-man is not supported in releases prior to 7.1. Otherwise, you'll just have to find build hacks around it.
Studio
config.xml
- Add the plug-in declaration to your-app\iphone\native\config.xml
index.html
Add the following to the header
element:
<script type="text/javascript" src="js/SSLCertificateChecker.js"></script>
SSLCertificateChecker.js
Make sure to place the SSLCertificateChecker.js file in the your-app\common\js folder.
Edit the file.
Build
- Build the project in MobileFirst Studio and open it in Xcode
Xcode
In Build Phases add the required Security.framework (but it will most likely already be there)
Right-click on the project root folder, select "Add Files to..." and copy over the provided .h and .m files
Navigate to native\www\default\worklight\cordova_plugins.js and add the following. This is also the file you will have to re-edit each time you make a build in MobileFirst Studio...
{
"file": "../js/SSLCertificateChecker.js",
"id": "nl.x-services.plugins.SSLCertificateChecker",
"clobbers": [
"window.plugins.sslCertificateChecker"
]
},
Run on iOS Simulator or device.