0

I am working on app in which audio file playing very vital role.

for playing audio file I am using AVaudioPlayer in my app.

but one problem is suppose device is in silent mode and user starts running the app

and suppose he/she turns on silent/ring switch in the middle of the app.

right now he/she must exit the game but I want such kind of functionality in

which He/she should not exit the app and in the middle of the app user should be

able to hear the sound when he turns on the ring/silent switch from the device.

kEvin
  • 411
  • 6
  • 18
  • I deleted my answer because I think I may have provided some false information (and you said that the question I linked to was not relevant to your situation.) My apologies for misunderstanding. Perhaps this documentation will be of some use to you. https://developer.apple.com/library/ios/#documentation/Audio/Conceptual/AudioSessionProgrammingGuide/Configuration/Configuration.html Specifically, if you configure your audio session correctly, audio should play continuously without the user ever having to exit the app. – Mitch Lindgren Aug 09 '12 at 05:10

1 Answers1

0

iOS apps have the ability to play music in the background whether they be games or not, since multitasking was introduced in iOS.

See the following tutorial.

http://mobile.tutsplus.com/tutorials/iphone/ios-sdk_background-audio/

Whether its legit for a game to do this I seriously question. But thats your call.

deleted_user
  • 3,817
  • 1
  • 18
  • 27