Login
Welcome
Login

Audio Management

InRead and Banner:

Device unmuted = sound is OFF by default. Switched ON with a tap on the unmute button.

Device muted = sound is OFF by default. Switched ON by switching the physical mute button (iOS) or increasing the Media Volume (Android).

Interstitial and Rewarded:

Device unmuted = sound is ON by default. Switched OFF by a tap on the mute button.

Device muted = sound is OFF by default. Switched ON by switching the mute physical button (iOS) or increase the Media Volume (Android)

Audio mix management

By default, the Teads inApp SDK handles the audio session by setting its category to ambient. This means that all the audio played by other applications will simply mix with the ad sound.

If you chose to handle the audio session by yourself you'll need to call disableTeadsAudioSessionManagement in adSettings.

let teadsAdPlacementSettings = TeadsAdPlacementSettings { settings in
    settings.disableTeadsAudioSessionManagement()
}

When called on didReceiveAd you should register on playbackDelegate

func didReceiveAd(ad: TeadsInReadAd, adRatio: TeadsAdRatio) {
    ...
    ad.playbackDelegate = self // register to playbackDelegate
}

Then you should implement TeadsPlaybackDelegate in order to know when we mute/unmute our ads.

Note

If you are using an audio session with a category that is non-mixable, all sound from other applications (eg: Spotify) would be stopped when an ad will start playing (even an ad without sound). This is due to Apple's default behavior with a video player.

To prevent that and preserve optimal user experience, please make sure that your audio session category is mixable. You can add mixWithOthers from AVAudioSession.CategoryOptions in some category (like .playback).

Implement the two methods of the TeadsPlaybackDelegate

func adStartPlayingAudio(_ ad: TeadsAd) {
    //you can choose for example to shut down any other sound in your app
}
func adStopPlayingAudio(_ ad: TeadsAd) {
    // you can reactivate all sound in your app
}

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.