Adding objective C API methods will allow you to call them like so:
forge.internal.call('my_module.my_method', {my_param: 2});
No JavaScript methods are generated for you, they're actually defined explicitly in module/javascript/module.js
. The default module.js
generated when making a module contains something like:
// Expose the native API to javascript
forge.my_module = {
showAlert: function (text, success, error) {
forge.internal.call('my_module.showAlert', {text: text}, success, error);
}
};
You should be able to add your APIs there. See https://trigger.io/docs/current/api/native_modules/adding_javascript.html for more details.