Explorar o código

Prevent to stop music in another background app on iOS

volzhs %!s(int64=7) %!d(string=hai) anos
pai
achega
bc285b2ba4
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      platform/iphone/app_delegate.mm

+ 3 - 0
platform/iphone/app_delegate.mm

@@ -632,6 +632,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 (!Globals::get_singleton()->has("mobileapptracker/advertiser_id")) {