瀏覽代碼

feat: 通话铃声默认采用扬声器播放

陈文艺 1 月之前
父節點
當前提交
57040fe94a
共有 3 個文件被更改,包括 12 次插入2 次删除
  1. 8 2
      Lanu.xcodeproj/project.pbxproj
  2. 1 0
      Lanu/Info.plist
  3. 3 0
      Lanu/Manager/IM/LNIMAudioCallBellPlayer.swift

+ 8 - 2
Lanu.xcodeproj/project.pbxproj

@@ -352,8 +352,6 @@
 		};
 		FBB67E232EC48B440070E686 /* ThirdParty */ = {
 			isa = PBXFileSystemSynchronizedRootGroup;
-			exceptions = (
-			);
 			path = ThirdParty;
 			sourceTree = "<group>";
 		};
@@ -508,10 +506,14 @@
 			inputFileListPaths = (
 				"${PODS_ROOT}/Target Support Files/Pods-Gami/Pods-Gami-resources-${CONFIGURATION}-input-files.xcfilelist",
 			);
+			inputPaths = (
+			);
 			name = "[CP] Copy Pods Resources";
 			outputFileListPaths = (
 				"${PODS_ROOT}/Target Support Files/Pods-Gami/Pods-Gami-resources-${CONFIGURATION}-output-files.xcfilelist",
 			);
+			outputPaths = (
+			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
 			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Gami/Pods-Gami-resources.sh\"\n";
@@ -547,10 +549,14 @@
 			inputFileListPaths = (
 				"${PODS_ROOT}/Target Support Files/Pods-Gami/Pods-Gami-frameworks-${CONFIGURATION}-input-files.xcfilelist",
 			);
+			inputPaths = (
+			);
 			name = "[CP] Embed Pods Frameworks";
 			outputFileListPaths = (
 				"${PODS_ROOT}/Target Support Files/Pods-Gami/Pods-Gami-frameworks-${CONFIGURATION}-output-files.xcfilelist",
 			);
+			outputPaths = (
+			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
 			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Gami/Pods-Gami-frameworks.sh\"\n";

+ 1 - 0
Lanu/Info.plist

@@ -65,6 +65,7 @@
 	<key>UIBackgroundModes</key>
 	<array>
 		<string>remote-notification</string>
+		<string>audio</string>
 	</array>
 	<key>UIDesignRequiresCompatibility</key>
 	<true/>

+ 3 - 0
Lanu/Manager/IM/LNIMAudioCallBellPlayer.swift

@@ -25,6 +25,9 @@ class LNIMAudioCallBellPlayer: NSObject {
         guard let path else { return }
         
         do {
+            let session = AVAudioSession.sharedInstance()
+            try session.setCategory(.playback, mode: .default)
+            try session.setActive(true)
             player = try AVAudioPlayer(contentsOf: URL(fileURLWithPath: path))
         } catch let error as NSError {
             print("Error: \(error.localizedDescription)")