Use a white-listed 3rd party Cordova Plugin with the Build Service that has no addon.

0 favourites
  • 4 posts
From the Asset Store
Helping streamers give their viewers more excitement.
  • LocalStorage is important for users of my C2 courseware app.

    I'm currently using NativeStorage in C2 runtime to bridge storage from Canvas+ (to get my users off of Canvas+ death and put their data in WkWebview storage). This method works great with C2 Runtime. I add the plugin to config.xml and add a few script lines to index.html which passes data to C2 functions.

    I have to get this plugin working in C3 Runtime now, using the build service. If I compile a C3 Cordova project, add NativeStorage as a plugin to config.xml, then send the archive to the build service via Export Manager, the build service returns a project without the plugin added. The plugin should be whitelisted as of this official request. I've also tried adding a spec tag with the version mentioned in that request. I probably am not using the right procedure.

    What is the correct procedure for using such a plugin with the build service?

    There is no NativeStorage addon I can find. I've just been adding the plugin to config.xml and a script block to index.html (with success).

    This all works in C3 runtime if I test with PhoneGap, but I can't deliver with PhoneGap because that service still won't build when the target platform is iOS 12, so I need to the use the build service. I'm doing this on both Android and iOS, but am talking iOS right now for simplicity.

    CloudStorage is scoped for the future but not until I get all data off of Canvas+.

    Thanks for reading! I look forward to your ideas. -Steve

  • Not sure if this will be helpful, but this is how I added "cordova-plugin-facebook4" plugin to my app for game analytics:

    Add the following lines to config.xml
    
    <plugin name="cordova-plugin-facebook4" >
     <variable name="APP_ID" value="1234567890" />
     <variable name="APP_NAME" value="App name here" />
     <variable name="FACEBOOK_ANDROID_SDK_VERSION" value="4.40.0" />
    </plugin>
    
    
    Add to config.json in "plugins" section:
    
    {
    	"id": "cordova-plugin-facebook4",
    	"version": null,
    	"variables": [["APP_ID", "1234567890"], ["APP_NAME", "App name here"], ["FACEBOOK_ANDROID_SDK_VERSION", "4.40.0"]]
    },
    
    

    Add files to zip and build with C3. If all done correctly you should be able to call methods from this plugin from scripts or with Browser Execute Javascript action. In my case:

    "facebookConnectPlugin.logEvent('event_name');"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Brilliant. Thank you so much for sharing that. The build service returned the project with the plugin! Now, to test the plugin.

  • Not sure if this will be helpful, but this is how I added "cordova-plugin-facebook4" plugin to my app for game analytics:

    > Add the following lines to config.xml
    
    <plugin name="cordova-plugin-facebook4" >
    <variable name="APP_ID" value="1234567890" />
    <variable name="APP_NAME" value="App name here" />
    <variable name="FACEBOOK_ANDROID_SDK_VERSION" value="4.40.0" />
    </plugin>
    
    
    Add to config.json in "plugins" section:
    
    {
    	"id": "cordova-plugin-facebook4",
    	"version": null,
    	"variables": [["APP_ID", "1234567890"], ["APP_NAME", "App name here"], ["FACEBOOK_ANDROID_SDK_VERSION", "4.40.0"]]
    },
    
    

    Add files to zip and build with C3. If all done correctly you should be able to call methods from this plugin from scripts or with Browser Execute Javascript action. In my case:

    "facebookConnectPlugin.logEvent('event_name');"

    github.com/EddyVerbruggen/cordova-plugin-taptic-engine

    I tried that with this one as well as I would like to add some sort if vibration to my game.

    After I built the xcode project with the clould service I've seen that the taptic engine plugin was added to the xcode src files.

    I tried to use Browser javascript function to use the function "TapticEngine.strongBoom();" but it does not work. Did I do anything wrong or do I need to do further steps to implement it? Would be nice if you could help on the case if you have some time :)

    Regards,

    Kraudi

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