Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio is disabled in app, updating to 10.3.6 doesn't help #40

Closed
Shchvova opened this issue Oct 8, 2021 · 9 comments
Closed

Audio is disabled in app, updating to 10.3.6 doesn't help #40

Shchvova opened this issue Oct 8, 2021 · 9 comments
Assignees

Comments

@Shchvova
Copy link

Shchvova commented Oct 8, 2021

After playing interstitial or rewarded app audio session is broken in the app, unable to make sounds.

@Shchvova Shchvova changed the title avaudiosession Audio is disabled in app, updating to 10.3.6 doesn't help Oct 8, 2021
@Keane81
Copy link

Keane81 commented Dec 10, 2021

Also interesting in that issue, any updates there?

@ryanbalieiro
Copy link

ryanbalieiro commented Dec 18, 2021

Facing exactly the same issue here.

After the ad is closed, I get the following error log:

"[avas] AVAudioSession_iOS.mm:1243 Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session."

The app doesn't play any sound anymore unless you send the app to the background and switch back to it.


[EDIT] Just found a quick workaround to avoid this issue that worked for me.

Before showing an ad, change the AvAudioSession category to AVAudioSessionCategoryAmbient.

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil];
[self.ad showAd];

After the ad is complete, use the didHideAd() delegate method to change the AvAudioSession category back to the original value. I'm using AVAudioSessionCategoryPlayback.

- (void)didHideAd:(MAAd *)ad
{
    [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
}

@cihadturhan
Copy link

Facing exactly the same issue here.

After the ad is closed, I get the following error log:

"[avas] AVAudioSession_iOS.mm:1243 Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session."

The app doesn't play any sound anymore unless you send the app to the background and switch back to it.

[EDIT] Just found a quick workaround to avoid this issue that worked for me.

Before showing an ad, change the AvAudioSession category to AVAudioSessionCategoryAmbient.

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil];
[self.ad showAd];

After the ad is complete, use the didHideAd() delegate method to change the AvAudioSession category back to the original value. I'm using AVAudioSessionCategoryPlayback.

- (void)didHideAd:(MAAd *)ad
{
    [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
}

Thank you! I've been searching this for over a month.
I use ironsource mediation with applovin so it was hard to know.
Finally someone figured out the actual problem.

@fredriksthlm
Copy link

fredriksthlm commented Oct 20, 2022

For me this seems to be an issue with Webview, that it loses the audio every time an ad activity is shown. The audio for the webview will then be permanently off when the ad is dismissed.

If you minimize the app and then reopen it the audio is back.

I do not have the same issue with the mediated Pangle ads, only Applovin ads. (And only real ads. The test ads always work perfectly fine..)

@NanaAmoah
Copy link
Contributor

NanaAmoah commented Jan 7, 2023

We released AppLovin SDK v11.6.1 with a fix for the issue. You can enable the fix using the steps in these docs after upgrading to this version.
@Shchvova @Keane81 @ryanbalieiro @cihadturhan @fredriksthlm

@fredriksthlm
Copy link

@NanaAmoah thank you for this. I have discussed this with Thomas a bit during the last weeks. Will you document this "fix" in your official documentation (iOS, Unity, Cordova) anywhere?

Can you show exactly how the code is supposed to be implemented within this file:
https://github.com/AppLovin/AppLovin-MAX-Cordova/blob/master/plugin/src/ios/AppLovinMAX.m

Since we cannot verify in the log, or anywhere else, if we actually managed to set it correctly?

@keasukei
Copy link

keasukei commented May 5, 2023

@NanaAmoah still have this problem, i'm using 11.8.0,

@keasukei
Copy link

keasukei commented May 5, 2023

@NanaAmoah after using MaxSdk.SetExtraParameter("return_audio_focus", "true"); The frequency of game mute has decreased,but still has this problem

@fredriksthlm
Copy link

@keasukei Yes this is still an issue for everyone. You can follow it here: #187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants