Create own iOS music player and display on lock screen of iPhone - ios

Is it possible in iOS 11 with the new MusicKit API (or any other iOS API) to create a music player and have it displayed on the iPhone's lock screen, like the current Apple Music player? If so, how -- what APIs should be used?

The first - play user's songs on my app and allow control of my app
from the lock screen as my app is playing the music.
This is possible, the Music Kit API allows you to access the user's library:
MusicKit on iOS lets users play Apple Music and their local music
library natively from your apps and games. When a user provides
permission to their Apple Music account, your app can create
playlists, add songs to their library, and play any of the millions of
songs in the Apple Music catalog. If your app detects that the user is
not yet an Apple Music member, you can offer a trial from within your
app.
https://developer.apple.com/musickit/
Regarding the controls from the lock screen. That can be done without using that SDK, its simply filling the "MPNowPlayingInfoCenter"
Refer to this one for it: iOS: Displaying currently played track info in LockScreen?

Related

can I have library items my app plays show up as recently played in the Music app?

My iOS app plays music from the user's library via MPMusicPlayerController.applicationMusicPlayer. It can either be from Apple Music or manually synced music files.
Is there a way to have that music show up as recently played in the Music app?
Turns out yes, it happens naturally if you launch playback of an album, as in querying the album by a MPMediaEntityPersistentID and giving the resulting MPMediaItemCollection as a queue to the player.
What I was doing though is creating a custom song queue for playback, usually from a given album, and then I'd expect the Music app to show that album as recently played. But the Music app won't pick it up that way.

How can I allow iOS's native screen recording feature to capture Agora audio?

I would like to allow my users to capture recordings of my app's interface along with Agora audio using the system screen recording feature. I know that this is possible because the app Clubhouse also uses Agora and it allows for this.
I plan to show a banner to members of the channel when the app is being recorded and allow them to opt-out their channel if they so choose. But it is important to me that users are able to make and share these recordings on social media platforms as this will be one of the primary ways potential users learn about our app.
Is there some configuration option I need to enable that would allow this feature to work? Thanks!
I am also working on one agora based application
you need to just hold screen recording button for a second you will get one popover as the below screen shot for microphone on/off.
just turn on microphone and record video using system screen recording feature.

Showing track name and artist for music, podcasts and any apps [Swift]

I've been trying to find a way to access the track name and artist information from any background audio just like the iOS control center player (swipe up view).
I have a part of my app that needs to display the track name and artist of any current music playing in the background.
At the moment I've been testing the MPMusicPlayerController but I can only get it to provide the now playing item of the Music app and not other third-party apps like Spotify or Apple's podcast app.
Any idea how I can replicate the control centers ability to fetch now playing items from any app music using the play audio background mode?
I'm trying to get this working in swift.
Thanks!

Is spotify play button mandatory for iOS App?

I am planning to build an iOS App wherein my App would auto-play all songs from my defined playlist (one after the other). So as soon as my App ia launched, the first song in my playlist would auto-play, then, as soon as this song ends, the second song in the playlist should auto-play. Also I do not want user to access Play and Pause buttons while the song is playing.
Please suggest if this is possible. Would Spotify reject my App if Play and Pause button are not shown to users?
If it's to meet requirements of Human Interface Guide
that they wouldn't reject you. How I know, your app is meeting requirements. (but I didn't read all HIG documentation)

How to integrate a music player in iOS system

How can I integrate a music app in the iOS system that my own custom player can handle actions (play, pause, forward) from the unlock screen and how to integrate that is displayed as player app in the double-click-home-button menu like on this screenshot Spotify does:
EDIT: The application itself is based at the Media Player Framework, but in this documents there isn't any hint how to get the custom player in this 'double-click-home-button' menu.
If you register your application for remote control events, and if you start playing either audio or video, your application will automatically take over these controls. See Apple's documentation for more info. This API is available on iOS 4 and later.
To set the string below the controls ("The Butterfly Defect" in your screenshot), use MPNowPlayingInfoCenter, available on iOS 5 and later.

Resources