Do tvOS transmissions remain active as there is no battery drain?

Question with two parts:

First, does Apple TV launch apps in the background while sleeping? I would suggest that this would be so because the Apple TV does not rely on the battery.

Secondly, if this is not the case, how would I override this so that the application runs and writes to my database?

I create an application that connects to Bluetooth LE and then writes to the database after connecting. I would like Apple TV to become a hub for my device. So while the Apple TV may not sleep, unlike iOS, I have to be fine. I could look at it wrong. Please feel free to correct me.

+5
source share
1 answer

tvOS runs the same application state engine as iOS. This means that it has the same old one:

not running > suspended > background > inactive > active

It also means that it will perform basic background processing based on certain specific background tasks that you specify, just like iOS. Although, tvOS does not have a background update feature that I would suggest that you want to use for the scenario you described.

Check out this Apple doc for more modes. https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW22


In particular, answer the question: there may be some way to work with some background data, but it will be very limited; And you can prevent sleep programmatically:

 [UIApplication sharedApplication].idleTimerDisabled = YES; 

This apple doc will provide you with everything you need for this. https://developer.apple.com/documentation/uikit/uiapplication

+1
source

Source: https://habr.com/ru/post/1260726/


All Articles