Converting plugins to C3 runtime...

  • I am trying convert my extended version of the social media plugin to use the C3 runtime, but having no luck.

    I have converted it so that it all loads up, runs without any errors.

    However, when i test it and call one of the actions, the iOS app just "flashes" and does not work.

    I have replaced the action to show an alert and this works fine so it is obviously something to do with accessing the cordova social share plugin.

    EDIT: Please see code in below post...

    Andy

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just to add to this, and to be clear on what I am doing.

    I have a plugin which I have developed.

    The c2 runtime action is as follows (and works perfectly):

     Acts.prototype.SaveImage = function (url)
    	{
    		 var exists = window["plugins"] && window["plugins"]["socialsharing"] && window["plugins"]["socialsharing"]["saveToPhotoAlbum"];
    		if (exists)
    			window["plugins"]["socialsharing"]["saveToPhotoAlbum"](url);
    	};

    I have converted the plugin to c3 runtime and put this action as follows:

    SaveImage(url)
     {
     var exists = window["plugins"] && window["plugins"]["socialsharing"] && window["plugins"]["socialsharing"]["saveToPhotoAlbum"];
     if (exists)
     window["plugins"]["socialsharing"]["saveToPhotoAlbum"](url);
     }

    Yet it does not work, so what changes for c3 runtime are required in order to get it work?

    If i change above C3 runtime action to this:

    SaveImage(url)
     {
     alert(url);
     }

    it works.

    Full code and plugin is here:

    github.com/andygilbert/construct-save-share-image

    Uncomment runtime line in plugin.js to try on c3 runtime.

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