@Erel: I have added a timer in the sample that do something every 3 seconds and I see as you say that the task are executed also in backgroung. That seems to solve my problems, but you told me that the app could be refused by Apple because they could look inside the code and see I'm not using the background location as it is intended for, right ?
@moster67: Something like this ?
1) write a B4J app for my server, that works as a push server and also check the server database every n seconds
2) if there are new data send a silent notification to the registered users that are interested to that data
3) the app of the users receive the silent notification and poll the server via RDC to collect the data
A bit complicated, need to rethink from scratch all the platform, but I realize that would be a much more efficient way instead of let each user to poll the server contonuously.
I have a hate/love relation with Apple: you are nervous when they doesn't allow to do something, but on the other hand they force you to "think better" and write more efficient software.
Update: i need to correct what I said to Erel. Timer tasks are execuded also in background in the Local Mac simulator. But on real device Iphone6S it behaves different: I can see a log for each timer_tick (so the event is fired), but non other codes is really executed (I'm trying to play a sound and make a RDC connection but they are not executed).