How to wake an app when screensaver is displayed - swift

I have an application that gets hidden (but is still running in the background) when the screen saver starts on the 4th Generation Apple TV.
How can I bring the app to the foreground (hide screen saver) when an event (update to an endpoint which I am long polling) happens in my app which is running in the background?

I don't think there's any way to do this. When the screen saver is running, your app can still be the foreground app, but it will be in an inactive state. This is similar to what happens on iOS when the user locks the screen while using an app. Like the iOS lock screen, the user might be actively using the system when it's in this state. For example, you can use Siri without dismissing the screen saver.

Related

Iphone lock screen application

friends I am new to iphone development, I have mostly worked with Android, now I have to develop a small clock for Iphone which should be shown on lock screen like following app
http://itunes.apple.com/us/app/weather-lock-screen-free/id433369569?mt=8
just a start idea how can i place an app at iphone lock screen since i have already created the (analog ) clock, thanks for your help
Faisal
This app doesn't actually set the background of the lock screen. It asks the user to save an image, then the user has to set the image as the background for the lock screen manually.
There is no API to do what you want.

How does GuitarToolkit show a persistent active banner when in background?

I have GuitarToolkit on my iPhone4S (iOS 5.01 - NOT jailbroken) It has a metronome feature which continues playing in the background, and also adds a red banner overlay (see screenshots) which persists on the home/lock screen and also when other apps are running. The banner is animating (background colour pulses) and it is also 'active' in that pressing it will return you to the GuitarToolkit app.
I know about the background audio APIs for the sound, but how does it do this banner? My first thought was local notifications, but nothing appears in notification center, and GuitarToolkit is not listed under Notifications in Settings.
My iPhone is not jailbroken and GuitarToolkit is available in the App Store, so what APIs is it using to achieve this?
Having an active AVAudioQueue creates that banner.
The banner appears because it’s got an open audio recording session—you’ll notice that the system Voice Memos app does the same thing, as does Shazam for a moment before it enters the background and Skype when you’re on a call with the app in the background. I’m not sure of the specific API, but that’s generally what’s going on.

iphone lock button and the running app

this may be a simple one, but I don't know the answer.....
For testing whether my location-based app receives updates in background, I usually run the app and then press the Home button to put the app in background. However, I am curious whether pressing the Lock button (at the top) will put the app in background or not.
Regards.
Yes. Hitting the lock button does background the application. However when you unlock it, the application is then brought back to the foreground. Should be able to test this within your App Delegate and simple log statements.

How can I detect if iPhone screen is locked (off)

I would like to detect the status of the iPhone, such as if the screen is off (screen locked), or if the device has sound turned off.
Can an API do this, or is there any other way can do it?
Thanks vikingosegundo for helping me to edit the article,but the above is not what i want to know.
in my app, ijust want to check the device, i want to know if the iphone is sound off,and if the device is powered off(has no power). how can i know this ?
When the user locks the screen, applicationWillResignActive is called, and the app enters the "Inactive" state. Unless your app is running tasks that continue in that state (e.g. continuing to play audio) after about 20 seconds the phone will enter a sleep mode where your app is moved from inactive to its background state.

is there any notification for unlock sreen by sliding to unlock iphone?

I work on jailbreak iphone, I want to know when user unlock the screen of iphone,is there any notification for unlock sreen by slide to unlock iphone? Thanks >>>>
From apple docs: use UIApplicationDidBecomeActiveNotification. This works only if your app is running so if you want to trigger some action on a background app running in a jailbroken device this is not the right solution.
UIApplicationDidBecomeActiveNotification
Posted when the application becomes active.
An application is active when it is receiving events. An active application can be said to have focus. It gains focus after being launched, loses focus when an overlay window pops up or when the device is locked, and gains focus when the device is unlocked.
Availability
Available in iOS 2.0 and later.
Declared In
UIApplication.h