How play music for alarm app in ios6? - ios

How play music in my alarm app from musiclibrary in ios6 ?
Is there a new API or new feature UILocalNotification ?

It's only new in the standard Clock app, the API (MediaPlayer) has been around for a while.
Here's some links:
Apple's documentation
A tutorial on TutsPlus

Related

Play Apple Music's App Songs using SystemMusic Play API

I have simple application through which i want to play apple music songs from my application. I have implemented this code to play & pause music from the application.
[[MPMusicPlayerController systemMusicPlayer] play];
[[MPMusicPlayerController systemMusicPlayer] pause];
The issue i am facing with this implmentation:-
I need to manually open the Apple Music App once, play the music and
pause it before testing the app.
The Apple music app then have instance and a song in queue to be
played by my app.
If i test my app with above code, it works fine for sometime but
stops playing the songs after few iterations.
Actual requirement is just i need to run the song without starting the Apple Music app before testing my application and it should run by and when i am testing.
Please guide me that what implementation is required and can this doable or not.

iOS - Any way to get another app's now playing song info

5 years ago there was the same question where everybody answered
"No, you can't, it's iOS sandbox", in general, then it was a iOS 5,
but now is 2016 and iOS 9.3 is coming up and the same question:
My app need to know information (tittle, artist, album) about now playing song in system, that means it need to support any player like built-in Apple Music or Spotify, Bandcamp and more. I tried to access by MPMusicPlayerController.nowplayingitem, but it works only with Apple Music app, I tried to call MPNowPlayingInfoCenter, and as I understand, it just let me set some info to Control Centre and lock screen if your app is nowPlaying in iOS, but if not, it returns nil. Is there any way to do this? Swift answers welcome

How can I pause music coming from another app in my own app?

I'm very new to xcode and am trying to figure out how I can pause music coming in from another app such as iTunes or Spotify so that it does not run in the background of my app. Is there a command I'm missing or do I have to have a button to shut it off?
Please have a look at the Audio Session Programming Guide. You have to create an audio session with category AVAudioSessionCategorySoloAmbient.

I can't play an UILocalNotification sound from NSDocumentsDirectory on iOS 8

I'm having an issue with UILocalNotification (but it is the same with the Push notifications).
I'm only allowed to play sounds from the bundle of the app. For the purpose of my app, I'd like to play a sound from the NSDocumentsDirectory. I know that it was possible prior to iOS 6.
My question is: has anyone found a solution / hack to do it on iOS 7/8 ?
Thanks !

iOS app: access to Music storage allowed? [duplicate]

This question already has answers here:
Add Music to iOS programmatically
(4 answers)
Closed 8 years ago.
From my experience, it seems that most music-app solutions out there try to reinvent the wheel (creating a new player, that the user would need to start using instead of the iOS default one). So I'm wondering: is it because each application has its own way to access/modify the Music data?
In short: can an iOS app add or remove music from the device in order for the default iOS music player to discover the new tracks? If yes, where is the documentation about this?
Thanks
Apps cannot add music to the iOS Music Player. This is so that the only way to get music onto the default phone player is via iTunes. This protects Apple's revenue from music, so you can't blame them really for doing this.
If there was a way, those apps you've seen would use it!

Resources