Browse Source

Prevent to stop music in another background app on iOS

volzhs 7 years ago
parent
commit
00ce629bc6
1 changed files with 3 additions and 0 deletions
  1. 3 0
      platform/iphone/app_delegate.mm

+ 3 - 0
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")) {