Blynk App (Preview) shutting down

I am not using any sensor in the App, I am using a button, Current Location Map and terminal widgets.

OK. I thought you were using a GPS widget. @PeteKnight, the request stands. In addition to answering Sharon’s question, please summarize all of the widgets that require the Blynk app to run 24/7.

The Current Location and the Map Widget needs to be on all the time.

So, are you saying this is the GPS Streaming Widget?? If so, it will work in the background.

I think more clarity of exactly what widgets, sensors, etc. you are using (and their setup) might help us determine if your “issue” is the App or simply your iPhone shutting down what it assumes is an inactive process.

How do you “see” this? And if true, it seem to conflict with your statement…

Perhaps if you can define “status”… as in App active status via BLYNK_APP_CONNECTED() BLYNK_APP_DISCONNECTED() or via the GPS coordinates?

Need more input :wink:

As I mentioned the device is still connected to the Blynk server so I can get sensor information into my Google DB, but the App is shut off.

When it comes to details for troubleshooting… less is NOT more :stuck_out_tongue_winking_eye:

Basically, unless you are running a widget that streams one of the phones sensors (in this case GPS Streaming??) or are running another widget in reading mode, combined with BLYNK_READ(vPIN), then the state of the App rarely affects how a device works with regards to reading sensor data and sending it to the server.

But if the App state is such a factor in your project, then more info on what it is contributing to the setup… how long it stays “active” before not being active anymore… whether or not you “minimise” it or actually have it running full screen all the time (I have an Android tablet that does that… and does it fine)… ya know… more input :wink:

Perhaps even the App and iOS version you are using might be beneficial to the developers, if it is determined there is an issue…

You’re right, no one is interested to see a such long code :wink: So, go back to the basics, “Comment” out most of it and once you got the communications working, “Uncomment” blocks of codes till you can reproduce the error. If you can isolate the problem and still believe it’s a Blynk issue, just share that part of the code. I’m sure the developers will appreciate your efforts. Ha! Note here also your library version and language used.

Another option is to simulate your phone with this desktop app… link

Hi Emillio and Gunner,

Thanks for your reply.

It is hard and very inefficient to start commenting out parts of codes. since the App will go down after numerous hours this can be an endless task. I am not sure what the device code have to do wit the App itself?

In the App I am using a buttons, GPS stream, Map, LCD, LED, Tabs, and Terminal widgets.

I believe this is something to do with the backround App refresh on the iPhone. I didn’t hear of any user running Blynk 24x7 in the backround (at least not from the comments here).
I would expect if the App is going down to get a message or a log that shows the reason, I am not sure where I can see such a log. I clearly know that the device is functioning since the device reports to a Google DB the status of a sensor and other parameters. The device also reports some info based on the App cordinates and I can see that when the Blynk App is crashing the Coordinates stays the same as the last known position.
I hope an engineer from Blynk can comment on this as well.
Thanks
Sharon

I usually have the Blynk App running, constantly in the background & sometimes in the foreground, on my primary Blynk project development phone, a Nexus 6 running 24/7. If in the background, it always pops up immediately when I press on the App icon.

I have a constantly running project using the Map, but not the GPS streaming… as the phone doesn’t move much, why bother :stuck_out_tongue:

You can build this functionality into your code and have it email you.

Thanks Gunner, I do have this functionality in the code. I am reproting BLYNK_APP_CONNECTED and BLYNK_APP_DISCONNECTED into my Google DB. the problem is that this reports when the Blynk App is connected and disconnected not the App that is running under the Blynk platform (the preview application).

I am not understanding the “Preview Application” reference… but if you can already track that the App reports connected without reporting disconnected, then it is safe to assume it is still running.

It is still not clear what, if any, issue you are having with your project when the App stops running. If you are tracking the phones position or something via GPS streaming, then is it usual for the phone to be constantly moving around? A Blynkified Lojack for your jetset phone? :stuck_out_tongue:

I wonder if this is an Apple/iPhone limitation thing?

Opps, I was mistaken… I actually do have a NodeJS test project that is constantly reading from a GPS Streaming widget… effectively 24/7 from my Nexus 6. So it isn’t an issue, at least with Android… (and no wonder the battery doesn’t last as long when I forget to plug it back in :blush: )

image

Try loading in the iOS Beta App… that way the developers can have better logging if/when you send the Log reports after discovering a “crash”.

If you look the the Blynk flow, there is an option to see the App before publishing into the App store, it is called Preview Application. I do need to track the phone location 24x7. The problem has nothing to do with the phone GPS the problem is that the Preview App is getting shut periodically for some unknown reason under the Blynk App. I am not sure you ever tried the Preview App option.

Only briefly when it first came out… thus I keep forgetting about it :stuck_out_tongue_winking_eye:

Then I think I understand the issue now… All this time it seemed you were referring to the App itself crashing or something, even your title says so (I fixed that)… Again, clarity and detail of info is important for troubleshooting. :wink:

It is a “preview” and thus probably limited from constantly running, so as to not get used as a workaround instead of signing for a proper commercial contract.

Hi Sharon,
I assume that you know that iOS has an option to choose when the phone’s Location Services are available to use within an app?
Settings/Privacy/Location Services/Blynk/
This has the options of “Never”, “While using the app” and “Always”.
Can you confirm that your phone is set to “Always”?

I’ve only tried using the GPS Stream widget once, because one of the forum members wanted to do some geofencing and the iOS version of Blynk doesn’t have a GPS trigger widget to do this.
The discussion about this is uin this thread:

As you’ll see, the result for me was that constantly using location services killed the battery on my iPhone quite quickly.

Pete.

:thinking: on my iOS, I don’t see Blynk under Location Services, strange!

So you see a list of apps like this, but Blynk isn’t one of them?

Pete.

No. I only see it under the generic settings. Maybe it’s because I’m not using a GPS widget.

Are you sure you see the launch screen (green “Blynk” on dark background)?

Also check @PeteKnight comment regarding location services permission. The only way for an app to be constantly running in the background is to have “Always” set there.

Hi Pete,

The App is set to Always.

You are correct there is no GPS trigger implemented in the iOS version, I did implement it in the device code. the way I saved on battery is implementing a power management scheme to update the location on different timers for different locations, after implementing this I didn’t have any power issue. But I still have an issue of the Preview App crashing every few hours.