Plugin loading order

Hello. Is it possible to load plugins in a certain order for a mobile app in OutSystems. There is an app in my client's service studio that needs to use an Airship plugin and Firebase plugin, both use Firebase. They need the Airship plugin to control the notifications that arrive at the app. At present, when the app is generated, I think that OutSystems loads the apps in alphabetical order. I would like to be able to say "load Firebase then Airship" in the app when generating. IS that possible?

Thank you

Pedro

mvp_badge
MVP

Hi Pedro,

A colleague of mine has figured this out recently, I asked him to reply.

Regards,

Daniel

Hello Pedro,

I needed to tackle a similar problem in the last few weeks. What worked for me is a dirty solution though, but as far as I know the only solution available in the platform if you don't want or not able to force order via dependencies in the Cordova plugin project itself.

In your extensibility configuration, you can reference more than one plugin.

Typically the JSON is like this:

{
    "plugin": {
        "url": ""
    }
}

But you can change it to be an array of plugins:

{  
    "plugins" :[
        {
            "resource": ""
        },{
            "url": ""
        },{
            "identifier": ""
        }
    ]
}

I've only applied this to an app with limited plugins though, but observing the MABS build log I see that the order that I specified in the 'plugins' array is always respected.

You can use Lifetime to override the default Extensibility of a module, so if you use Forge plugins you do not need to change the module code. Just simply override the JSON of the related plugins in LT.


Cheers,

Rob

Hi Rob,

The issue I am having is not with cordova plugins but with OutSystems wrapper plugins to use the Cordova plugins. Is there a way to alter the order of dependencies (OutSystems wrapper plugins) that are loading when generating a build?

Thanks

Pedro

I understand the issue. I had the same issue, also with firebase and a similar third party Cordova plugin used for messaging. 

The solution/workaround is manipulating the extensibility configuration JSON of the Outsystems wrapper module like I mentioned in my first comment. You can put the array of plugins in your end user module for example, and override the Outsystems plugin wrapper's extensibility configuration by an empty JSON via lifetime before building (so that you do not need to drop it from the Outsystems wrapper module itself and the plugin is still reusable by other teams/projects).


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.