Receive Electron Data on mobile app even if the user closes the app

I want to receive the Electron data in the background of the app. Their is an api for background data refresh but that like every 30m and when the phone want’s. What I’m looking for is like the nike running app where even if the user close’s the app the user location is still bing stored. Does anyone know how I could do this? Does anyone have any experience with this? :grinning:

Perhaps have two processes - one always on and receiving the data and storing it in a sqlite database

The other application is a front end that displays the data from the database.

Possible issue #1 - I believe each app has it’s own sandbox on IOS so you need to find a way of sharing the database between two ‘apps’ (the database normally lives in the sandbox.

You will also have to research the ‘background’ app being able to keep running (and accepting data)


Thanks for replying that’s the problem with iPhone if apple doesn’t want you to do it you will not do it. Thanks for the feed back I am thinking of creating a sever where it’s always looking for the electron data and storing it. If the app comes back online then it will update the data. The only problem with this approach is that it’s a lot more work. :sunglasses:

I don’t have that much experience with front or back end development if there is anyone that could give me pointer in that part much appreciated. I want to have lot’s of users on that sever so i was thinking of using parse source code on a amazon server of something like that because they have really good iOS API

I am looking at doing something with an electron (bear with me here).

Essentially I hope to get the electron to wake up, wait for connectivity, and ready a string from a GPS. It will then publish the data. It will then go to sleep for say 15 minutes. Wake up and repeat the cycle.

I have some rudimentry PHP code that will currently pull the data. What I want to do is to store the data into a mysql database (my PHP is limited so it is a learning process!).

Now I have written code on apple (Using Corona because x-code gives me the willies) that does a network call to a (MS-Windows) endpoint that then queries the database.

I believe most of this is what you will end up with.

If you can wait, I will feed my code to you as I complete sections (Obviously I will have a PHP ‘endpoint’ on my system (OSX with apache for PHP) analgious to the MS Windows end point have have used in the past (queries sql server DB but in some respects this is irrelevant).

The development will be;

  1. Get electron goin in and out of sleep and publishing GPS data (Note I have most of the code base for photon already!)
  2. Get the PHP ‘server’ code to update (add) the published data) to DB Poll every ‘x’ minutes and don’t write dup data (note must find out how long a published variable hangs around for (lifetime)
  3. The endpoint which would be queried by IOS device
  4. IOS app (may not write this but have a website that queries the endpoint.

Bit of an obsticle - I have to see if I can get a port opened up on my home network.)


1 Like

Thanks for the help that would be great if you want PM with the information.

Will do.

All the best