Programmatically refresh screenshot in iOS7 multitasking screen? - ios

I have a music player app which implements background audio. I’m trying to update the screenshot in the iOS7 multi-tasking switcher when the track changes. So, if I background the app during Song A, it finishes and Song B comes on, if I then go into the tray I’d like to see a screenshot showing Song B’s artwork, title, etc.
I’ve done some digging and not managed to find any way to tell iOS to update short of implementing Background Fetch and going all out with that. Is there another means of doing this, something I can call to tell it to refresh it when my tracks change?

Apple does not provide any means of doing this. Even iOS own media player does not have this ability.

Related

Keep the app awaken in background when [MPMusicPlayerApplicationController applicationQueuePlayer] is used to play the music

With iOS 10.3 Apple released new APIs in MediaPlayer framework that brings more control/power to the developer that want to play music stored on Apple Music/iTunes Match. I’m talking about new applicationQueuePlayer and applicationMusicPlayer of MPMusicPlayerApplicationController.
The problem is of course with the multitasking. I'm building basically an alternative to Apple's own music player. But also I need to execute some code (mostly network connections) when the music is playing. Those new APIs requires to turn on background modes for the app (Audio, AirPlay and Picture in Picture), so music is playing when the user goes to home screen, but the app itself is suspended.
I've figured out that I can play silent audio so the app itself stays alive and maybe, maybe the app will be approved (as technically it's playing music in background and background mode capability must be turned on anyway). But I don't want to consume user's battery when the music is paused.
Even funnier: it seems, that new API is designed for the apps that stay alive in background, because on iOS 10.3.3 after changing the track via Control Center and tapping on the name of the song the system music app is opened instead of my app.
Imagine, that user pause the music from control center before arriving to work, then resumes it from control center. I don't want to eat user's battery when he's at work.
My question is: is there any way to keep the app live and respond to actions taken by the user?
"The music player does not affect the Music app’s state. When your app moves to the background, the music player stops playing the current media."
https://developer.apple.com/documentation/mediaplayer/mpmusicplayercontroller/2817540-applicationqueueplayer
systemMusicPlayer will continue in the background, BUT, you have no access, or I think now (iOS11) limited access to the queue.
I think you still need to use some form of AVPlayer ( https://developer.apple.com/documentation/avfoundation/avplayer ) if you want granular control over what goes on, but then you will need to implement all the things that update the lock screen etc on your own.

Trying to create an Xcode Objective-C function that records a video capture of my UIView contents and saves to phone

I'm trying to create an Xcode Objective-C function that can be called from a button tap, that will record the contents of a UIView and its subviews (or a fixed section of the screen e.g. 320x320 in the center) and then allow the user to save the video to their iPhone camera roll. I also want to include the audio that is being played by the app at the time of the recording e.g background music and sound effects.
I'm having trouble finding any info on this as their seems to be a lot of people trying to record their running app for external purposes like the app store video preview. I need my video captured within the app, to be used as an app feature.
Does anyone know if this can be done or know a website or tutorial where I can learn what's needed? Thanks
I know this post is two years old, but for anybody who comes along who might need to record their iOS app's screens and save them to the phone's camera roll or even a specific URL, take a look at https://github.com/alskipp/ASScreenRecorder
I've tried it and it works! The frames per second aren't 60 so I don't know how well it would work if you were trying to record an action game, but it's still pretty awesome.
You can't do that with just one function, check that project:
https://github.com/coolstar/RecordMyScreen

iOS - Allow my app to display information on lock screen?

Is it possible to display information on the lock screen from within my app? For instance, a countdown timer? I know Apple's built in apps, like the clock, can do this. But is it public API available?
And no, I am not talking about Push or Local Notifications. I want to display and actual countdown timer for my purposes so that users can shut the app and get an update on the timer by glancing at the lock screen.
No, this is not possible as far as I know.
One way to access the lock screen is by playing audio and displaying media artwork, so I'm wondering if you could create a playlist that changes songs very fast and the album artwork is an image of the current time.. Probably this isn't even close to what you want, but I'm afraid no public API can do what you want.

Can we play sounds in the background at a particular intervals in the iPhone app?

In my app I need to play some sounds like beeps at a particular intervals of time (May not be uniform intervals), even the app is in the background. I have gone through the google and many suggested to use AV Foundation’s AVPlayer. I have gone through the following tutorial also.
http://www.raywenderlich.com/29948/backgrounding-for-ios
This tutorial explains how to play a queue of items.
But in my app there will not be any continuous music. Just we need to play some sounds while the app in foreground or background.
Simply i need to play sounds as RunKeeper does.
Please help me out.
You can try scheduling a local notification and providing a custom sound: https://developer.apple.com/library/ios/documentation/iphone/Reference/UILocalNotification_Class/Reference/Reference.html. This will also display an alert in notification centre / lock screen though.

Airplay with AVQueuePlayer has gaps

My app uses AVQueuePlayer to show video clips back to back. In testing on my AppleTV, it seems that when I switch to the next video in the queue, there is a small time gap where the Apple TV 'takes over' the screen and the home screen of the Apple TV is displayed. Is there any way to prevent this gap from happening, even a black screen or loading indicator would be a better experience.
I was having this exact same problem and was dismayed when I saw that no one had yet to find an answer.
The solution I ended up going with involved taking advantage of the multiple display support added in iOS 5. There are some helpful links in learning how to do this here:
https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/WindowAndScreenGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40012555-CH1-SW1
http://blog.redfin.com/devblog/2012/05/creating_a_dual-screen_airplay_experience_for_ios_and_apple_tv.html#.UjCe5mRATZY
The app I am designing will basically look for the availability of an external screen. If it finds one it will play the videos on the viewcontroller I provide for that external screen. That viewcontroller can have a black background so that any pause in between videos looks natural and no longer has the Apple TV home screen pop into view for a moment.

Resources