Enhance your app's monetization potential with InMobi's cutting-edge Audio Ads feature. With InMobi's SDK support for Audio Ads, you can seamlessly integrate high-quality, targeted audio advertisements into your app's audio content. Engage your users with relevant and captivating audio messages that fit seamlessly within their experience.
Click here to download the InMobi Unity Package, which you can import as a Custom Package into your project.
Ensure that you possess compatible versions to utilize InMobi Audio Icons. For iOS, the version should be 10.5.6 or before; for Android, the version should be 10.5.7 or later.
AudioIconPlugin
prefab within your game scene to display the audio ad's desired location. You can use a placeholder icon to align the advertisement within the editor.InMobiAudioController
script to the prefab and then pass the reference for the Audio Icon Plugin.Initiate the Plugin to guarantee the InMobi SDK's initialization and the listeners' attachment. We recommend temporarily deactivating your game's music (if applicable) while the ad is playing and resuming it once the audio ad concludes, utilizing the OnAudioStatusChanged
event.
using System;
using UnityEngine;
using InMobi.Ads;
public class InMobiAudioController : MonoBehaviour
{
private const string ACCOUNT_ID = "YOUR_INMOBI_ACCOUNT_ID";
public static InMobiAudioController instance = null;
public AudioIconPlugin AudioIconPlugin;
private void Awake()
{
if (instance == null)
{
instance = this;
DontDestroyOnLoad(gameObject);
AttachAudioListeners();
}
else
{
Destroy(this);
}
}
private void Start()
{
InMobiPlugin.Init(ACCOUNT_ID);
}
private void AttachAudioListeners()
{
AudioIconPlugin.OnAdLoadSucceeded += delegate (object sender, AdMetaInfo adMetaInfo)
{
isAudioAdReady = true;
};
AudioIconPlugin.OnAudioStatusChanged += delegate (object sender, AdAudioStatusEventArgs e) {
if (e.AudioStatus == AudioStatus.PLAYING)
{
// toggle off background music
}
else if (e.AudioStatus == AudioStatus.COMPLETED || e.AudioStatus == AudioStatus.PAUSED)
{
// toggle background music on again
}
};
}
To request an audio ad, call the load()
method on the InMobiAudio
instance:
public void LoadAudioAd()
{
if (AudioIconPlugin != null)
{
AudioIconPlugin.LoadAd();
}
}
To show an audio ad after a successful load, call ShowAd()
.
if(isAudioAdReady){
AudioIconPlugin.ShowAd();
}
The implementation for Rewarded Audio Icon ads closely resembles that of Audio Icons.
You are expected to present a prompt to users, seeking their opt-in prior to displaying the rewarded audio icon ad. The InMobi SDK also offers the onRewardsUnlocked
event for Rewarded ads. However, you can retain the flexibility to determine the timing of user rewards using various event callbacks.
AudioIconPlugin.OnAdRewardActionCompleted += delegate (object sender, AdRewardActionCompletedEventArgs e) {
Debug.Log("[InMobi-Unity] OnAdRewardActionCompleted " + e.Rewards);
// pass rewards to the user
};
Using sandbox ads, you can assess the placement and refine the user experience. This involves configuring the placement in Test Mode, setting it as 'Global' within the placement settings. It's important to ensure that you set the device volume to a sufficient level to ensure ad playback.
For those employing manual SDK integration, it's imperative to initialize the InMobi SDK within the mediation debugger to ensure seamless operation and accurate evaluation.
By installing this SDK update, you agree that your Children Privacy Compliance setting remains accurate or that you will update that setting, whenever there is a change in your app's audience. You may update the app's Children Privacy Compliance settings at https://publisher.inmobi.com/my-inventory/app-and-placements.