2024-08-05 21:21:34 +02:00
|
|
|
import ExpoModulesCore
|
|
|
|
|
|
|
|
public class ExpoPlatformInfoModule: Module {
|
|
|
|
public func definition() -> ModuleDefinition {
|
|
|
|
Name("ExpoPlatformInfo")
|
|
|
|
|
|
|
|
Function("getIsReducedMotionEnabled") {
|
|
|
|
return UIAccessibility.isReduceMotionEnabled
|
|
|
|
}
|
2024-08-09 12:05:12 +02:00
|
|
|
|
|
|
|
Function("setAudioMixWithOthers") { (mixWithOthers: Bool) in
|
|
|
|
var options: AVAudioSession.CategoryOptions
|
|
|
|
if mixWithOthers {
|
|
|
|
options = [.mixWithOthers]
|
|
|
|
} else {
|
|
|
|
options = []
|
|
|
|
}
|
|
|
|
try? AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, mode: .default, options: options)
|
|
|
|
}
|
2024-08-05 21:21:34 +02:00
|
|
|
}
|
|
|
|
}
|