First,
in theory my app is allowed to run in background because i added
#PlistExtra: <key>UIBackgroundModes</key><array><string>bluetooth-central</string></array>
however as soon as i started adding notifications i would occasionally have the app close while in background.
but if i remove the notifications it runs indefinetly (connects with the device as soon as it is in range, perform the operations without any issues)
second, i tried the local notifications but it's not exactly what i want. In Android i have this single notification that stays there as long as the app is active (when the app is first app is launched a service enters foreground mode) and i change the content of the notification to display the current status, like scanning for device, connected, please turn on bluetooth and such.
In iOS I wasn't able to change the content of the notification once it was registered, i had to register another notification but this meant of course that a new notification would pop up.
I also tried a bunch of apps and i think that soundcloud is the one that does what i want to do: when you start playing a song it will create a custom player in the notification area, above other notifications, that doesn't use the controls in the bottom drawer.
Is it possible to do something like that in B4i, a single notification -or whatever it's called- that lets me change its content, like a custom player? is a notification with actions a path to what i want to do? (see
https://www.b4x.com/android/forum/threads/notifications-with-actions.100623/#content )