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 automatically stops after showing ads by Applovin #291

Open
gulliversgames opened this issue Oct 9, 2023 · 39 comments
Open

Audio automatically stops after showing ads by Applovin #291

gulliversgames opened this issue Oct 9, 2023 · 39 comments
Labels
bug Something isn't working

Comments

@gulliversgames
Copy link

gulliversgames commented Oct 9, 2023

MAX Plugin Version

5.11.3

Unity Version

2021.3.29

Device/Platform Info

iPhone 11 - iOS 16.6.1

Current Behavior

All audio functionality stops working after below ad on iOS.

Expected Behavior

If audio is open in the game, it should keep working.

How to Reproduce

Every time an ad showed by Applovin either on interstitial or rewarded video ad placement, game's audio stops working.

Additional Info

No response

@gulliversgames gulliversgames added the bug Something isn't working label Oct 9, 2023
@gulliversgames
Copy link
Author

gulliversgames commented Oct 9, 2023

We tested same scenario on iPhone 13 - 16.6.1 but it doesn't happen.

@gulliversgames
Copy link
Author

This doesn't happen on iPhone 6s - iOS 15.7.9 as well.

@alvarshahanji
Copy link
Contributor

@gulliversgames is this reproducible on your live app? If so, could you share the details of the app. We will try reproducing it to investigate further.

If not, do you have a sharable test project/ our demo app where it is reproducible?

@gulliversgames
Copy link
Author

@alvarshahanji , you can test our app if your store is either UK/CA/AU here:
https://apps.apple.com/gb/app/wordjong-puzzle/id6443411338

If you send an email to [email protected] with an @AppLovin domain email I can send you external testflight link.

@alvarshahanji
Copy link
Contributor

Thank you. Here is the email: [email protected].

@alvarshahanji
Copy link
Contributor

@gulliversgames please let us know when you send the external testing link. Thanks!

@Kidkiwi
Copy link

Kidkiwi commented Oct 12, 2023

@alvarshahanji we get the same issue, here is a video of it happening. After rewarded and interstitial, doesn't matter. This will happen in our live app as well.

https://play.google.com/store/apps/details?id=com.MatchalaGames.RyahsRhythm&hl=en_US
https://apps.apple.com/vn/app/ryahs-rhythm-crossword-puzzle/id1584491161

IMG_4370.MOV.mov

It's not 100% reproducible, at least for me, but it does happen very often our users complain about and our QA team found.
I will find out if its 100% reproducible by our QA team and what device they are using and let you know.

@Kidkiwi
Copy link

Kidkiwi commented Oct 12, 2023

@alvarshahanji so the team says it is very easily producible on ios.

@gulliversgames
Copy link
Author

gulliversgames commented Oct 12, 2023

@alvarshahanji I'm waiting for Apple review. Btw, our game has a lot ABs currently so you might start seeing ads a bit further.
you can test rewarded ads from daily spin, and interstitials after level 25 and 3rd session.

I agree with @Kidkiwi , it sometimes happen; might be end card (PLEC etc.) related.
"Scavenger Hunt!" video definitely does that.

@Kidkiwi
Copy link

Kidkiwi commented Oct 12, 2023 via email

@gulliversgames
Copy link
Author

then definitely it might be the case that this can happen in all iOS devices; time-to-time.

@alvarshahanji
Copy link
Contributor

@Kidkiwi @gulliversgames could you also confirm the issue you are seeing is with AppLovin ads? You can do so by using the creative debugger.

We addressed these issue for AppLovin ads and fixed in 11.11.0 as mentioned here. If the issue you are seeing is with other networks, you would have to reach out to those networks.

@gulliversgames
Copy link
Author

@alvarshahanji I can confirm it is an Applovin ad as you can see below SS.

Skype_Picture_2023_10_12T20_46_15_535Z

@alvarshahanji
Copy link
Contributor

I could repro the issue on https://apps.apple.com/vn/app/ryahs-rhythm-crossword-puzzle/id1584491161. We are looking into it and share an update with our findings. Thank you both!

@alvarshahanji
Copy link
Contributor

@gulliversgames @Kidkiwi restarting their app audio when the ad is hidden? If not, could you give it a try?

