Is spotify play button mandatory for iOS App? - ios

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)

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.

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.

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

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?

Is it possible to code iOS app to make music app go to next song?

So I'm not sure if it's possible to make the native music player on iOS flip to next song from the request of another app.
How would I call from my app for the music app to flip to the next song?
You cannot tell the music app or any other apps to skip a song.
Each app has its own instance of whatever music playing controller it may be using, and so there's no way you can interact directly with it.

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!

Resources