As per the apple doc, we can create xcprivacy property file and add required keys and values to fix this issue.
Wednesday, March 20, 2024
Monday, March 4, 2024
Swift Rule Engine using Javascript for your iOS/MacOS application
In this way, we can keep the core business logic must be the same over multiple platform and can control without updating the application.
Form your app, you can pass values as parameters and the script can evaluate it and can return the result as plain text or JSON text if needed.
First load the script using scripRunner.loadWebViewWithScript(script), and we can invoke a function using scripRunner.evaluateFunction(fnName: "function")
See the example code of passing a contact object to a script function and that function validate the contact object and returning a json object with true or false value.
In this example, the loading of script content is done with onAppear and evaluating on the button click. In this way, we can do the load once and evaluate any times.
Subscribe to:
Posts (Atom)