···11import * as PlatformInfo from './src/PlatformInfo'
22+import {AudioCategory} from './src/PlatformInfo/types'
23import * as Referrer from './src/Referrer'
34import * as SharedPrefs from './src/SharedPrefs'
45import VisibilityView from './src/VisibilityView'
5666-export {PlatformInfo, Referrer, SharedPrefs, VisibilityView}
77+export {AudioCategory, PlatformInfo, Referrer, SharedPrefs, VisibilityView}
···11import {NotImplementedError} from '../NotImplemented'
22+import {AudioCategory} from './types'
2334export function getIsReducedMotionEnabled(): boolean {
45 throw new NotImplementedError()
56}
6788+/**
99+ * Set whether the app's audio should mix with other apps' audio.
1010+ * @param mixWithOthers
1111+ */
712export function setAudioMixWithOthers(mixWithOthers: boolean): void {
813 throw new NotImplementedError({mixWithOthers})
914}
1515+1616+/**
1717+ * Set the audio category for the app.
1818+ * @param audioCategory
1919+ * @platform ios
2020+ */
2121+export function setAudioCategory(audioCategory: AudioCategory): void {
2222+ throw new NotImplementedError({audioCategory})
2323+}
···11+/**
22+ * Sets the audio session category on iOS. In general, we should only need to use this for the `playback` and `ambient`
33+ * categories. This enum however includes other categories that are available in the native API for clarity and
44+ * potential future use.
55+ * @see https://developer.apple.com/documentation/avfoundation/avaudiosession/category
66+ * @platform ios
77+ */
88+export enum AudioCategory {
99+ Ambient = 'AVAudioSessionCategoryAmbient',
1010+ Playback = 'AVAudioSessionCategoryPlayback',
1111+ _SoloAmbient = 'AVAudioSessionCategorySoloAmbient',
1212+ _Record = 'AVAudioSessionCategoryRecord',
1313+ _PlayAndRecord = 'AVAudioSessionCategoryPlayAndRecord',
1414+ _MultiRoute = 'AVAudioSessionCategoryMultiRoute',
1515+}
+2-1
src/App.native.tsx
···6161import {Splash} from '#/Splash'
6262import {Provider as TourProvider} from '#/tours'
6363import {BackgroundNotificationPreferencesProvider} from '../modules/expo-background-notification-handler/src/BackgroundNotificationHandlerProvider'
6464-import {PlatformInfo} from '../modules/expo-bluesky-swiss-army'
6464+import {AudioCategory, PlatformInfo} from '../modules/expo-bluesky-swiss-army'
65656666SplashScreen.preventAutoHideAsync()
6767···158158 const [isReady, setReady] = useState(false)
159159160160 React.useEffect(() => {
161161+ PlatformInfo.setAudioCategory(AudioCategory.Ambient)
161162 PlatformInfo.setAudioMixWithOthers(true)
162163 initPersistedState().then(() => setReady(true))
163164 }, [])