Skip to content

Commit d7ce4e2

Browse files
fix: default input on function
1 parent ceb4ac8 commit d7ce4e2

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/module.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,7 @@ export async function activateAudioSession(
117117
}
118118
): Promise<void> {
119119
if (!isAndroid) {
120-
return VolumeManagerNativeModule.activateAudioSession(
121-
options.runAsync
122-
);
120+
return VolumeManagerNativeModule.activateAudioSession(options.runAsync);
123121
}
124122
return undefined;
125123
}
@@ -130,7 +128,10 @@ export async function activateAudioSession(
130128
* @returns {Promise<void>} - Resolves when the operation has finished. If an error occurs, it will be rejected with an instance of Error. On Android, this function returns undefined.
131129
*/
132130
export async function deactivateAudioSession(
133-
options: AVAudioSessionDeactivationOptions = { runAsync: true }
131+
options: AVAudioSessionDeactivationOptions = {
132+
restorePreviousSessionOnDeactivation: true,
133+
runAsync: true,
134+
}
134135
): Promise<void> {
135136
if (!isAndroid) {
136137
return VolumeManagerNativeModule.deactivateAudioSession(

src/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export type AVAudioSessionActivationOptions = {
3333
* Run the function asyncronously (non blocking).
3434
* @default true
3535
*/
36-
runAsync?: boolean;
36+
runAsync: boolean;
3737
};
3838

3939
export type AVAudioSessionDeactivationOptions = {
@@ -42,12 +42,12 @@ export type AVAudioSessionDeactivationOptions = {
4242
* and this audio session starts, it will pause the music. When you call `inactivateAudioSession` it will play the music again.
4343
* @default true
4444
*/
45-
restorePreviousSessionOnDeactivation?: boolean;
45+
restorePreviousSessionOnDeactivation: boolean;
4646
/**
4747
* Run the function asyncronously (non blocking).
4848
* @default true
4949
*/
50-
runAsync?: boolean;
50+
runAsync: boolean;
5151
};
5252

5353
export enum AVAudioSessionCategory {

0 commit comments

Comments
 (0)