4670
Views
7
Comments
Is it possible to keep my app running in the background even when user closed it?
Question

Hi everyone, 

I am creating a fitness app with pedometer feature. 

However, I am having trouble with the following issue:
1. I am using Background Mode plugin, but it still does not fulfill my use case. I need my app to stay alive even when the user "close/kill" the application.

One application exists in the play store is called pacer... is outsystems able to create something similar?

Rank: #412

Hi olivier,

               Indra is right your can use the timer.



Thanks

Rajendra Singh

                             

mvp_badge
MVP
Rank: #19

Hi Olivier,

What exactly are you trying to achieve? If a user kills an app, it will not be running on the device and OutSystems Timers only exist server-side.

If you're ok with the app running in the background when the user switches apps (or soft-closes your app, without explicitly "killing" it) you may want to check this post and use something like BackgroundMode Plugin or Background Location Plugin, depending on what you need.

mvp_badge
MVP
Rank: #19

Olivier,

Please look into this plugin which from the description uses this Cordova plugin for the pedometer functionality. This kind of thing is provided by the device/OS itself, it's not something you can easily do directly from your app.

If you want to share that data via HealthKit on iOS, you can look into this other plugin.

mvp_badge
MVP
Rank: #5

Hello Olivier,

What you are trying to accomplish is to build a Service.

https://developer.android.com/guide/components/services.html

You can search for service and cordova to find documentation on how to implement a service with cordova and try to adapt to use in a plugin for an OutSystems app. Not sure if it is really doable.

Not sure if it is possible at all in iOS.

The easiest would be to implement a small service with native code and launch it through a plugin.

Cheers

Rank: #1421

Hi,

Any updates on this subject?

Do you know any Cordova plugin that puts an App running as a service, even if the user closes the App?

Background Mode plugin isn't enough because when user closes the app, the app stops the background processing.

Regarding Eduardo last suggestion how would an Outsystems App start a service and then asks that service for some data, is there any Cordova plugin for this? 

Cheers,
Tiago