Can I call Cordova Plugins from my Scripts?

  • I found that there is a list of Cordova plugins here construct.net/en/forum/construct-3/plugin-sdk-10/build-server-cordova-plugin-149266

    But I read closely and it says 'whitelist', does it means that those are the ones allowed for AddOns development, are any of those included in the project?

    If they are can I call them from my scripts without having to create an AddOn?

    thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • What whitelist means is if you make a custom addon/plugin for c3 that uses a Cordova plugin - that is not already on the build service when you export your app you will need to build it in the cmd as you have to install the plugin so your game can use it - if it is whitelisted it means it is on the construct 3 build service so you can export through construct 3 and not have to build in the cmd.

  • Currently Cordova plugins are only included if a Construct addon requests it. The whitelist is designed for Construct plugins like a third-party ad service to include the Cordova plugin that handles the ads, and then the Construct plugin's actions can call the Cordova plugin.

    You could call a Cordova plugin directly from scripting, but currently there's no way to ask the build service to add the Cordova plugin you want unless you make a Construct addon. I guess adding Cordova plugins manually could be an interesting feature. One additional difficulty though is testing is quite tricky: you can only test Cordova code once it's built as an APK, and if it doesn't work you need to set up USB debugging to check what's going on. When you use an addon, the addon developer did all that work to test it and make sure it works, so generally you can trust that it'll just work. If you write your own code you'll have to go through that process yourself.

    You could experiment with this anyway without using the build service, by setting up your own local builds with the Cordova CLI, manually adding a new Cordova plugin to config.xml after export, and then building it, after which your JS code can then call the Cordova plugin. It's a pretty complicated process to go through though, especially if you're new to coding.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)