@Kidkiwi
Copy link

Kidkiwi commented Oct 13, 2023 via email

@Kidkiwi
Copy link

Kidkiwi commented Oct 16, 2023

@alvarshahanji any updates here?

@alvarshahanji
Copy link
Contributor

@Kidkiwi We have identified and fixed a few audio related issues in 11.11.0. But apart from those, we haven't been able to repro audio issues with our test apps. Please share a test project including the tried suggestions and reproducing the issue. That would be very helpful in investigating the issue.

@Kidkiwi
Copy link

Kidkiwi commented Oct 16, 2023

@alvarshahanji What do you mean? You said this:

I could repro the issue on https://apps.apple.com/vn/app/ryahs-rhythm-crossword-puzzle/id1584491161. We are looking into it and share an update with our findings. Thank you both!

So it's clearly not fixed in the latest sdk version 11.11.3, you repo'd it on our app with that sdk version.

@alvarshahanji
Copy link
Contributor

As I mentioned I could reproduce on your app but could not recreate the same on our internal test projects. So if you could try reproducing on our demo app(or any test project) with your audio implementation and restarting the app audio when the ad is hidden, would be helpful.

@Kidkiwi
Copy link

Kidkiwi commented Oct 16, 2023

@alvarshahanji can you define exactly what 'restart the app audio' means? What is the implementation that you are referring to?

@alvarshahanji
Copy link
Contributor

You can use Unity’s API (AudioSource iirc) to pause your game sounds before you show a fullscreen ad, and resume when OnAdHiddenEvent is called

@Moayad-Rahhal
Copy link

Moayad-Rahhal commented Sep 1, 2024

@alvarshahanji Hello, the issue still happening on last versions 6.6.2 and 6.6.3

  • I have tried the version you mentioned 5.11.0 (11.11.0) and random versions between 5.11.0 and 6.6.3, and still no fix for the issue.

Unity 2022.3.32
Max SDK 5.4.7
Screenshot 2024-09-01 at 3 05 41 PM

@Kidkiwi
Copy link

Kidkiwi commented Sep 1, 2024 via email

@alvarshahanji
Copy link
Contributor

You can use Unity’s API (AudioSource iirc) to pause your game sounds before you show a fullscreen ad, and resume when OnAdHiddenEvent is called

did you try the above suggestion?

@Kidkiwi
Copy link

Kidkiwi commented Sep 3, 2024 via email

@alvarshahanji
Copy link
Contributor

Please share a test project including the tried suggestions and reproducing the issue. That would be very helpful in investigating the issue.

@AlphaFireRH
Copy link

6.6.2 not fixed. It was mute after entering the store manually on play reward video

@devSyed72
Copy link

The issue persists in the newest sdk as well. So much pain it is. Just an interstitial or rewarded plays and there goes the sound

@Emran1717
Copy link

My game's audio stops working after showing ad , specially after liftoff mediation ad (i think it happens mostly after that) . I updated to version 7.0.0 and this happening more , i had that issue with previous versions alos , but I think I mostly solved it with seting audio to ambient before showing ad and seting it back to playback after coming back to game. but that trick is not working , in previous issues voluming up in the game or going to home and comming back to the game was solving the issue. but in this new issue I need close the game and reopen it completely !

@alvarshahanji
Copy link
Contributor

@Emran1717 thank you for reporting and sharing the details on some of the ways to try to fix the issue.

If the issue is with liftoff ads, please reach out to the liftoff team.

If you notice with AppLovin ads as well, please share a sample project where the issue can be reproduced. That will help with investigation and will be able to make progress.

@chribbe
Copy link

chribbe commented Sep 25, 2024

We're also seeing this issue with the latest version of Max for unity iOS. Pretty sure it happens after an Applovin ad for Royal Match. I'm gonna see if we can get a verbose logging output when it happens.

@Coco0007
Copy link

Coco0007 commented Oct 11, 2024

Is there anything new on that? We have the same problem with Ads from AppLovin (Unity Plugin Version 7.0.0 and iOS Adapter Version 13.0.0)...

ps: It's a bit strange, as this doesn't happen with the AppLovin TEST ads. On our side all AppLovin ads are affected, not just from Royal Match.

ps2: It does happen on Unity Version 2020.3.48f1 but not on Unity Version 2022.3.50f1

@JJBlueOx
Copy link

We have been getting a lot of complaints about this issue: randomly our app will stop playing all in-app sounds. The only way to fix it is to quit and relaunch the app.

We have replicated this problem internally with the live app. It may be tied to rotation of banner ads, as all the support emails have mentioned that it happens during gameplay - when they would see banners but not any other ad format.

This is happening with ads from many different providers, so it seems like Applovin MAX is the common denominator.

By the way, this same problem has been happening for a couple weeks in your own Hexa Sort app.

Please look into this issue.

@alvarshahanji
Copy link
Contributor

@JJBlueOx We don't controls the audio for other network ads. So please report to individual networks where you see an issue.

We are looking into AppLovin audio issues and will update this thread when we add more fixes.

Since you mentioned banners, there is a known issue with Liftoff SDK 7.4.0 and 7.4.1 where Liftoff banners is cutting the app audio, it is fixed in Liftoff SDK 7.4.2. So update the adapter accordingly if you are using any of these versions.

@LingXin94
Copy link

I had the same problem with iPhone

Environment:
MaxUnitySDK version: 8.0.1
ApplovinSDK version: 13.0.1
Unity version: 2022.3.51f1
XCode version: 16.1
iOS version: 16.7.10

Repeat steps:

  1. Show AD
  2. Switch the app to the background, wait 2 seconds, and tap the icon to open the app. Repeat five or six times
  3. Wait until the AD is closed and the app sound does not resume

@keremaydin52
Copy link

I had the same issue and this has solved my problem.

First, save the current audio configuration before playing the ad. I have done it in Start method.

private static AudioConfiguration _audioConfiguration;
_audioConfiguration = AudioSettings.GetConfiguration();

Then reset the audio configuration after the ad and set the volume for audio sources. In my case, I have two audio sources, one for music and one for Sfx. You also need to call Play method if you're playing a music.

AudioSettings.Reset(_audioConfiguration);
musicSource.volume = musicVolume;
musicSource.Play();
sfxSource.volume = sfxVolume;

@LingXin94
Copy link

LingXin94 commented Dec 17, 2024

I had the same issue and this has solved my problem.

First, save the current audio configuration before playing the ad. I have done it in Start method.

private static AudioConfiguration _audioConfiguration;
_audioConfiguration = AudioSettings.GetConfiguration();

Then reset the audio configuration after the ad and set the volume for audio sources. In my case, I have two audio sources, one for music and one for Sfx. You also need to call Play method if you're playing a music.

AudioSettings.Reset(_audioConfiguration);
musicSource.volume = musicVolume;
musicSource.Play();
sfxSource.volume = sfxVolume;

@keremaydin52 Thanks! This solution solved my problem.

@Eldirfar
Copy link

The fix and the repro mentioned above worked. Wow, why is it taking so long to fix something like that? Not to mention why are you messing with audio in the first place?

I noticed different logs when the audio stops

Correct logs
[AppLovinSdk] DEBUG [ALAudioSessionManager] Updating audio session to category AVAudioSessionCategoryAmbient with options 0
[AppLovinSdk] DEBUG [ALAudioSessionManager] Restoring original category AVAudioSessionCategoryAmbient and options 1...
[AppLovinSdk] DEBUG [ALAudioSessionManager] Restored original audio session category

Logs after which audio stops
[AppLovinSdk] DEBUG [ALAudioSessionManager] Updating audio session to category AVAudioSessionCategoryAmbient with options 0
[AppLovinSdk] DEBUG [ALTaskDeactivateAudioSession] Deactivating audio sesion...
[AppLovinSdk] ERROR [ALTaskDeactivateAudioSession] Failed to set audio session inactive. Session deactivation failed
[AppLovinSdk] DEBUG [ALTaskDeactivateAudioSession] Restoring original category AVAudioSessionCategoryAmbient...original options 1...
[AppLovinSdk] DEBUG [ALTaskDeactivateAudioSession] Restored original audio session category.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests