Edit Config.xml in outsystems for IOS

Hi,

I am using the BLE plugin available in forge to receive notification from a BLE device. This works really well except for on IOS as the device will not receive any notifications when the application is in the background or when the screen is off. After doing some reading i discovered that in order to enable background notifications I need to add the following (see xml below) to the apps config.xml file. How can I do this in OutSystems?

<platform name="ios">
    <config-file parent="UIBackgroundModes" target="*-Info.plist">
        <array>
            <string>bluetooth-central</string>
        </array>
    </config-file>
</platform>



Extract of the Cordova plugin post

A few things:

  1. Posts like this should ideally be made to the support page of the plugin you're using, since they're specific to the plugin. 
  2. As it happens, I'm on the team for the BLE plugin, so I may be able to help, but it would be good to know more about what you're trying to accomplish (what's the device you're connecting to, what do you expect to happen when the notifications occur, etc.) in order to see whether it would make sense to update the plugin to accommodate that.
  3. Worst case, you should be able to clone the BLE plugin git repo (it's linked in the Extensibility Configuration property of the BLE plugin module), and create your own version of the BLE plugin that has the required configuration.


I appreciate the response :) 

1. Agreed, In future I will keep this in mind before posting. 

2. What we are trying to achieve is to connect to a BLE peripheral which contains a number of sensors e.g. temperature, heart rate, blood oxygen level ect. The peripheral device has been developed in house and will send a notification to a smart phone when ever the measured readings exceed programmed limits. The smart phone will then vibrate and sound (notifivaiton) when this happens to notify the user of the event. In most cases the smart phone will have its screen off when theses events are expected to occur. 

3. I am happy to do this however im still unsure how to modify the config.xml file within the context of outsystems. Any assistance here would be greatly appreciated :) 

Ok, so i got this to work by using the following forge plugin to add new keys to the config.xml.


<config-file parent="UIBackgroundModes" target="*-Info.plist">
<array>
<string>bluetooth-central</string>
</array>
</config-file>



It works, however I do believe it is not the best solution. I am still interested to know if anyone else has a better solutions. 


I'm curious...why do you believe it's not the "best solution"?

What would make it better in your view?

Hi Andrew,


The reason I believe this may not be the best solution is in order to customise the plugin so that you can edit extra tags on the *-info.plist file you have to:

  • download the plugin in a local repo
  • edit the plugin.xml file of the plugin
  • commit the repo to github and use your newly created repo (change the repo in the extensibility configurations section).

This creates an extra dependency on my git repository (which is now public) Preferably a solution would simply be to add some additional JSON in the extensibility configuration section of the out-systems application. 

So, you may be able to use the information in the docs here:

https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/Mobile_Plugins/Using_Cordova_Plugins

and here:

https://success.outsystems.com/Documentation/11/Delivering_Mobile_Apps/Customize_Your_Mobile_App/Extensibility_Configurations_JSON_Schema

to have your app point to a local ZIP file rather than a public github repo.

I have not gone down this route, but wanted to make sure you were aware that public github repo is not the only means of providing plugin extensibility.