From 00ce629bc651beeb02787eeca95fed031bddb93d Mon Sep 17 00:00:00 2001 From: volzhs Date: Mon, 6 Nov 2017 20:16:34 +0900 Subject: Prevent to stop music in another background app on iOS --- platform/iphone/app_delegate.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index 65cafbd6d4..8f2893e69e 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -638,6 +638,9 @@ static int frame_count = 0; mainViewController = view_controller; + // prevent to stop music in another background app + [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil]; + #ifdef MODULE_GAME_ANALYTICS_ENABLED printf("********************* didFinishLaunchingWithOptions\n"); if (!ProjectSettings::get_singleton()->has("mobileapptracker/advertiser_id")) { -- cgit v1.2.3