Hello!Basically, I`m trying to figure out how can I integrate my android SDK distributed as an aar file (+ transitive dependencies in build.gradle) into the app built with OutSystems.As I understood after long search - the idea is:
- wrap the aar file into a cordova plugin (+check it with the stab application to be sure it works OK)
- wrap the cordova plugin by OutSystems plugin (adding the cordova plugin as the zip file)
- add implemented OutSystems plugin to my test android application project
Many related tutorials and articles from teh Forum we checked:
- Using Cordova Plugins o10
- Using Cordova Plugins 011
- How to create a Cordova plugin and add it to your mobile app
etc.
I already have some experience in integration like the mentioned plan around 5 years ago - I have backup file. But today it doesn`t work.
Anyway I decided to start with the tutorial and repeat "How to create a Cordova plugin and add it to your mobile app" with just one difference - the ToastyPlugin (cordova) will be integrated into ToastyPlugin (OutSystems) as a zip file. There is an example of the zip file connecting in the "Using Cordova plugins" tutorial.
After creating plugins and integrating it into the stab OutSystems application, I have a buggy behaviour - the toast doesn`t use the message text specified on the application level. the toast appears with the two letters instead - same as the stab app abbreviation.
In case, I specify the message text on the OutSystems plugin level, it appears OK. But who needs hardcoded text toast - we need it dynamically.
I beleive the issue somehow related to the way I added the cordova plugin to the outsystems plugin. Toast Plugin from forge works well - I tested.
Please provide any recommendations, tutorials for the described bug; Is there any limitations with adding a zip plugin to the OutSystems plugin? Reccomendations for integrating the aar file into the android app built with OutSystems?!
Thanks in advance!
@Eugene Poplavskiy : It's possible that the backup of the plugin which you have has an hard coded value and hence irrespective of the input its giving a fixed value. You may share the backup file and some one could try to reproduce the issue.
btw if you are looking for a Toast Plugin, one is available in Forge at https://www.outsystems.com/forge/component-overview/1818/toast-plugin-o11 and you may look into how this is implemented.
Update:
```After creating plugins and integrating it into the stab OutSystems application, I have a buggy behaviour - the toast doesn`t use the message text specified on the application level. the toast appears with the two letters instead - same as the stab app abbreviation.
In case, I specify the message text on the OutSystems plugin level, it appears OK. But who needs hardcoded text toast - we need it dynamically. ```
Resolution:
This issue was caused by my misunderstanding of the tutorial wording.
In paragraph 8 (“Add Message and DurationText as arguments to TemplateJSAction”), I initially understood Message to mean a literal text value.
In reality, it refers to adding input parameters (Message, DurationText) to the JavaScript Action and passing those variables through to the Cordova plugin.
Because of this, the runtime message was not being passed correctly, which resulted in the toast showing the app abbreviation instead of the expected text.
After correctly defining Message as an input parameter and using it in the JavaScript action, the toast works as expected with dynamic text.
If possible, I’d kindly suggest updating the tutorial to clarify this point. Adding a small screenshot of the TemplateJSAction inputs configuration (showing Message and DurationText as input parameters) could help avoid this misunderstanding for others.
FYI
I was able to successfully implement an OutSystems plugin with an integrated Cordova plugin provided as a ZIP file, exactly as described in the tutorial (see the example in the “Using Cordova plugins” section).
The Cordova plugin was built with an internal .aar library, which is connected via:
plugin.xml
<source-file src="libs/MyLib.aar" target-dir="libs" framework="true"/>
src/android/mylib.gradle
repositories {
maven { url "https://jitpack.io" }
flatDir {
dirs 'libs'
}
dependencies {
implementation(name: 'MyLib', ext: 'aar')
// implementation 'com.github.shivam301296:Android-CustomToast:1.0.1'
// other required dependencies
This setup worked correctly and the plugin was successfully integrated and built in the OutSystems mobile application.
UPDATE: Does anybody know if it`s possible to include a crodova plugin into the OutSystems wrapper as a zip file using ODC ?I don`t see this option in the tutorial for ODC: