I want my SpriteKit
game not to interrupt background music that user listens (Music.app or radio app).
Everything goes fine until execution reaches this line:
sSharedShootSoundAction = [SKAction playSoundFileNamed:@"plane_shoot.aiff"
waitForCompletion:NO];
After this line background music stops. How to avoid this?
I have also encountered this problem myself. FYI my solutions are in swift so just translate this to Objective C if you are still using that.
For me my solution included two parts. First, I had to initialize my SoundAction SKAction within my didMoveToView function in my scene file. So your scene file should look something like this:
Then in your AppDelegate file you need to place the following line of code in your application didFinishLaunchingWithOptions function. (DO NOT FORGET TO IMPORT AVFOUNDATION IN YOUR APPDELEGATE). So your app delegate method should like something like this:
Hope this solves it for you as it did for me! Let me know if it doesn't.