iOS Question iPhone and service substitude

Nickelgrass

Active Member
Licensed User
Longtime User
Hello,
I am making an iPhone version of an Android app I made with b4a. The Android app has a service and multiple activities that access the service (with callbacks that the activity can set in the service for example). The service may not be interrupted as it connects to a network server and that connection may not be interrupted.

I understand that iOS does not have service modules. So I put the code in a class module. The calss is initialized in the main code module. It works. My question is now, how can I share that class between activities (or pages)? What way is the best practice on b4i for this kind of task?

(I am aware that the class, unlike the Android service, will only run while the app is open, that's ok).
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The solution for both Android and iOS is to switch to B4XPages. B4XPages classes are not paused when the app moves to the background.

In both Android and iOS the OS will pretty soon kill the process when the app is in the background but in most cases you don't need to worry about it.
 
Upvote 0
Top