The Nexverse SDK enables you to monetize your Android application with various types of high-quality ads. This guide provides step-by-step instructions for integrating the SDK and implementing different Ad formats.
Depending on the Ad formats you want to support, you may need to add additional dependencies.
Video Banner Ads:
If you want to support video Ads on Media3 or Exo player, you will need to add one of the following dependencies:
Media3 Dependency:
implementation("ai.nexverse:ai-nexverse-sdk-media3-extn:x.x.x") // Replace x.x.x with the latest version
ExoPlayer Dependency:
implementation("ai.nexverse:ai-nexverse-sdk-exo-extn:x.x.x") // Replace x.x.x with the latest version
info
Note Choose either Media3 or ExoPlayer based on your app’s requirements. Both libraries are not needed simultaneously. If you are not using these libraries, our SDK will utilize Android’s native media view.
The SDK must be initialized before requesting any ads. This one-time initialization sets up the SDK with your account configuration and prepares it for Ad delivery. SDK can be initialized from activity or fragment or application, we recommend to initialize the sdk from Application class’s onCreate() method.
info
Note SDK should be initialized from main thread only.
info
Note If initialization and Ad request are triggered from the same class then ensure the Ad request call is made inside onInitializationComplete only when the result matches InitializationStatus.SUCCEEDED or InitializationStatus.SERVER_STATUS_WARNING.
Create the initialization configuration:
val initInfo = InitConfig(
context = context,
accountId = "replace-with-actual-account-id",
videoPlayerProviderClass = VideoPlayerViewImpl::class.java // Optional, for video Ads to select player
)
InitConfig initInfo = new InitConfig(
context,
"replace-with-actual-account-id",
VideoPlayerViewImpl.class // Optional, for video Ads to select player
);
Initialize the SDK:
NexverseAdManager.init(initInfo, object : SdkInitializationListener {
override fun onInitializationComplete(status: InitializationStatus) {
when (status) {
InitializationStatus.SUCCEEDED -> {
Log.d(TAG, "Nexverse SDK initialized successfully")
// Initialization successful, can load Ad from here.
}
InitializationStatus.FAILED -> {
Log.e(TAG, "Nexverse SDK initialization failed with error: ${status.description}")
// Initialization failed.
}
InitializationStatus.SERVER_STATUS_WARNING -> {
Log.e(TAG, "Nexverse SDK initialization warning: ${status.description}")
// Server status warning, can load Ad from here.
}
}
}
})
NexverseAdManager.INSTANCE.init(initInfo, new SdkInitializationListener() {
@Override
public void onInitializationComplete(@NotNull InitializationStatus status) {
switch (status) {
case SUCCEEDED:
Log.d(TAG, "Nexverse SDK initialized successfully");
// SDK initialized successfully
break;
case SERVER_STATUS_WARNING:
Log.w(TAG, "Nexverse SDK initialized with warnings: " + status.getDescription());
// SDK initialized with warnings
break;
case FAILED:
Log.e(TAG, "Nexverse SDK initialization failed: " + status.getDescription());
// SDK initialization failed
break;
}
}
});
Application/activity/fragment context to initialize SDK
accountId
Account Id shared by the Nextverse team.
videoPlayerProviderClass
VideoPlayerViewImpl::class.java if using exo or media3 extension, otherwise leave empty.
Get SDK Initialize status :
Description:
This method is used to check whether the SDK has been successfully initialized in the application. It helps developers verify that the SDK is ready before making Ad requests, ensuring smooth ad/request handling and preventing unexpected errors.
Return Value:
true → SDK is initialized and ready to use.
false → SDK is not initialized, possibly due to missing configuration, network issues, or incorrect account Id.
val isInitialized = NexverseAdManager.isSdkInitialized()
Sets the global OpenRTB (oRTB) configuration parameters used for Ad requests.
Parameters:
targetingParams: JSON string containing key-value pairs for targeting (e.g., user segments, interests, demographics).
Recommended Usage:
Call this once during initialization to set global parameters.
Can also be updated later if targeting information changes (e.g., after user login).
Configures the SDK with the user’s GDPR consent string. This is typically obtained from a CMP (Consent Management Platform).
Parameters:
gdprConsentString: The IAB-compliant GDPR consent string representing the user’s preferences.
Recommended Usage:
Call this method before requesting Ads to ensure consent is respected.
Update whenever a new consent string is obtained from the CMP.
Specifies whether the user is subject to COPPA (Children’s Online Privacy Protection Act) compliance.
Parameters:
coppaConsent: Pass true if COPPA applies to the user, otherwise false.
Recommended Usage:
Call during SDK initialization if your app is directed towards children under 13 or needs COPPA compliance.
Once set, should not be changed during the session.
Nexverse SDK offers a comprehensive suite of Ad formats to help you maximize your app’s revenue potential. Each format is designed to provide a seamless user experience while delivering effective advertising content.
Banner Ads are rectangular display units that occupy a portion of your app’s layout. The SDK supports both HTML and Video banner formats. These Ads can be placed at various positions within your app’s interface and can be configured to refresh automatically at specified intervals.
private var bannerView: BannerView? = null
bannerView = BannerView(
this,
CONFIG_ID,
FLOOR_PRICE,
AdSize(WIDTH, HEIGHT)
)
// Set video placement type
bannerView?.videoPlacementType = VideoPlacementType.IN_BANNER
// Set up callbacks for banner events
bannerView?.setBannerListener(object : BannerViewListener {
override fun onAdFailed(bannerView: BannerView?, exception: AdException?) {
Log.e("InAppVideoBanner", "Ad failed: ${exception?.message}")
}
override fun onAdLoaded(bannerView: BannerView?) {}
override fun onAdClicked(bannerView: BannerView?) {}
override fun onAdDisplayed(bannerView: BannerView?) {}
override fun onAdClosed(bannerView: BannerView?) {}
})
// Set up callbacks for video-specific events
bannerView?.setBannerVideoListener(object : BannerVideoListener {
override fun onVideoCompleted(bannerView: BannerView?) {
// Video playback completed
}
override fun onVideoPaused(bannerView: BannerView?) {
// Video was paused
}
override fun onVideoResumed(bannerView: BannerView?) {
// Video playback resumed
}
override fun onVideoUnMuted(bannerView: BannerView?) {
// Video was unmuted
}
override fun onVideoMuted(bannerView: BannerView?) {
// Video was muted
}
})
bannerView?.loadAd()
// Add the banner view to your layout
adWrapperView.addView(bannerView)
BannerView adView = null;
adView = new BannerView(this, CONFIG_ID, FLOOR_PRICE, new AdSize(WIDTH, HEIGHT));
adView.setVideoPlacementType(VideoPlacementType.IN_BANNER);
adView.setBannerListener(new BannerViewListener() {
@Override
public void onAdLoaded(BannerView bannerView) {}
@Override
public void onAdDisplayed(BannerView bannerView) {}
@Override
public void onAdFailed(BannerView bannerView, AdException exception) {}
@Override
public void onAdClicked(BannerView bannerView) {}
@Override
public void onAdClosed(BannerView bannerView) {}
});
adView.setBannerVideoListener(new BannerVideoListener() {
@Override
public void onVideoCompleted(BannerView bannerView) {
// Video playback completed
}
@Override
public void onVideoPaused(BannerView bannerView) {
// Video was paused
}
@Override
public void onVideoResumed(BannerView bannerView) {
// Video playback resumed
}
@Override
public void onVideoUnMuted(BannerView bannerView) {
// Video was unmuted
}
@Override
public void onVideoMuted(BannerView bannerView) {
// Video was muted
}
});
adView.loadAd();
adWrapperView.addView(adView);
Interstitial Ads are full-screen Ads that cover the interface of their host app. They’re typically displayed at natural transition points in your app’s flow, such as between levels in a game, between activities, or after completing a task. The SDK supports both display (static) and video interstitial formats, as well as a multi-format option that can handle both types.
Display interstitials show full-screen static Ads that can include images and interactive elements. They typically load faster than video interstitials and are great for areas with slower internet connections.
private var interstitialAdUnit: InterstitialAdUnit? = null
interstitialAdUnit = InterstitialAdUnit(this, CONFIG_ID, EnumSet.of(AdUnitFormat.BANNER), FLOOR_PRICE)
interstitialAdUnit?.setInterstitialAdUnitListener(object : InterstitialAdUnitListener {
override fun onAdLoaded(interstitialAdUnit: InterstitialAdUnit?) {
interstitialAdUnit?.show()
}
override fun onAdDisplayed(interstitialAdUnit: InterstitialAdUnit?) {
// Ad displayed to user
}
override fun onAdFailed(interstitialAdUnit: InterstitialAdUnit?, e: AdException?) {
// Ad failed to load
}
override fun onAdClicked(interstitialAdUnit: InterstitialAdUnit?) {
// Ad was clicked
}
override fun onAdClosed(interstitialAdUnit: InterstitialAdUnit?) {
// Ad was closed by user
}
})
interstitialAdUnit?.loadAd()
InterstitialAdUnit interstitialAdUnit = null;
interstitialAdUnit = new InterstitialAdUnit(this, CONFIG_ID, EnumSet.of(AdUnitFormat.BANNER), FLOOR_PRICE);
interstitialAdUnit.setInterstitialAdUnitListener(new InterstitialAdUnitListener() {
@Override
public void onAdLoaded(InterstitialAdUnit interstitialAdUnit) {
interstitialAdUnit.show();
}
@Override
public void onAdDisplayed(InterstitialAdUnit interstitialAdUnit) {
// Ad displayed to user
}
@Override
public void onAdFailed(InterstitialAdUnit interstitialAdUnit, AdException exception) {
// Ad failed to load
}
@Override
public void onAdClicked(InterstitialAdUnit interstitialAdUnit) {
// Ad was clicked
}
@Override
public void onAdClosed(InterstitialAdUnit interstitialAdUnit) {
// Ad was closed by user
}
});
interstitialAdUnit.loadAd();
Video interstitials deliver full-screen video Ad experiences. They typically have higher engagement rates and eCPMs compared to display interstitials, but may require more bandwidth and loading time.
private var interstitialAdUnit: InterstitialAdUnit? = null
interstitialAdUnit = InterstitialAdUnit(this, CONFIG_ID, EnumSet.of(AdUnitFormat.VIDEO), FLOOR_PRICE)
interstitialAdUnit?.setInterstitialAdUnitListener(object : InterstitialAdUnitListener {
override fun onAdLoaded(interstitialAdUnit: InterstitialAdUnit?) {
interstitialAdUnit?.show()
}
override fun onAdDisplayed(interstitialAdUnit: InterstitialAdUnit?) {
// Ad displayed to user
}
override fun onAdFailed(interstitialAdUnit: InterstitialAdUnit?, e: AdException?) {
// Ad failed to load
}
override fun onAdClicked(interstitialAdUnit: InterstitialAdUnit?) {
// Ad was clicked
}
override fun onAdClosed(interstitialAdUnit: InterstitialAdUnit?) {
// Ad was closed by user
}
})
interstitialAdUnit?.loadAd()
InterstitialAdUnit interstitialAdUnit;
interstitialAdUnit = new InterstitialAdUnit(this, CONFIG_ID, EnumSet.of(AdUnitFormat.VIDEO), FLOOR_PRICE);
interstitialAdUnit.setInterstitialAdUnitListener(new InterstitialAdUnitListener() {
@Override
public void onAdLoaded (InterstitialAdUnit interstitialAdUnit){
interstitialUnit.show();
}
@Override
public void onAdDisplayed (InterstitialAdUnit interstitialAdUnit){
// Ad display to user
}
@Override
public void onAdFailed (InterstitialAdUnit interstitialAdUnit, AdException exception){
// Ad failed to load
}
@Override
public void onAdClicked (InterstitialAdUnit interstitialAdUnit){
// Ad was clicked
}
@Override
public void onAdClosed (InterstitialAdUnit interstitialAdUnit){
// Ad was closed by user
}
});
interstitialAdUnit.loadAd();
Recommended:
MultiFormat interstitials provide the most flexibility by supporting both display and video Ads in a single implementation. This format automatically selects the best available Ad type based on:
Ad availability
Network conditions
Historical performance
User preferences
To implement a MultiFormat interstitial that can serve both video and display ads:
interstitialUnit = new InterstitialAdUnit(this, CONFIG_ID, EnumSet.of(AdUnitFormat.VIDEO, AdUnitFormat.BANNER), FLOOR_PRICE);
This configuration maximizes fill rate by being able to serve either Ad type, while the SDK handles all the complexity of format selection and delivery. The Ad type selection is optimized automatically to provide the best balance of user experience and revenue.
Native Ads offer the most flexible and customizable Ad experience. They allow you to match the look and feel of your app by customizing every visual element of the Ad. This seamless integration can lead to better user experience and higher engagement rates. Native Ads are particularly effective in content feeds, article lists, or any situation where you want the Ad to feel like a natural part of your app.
private var nativeAdUnit: NativeAdUnit? = null
private var frameAdWrapper: FrameLayout? = null
private fun createAd() {
val extras = Bundle()
nativeAdUnit = configureNativeAdUnit()
nativeAdUnit?.fetchDemand(extras) { resultCode ->
// Invoke NativeAdProvider.getNativeAd(extras) to get the NexverseNativeAd object to render
// Example: inflateNativeAd(NativeAdProvider.getNativeAd(extras))
}
}
private fun configureNativeAdUnit(): NativeAdUnit? {
val nativeAdUnit = NativeAdUnit(CONFIG_ID, FLOOR_PRICE)
nativeAdUnit.setContextType(NativeAdUnit.CONTEXT_TYPE.SOCIAL_CENTRIC)
nativeAdUnit.setPlacementType(NativeAdUnit.PLACEMENTTYPE.CONTENT_FEED)
nativeAdUnit.setContextSubType(NativeAdUnit.CONTEXTSUBTYPE.GENERAL_SOCIAL)
// Configure tracking methods
val method = ArrayList<ai.nexverse.sdk.core.NativeEventTracker.EVENT_TRACKING_METHOD>()
method.add(ai.nexverse.sdk.core.NativeEventTracker.EVENT_TRACKING_METHOD.IMAGE)
method.add(ai.nexverse.sdk.core.NativeEventTracker.EVENT_TRACKING_METHOD.JS)
val tracker = ai.nexverse.sdk.core.NativeEventTracker(IMPRESSION, method)
nativeAdUnit.addEventTracker(tracker)
// Configure required assets
val title = NativeTitleAsset()
title.setLength(90)
title.isRequired = true
nativeAdUnit.addAsset(title)
val icon = NativeImageAsset(20, 20, 20, 20)
icon.imageType = NativeImageAsset.IMAGE_TYPE.ICON
icon.isRequired = true
nativeAdUnit.addAsset(icon)
val image = NativeImageAsset(200, 200, 200, 200)
image.imageType = NativeImageAsset.IMAGE_TYPE.MAIN
image.isRequired = true
nativeAdUnit.addAsset(image)
val data = NativeDataAsset()
data.len = 90
data.dataType = NativeDataAsset.DATA_TYPE.SPONSORED
data.isRequired = true
nativeAdUnit.addAsset(data)
val body = NativeDataAsset()
body.isRequired = true
body.dataType = NativeDataAsset.DATA_TYPE.DESC
nativeAdUnit.addAsset(body)
val cta = NativeDataAsset()
cta.isRequired = true
cta.dataType = NativeDataAsset.DATA_TYPE.CTATEXT
nativeAdUnit.addAsset(cta)
return nativeAdUnit
}
/* Example to inflate native view */
private fun inflateNativeAd(ad: NexverseNativeAd?) {
val nativeContainer = LinearLayout(this)
nativeContainer.orientation = LinearLayout.VERTICAL
val iconAndTitle = LinearLayout(this)
iconAndTitle.orientation = LinearLayout.HORIZONTAL
val icon = ImageView(this)
icon.layoutParams = LinearLayout.LayoutParams(160, 160)
ImageUtils.download(ad?.iconUrl.orEmpty(), icon)
iconAndTitle.addView(icon)
val title = TextView(this)
title.textSize = 20f
title.text = ad?.title
iconAndTitle.addView(title)
nativeContainer.addView(iconAndTitle)
val image = ImageView(this)
image.layoutParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT
)
ImageUtils.download(ad?.imageUrl.orEmpty(), image)
nativeContainer.addView(image)
val description = TextView(this)
description.textSize = 18f
description.text = ad?.description
nativeContainer.addView(description)
val cta = Button(this)
cta.text = ad?.callToAction
nativeContainer.addView(cta)
// Add native Ad container to your layout
frameAdWrapper.addView(nativeContainer)
// Register the Ad view for tracking
ad?.registerView(
frameAdWrapper,
listOf(icon, title, image, description, cta),
// Implement NativeAdEventListener to get event callbacks
object : NativeAdEventListener {
override fun onAdClicked() {
// Ad was clicked
}
override fun onAdImpression() {
// Ad impression recorded
}
override fun onAdExpired() {
// Ad expired
}
}
)
}
override fun onDestroy() {
super.onDestroy()
nativeAdUnit?.destroy()
}
private NativeAdUnit nativeAdUnit;
private FrameLayout frameAdWrapper;
private void createAd() {
Bundle extras = new Bundle();
nativeAdUnit = configureNativeAdUnit();
nativeAdUnit.fetchDemand(extras, demandResult -> {
inflatePrebidNativeAd(NativeAdProvider.getNativeAd(extras));
});
}
private NativeAdUnit configureNativeAdUnit() {
NativeAdUnit nativeAdUnit = new NativeAdUnit(CONFIG_ID);
nativeAdUnit.setContextType(NativeAdUnit.CONTEXT_TYPE.SOCIAL_CENTRIC);
nativeAdUnit.setPlacementType(NativeAdUnit.PLACEMENTTYPE.CONTENT_FEED);
nativeAdUnit.setContextSubType(NativeAdUnit.CONTEXTSUBTYPE.GENERAL_SOCIAL);
ArrayList<NativeEventTracker.EVENT_TRACKING_METHOD> method = new ArrayList();
method.add(NativeEventTracker.EVENT_TRACKING_METHOD.IMAGE);
method.add(NativeEventTracker.EVENT_TRACKING_METHOD.JS);
NativeEventTracker tracker = new NativeEventTracker(NativeEventTracker.EVENT_TYPE.IMPRESSION, method);
nativeAdUnit.addEventTracker(tracker);
NativeTitleAsset title = new NativeTitleAsset();
title.setLength(90);
title.setRequired(true);
nativeAdUnit.addAsset(title);
NativeImageAsset icon = new NativeImageAsset(20, 20, 20, 20);
icon.setImageType(NativeImageAsset.IMAGE_TYPE.ICON);
icon.setRequired(true);
nativeAdUnit.addAsset(icon);
NativeImageAsset image = new NativeImageAsset(200, 200, 200, 200);
image.setImageType(NativeImageAsset.IMAGE_TYPE.MAIN);
image.setRequired(true);
nativeAdUnit.addAsset(image);
NativeDataAsset data = new NativeDataAsset();
data.setLen(90);
data.setDataType(NativeDataAsset.DATA_TYPE.SPONSORED);
data.setRequired(true);
nativeAdUnit.addAsset(data);
NativeDataAsset body = new NativeDataAsset();
body.setRequired(true);
body.setDataType(NativeDataAsset.DATA_TYPE.DESC);
nativeAdUnit.addAsset(body);
NativeDataAsset cta = new NativeDataAsset();
cta.setRequired(true);
cta.setDataType(NativeDataAsset.DATA_TYPE.CTATEXT);
nativeAdUnit.addAsset(cta);
return nativeAdUnit;
}
private void inflatePrebidNativeAd(NexverseNativeAd ad) {
LinearLayout nativeContainer = new LinearLayout(this);
nativeContainer.setOrientation(LinearLayout.VERTICAL);
LinearLayout iconAndTitle = new LinearLayout(this);
iconAndTitle.setOrientation(LinearLayout.HORIZONTAL);
ImageView icon = new ImageView(this);
icon.setLayoutParams(new LinearLayout.LayoutParams(160, 160));
ImageUtils.INSTANCE.download(ad.getIconUrl(), icon);
iconAndTitle.addView(icon);
TextView title = new TextView(this);
title.setTextSize(20f);
title.setText(ad.getTitle());
iconAndTitle.addView(title);
nativeContainer.addView(iconAndTitle);
ImageView image = new ImageView(this);
image.setLayoutParams(new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT
));
ImageUtils.INSTANCE.download(ad.getImageUrl(), image);
nativeContainer.addView(image);
TextView description = new TextView(this);
description.setTextSize(18f);
description.setText(ad.getDescription());
nativeContainer.addView(description);
Button cta = new Button(this);
cta.setText(ad.getCallToAction());
nativeContainer.addView(cta);
frameAdWrapper.addView(nativeContainer);
ArrayList<View> list = new ArrayList();
list.add(icon);
list.add(title);
list.add(image);
list.add(description);
list.add(cta);
Ad.registerView(frameAdWrapper, list, new NativeAdEventListener() {
@Override
public void onAdClicked() {}
@Override
public void onAdImpression() {}
@Override
public void onAdExpired() {}
});
}
@Override
public void onDestroy() {
super.onDestroy();
nativeAdUnit.destroy();
}
info
Note For rendering images, we recommend using a standard image loading library to ensure efficient loading, caching, and memory management. You may choose from: - Glide – optimized for smooth scrolling and large image handling. - Picasso – lightweight and simple to integrate. - Custom implementation – if you prefer, you can implement your own image downloading and rendering logic.
Rewarded Ads are a powerful monetization tool that provides value to both users and developers. They allow users to earn in-app rewards (such as virtual currency, extra lives, or premium content) in exchange for watching a video Ad. This opt-in format typically sees high engagement rates and user satisfaction.
info
Note Reward will be received only if reward is set inside dashboard while configuring the Ad.
Key benefits:
Higher user engagement due to opt-in nature
Better user experience through value exchange
Increased retention through reward mechanics
Higher eCPMs compared to other Ad formats
Implementation:
Create and configure the rewarded Ad unit:
private var rewardAdUnit: RewardedAdUnit? = null
rewardAdUnit = RewardedAdUnit(this, CONFIG_ID, FLOOR_PRICE)
rewardAdUnit?.setRewardedAdUnitListener(object : RewardedAdUnitListener {
override fun onAdLoaded(rewardedAdUnit: RewardedAdUnit?) {
// Ad loaded and ready to show
rewardAdUnit?.show();
}
override fun onAdDisplayed(rewardedAdUnit: RewardedAdUnit?) {
// Ad displayed to user
}
override fun onAdFailed(rewardedAdUnit: RewardedAdUnit?, exception: AdException?) {
// Ad failed to load
}
override fun onAdClicked(rewardedAdUnit: RewardedAdUnit?) {
// Ad was clicked
}
override fun onAdClosed(rewardedAdUnit: RewardedAdUnit?) {
// Ad was closed by user
}
override fun onReward(rewardedAdUnit: RewardedAdUnit?, reward: Reward?) {
// User earned a reward
}
})
rewardAdUnit?.loadAd()
RewardedAdUnit rewardAdUnit = null;
rewardAdUnit = new RewardedAdUnit(this, CONFIG_ID);
rewardAdUnit.setRewardedAdUnitListener(new RewardedAdUnitListener() {
@Override public void onAdLoaded(RewardedAdUnit rewardedAdUnit) {
// Ad loaded and ready to show
rewardAdUnit.show();
}
@Override public void onAdDisplayed(RewardedAdUnit rewardedAdUnit) {
// Ad displayed to user
}
@Override public void onAdFailed(
RewardedAdUnit rewardedAdUnit,
AdException exception
) {
// Ad failed to load
}
@Override public void onAdClicked(RewardedAdUnit rewardedAdUnit) {
// Ad was clicked
}
@Override public void onAdClosed(RewardedAdUnit rewardedAdUnit) {
// Ad was closed by user
}
@Override public void onReward(
RewardedAdUnit rewardedAdUnit,
Reward reward
) {
// User earned a reward
}
});
rewardAdUnit.loadAd();
fun triggerLocationPermission(shouldShare: Boolean, context: Context, listener: LocationPermissionListener? = null):
Requests user consent for location sharing and handles runtime permission request if required by publisher.
This is recommended when the application does not already implement its own location permission request flow.
Parameters:
shouldShare – true if the user consents to share location information, false otherwise.
context – Context used to display the runtime permission dialog.
listener – Optional LocationPermissionListener callback to receive the permission request result.
Behavior:
If location permission is already granted:
SDK applies the consent setting (shouldShare) immediately.
Callback is invoked with PermissionResult.GRANTED.
If location permission is not granted:
SDK triggers the system runtime permission dialog.
Callback receives one of:
GRANTED → User allowed location access.
DENIED → User denied location access (but may be asked again later).
ALREADY_DENIED → User previously denied with “Don’t ask again”.
If shouldShare = false, the SDK disables location sharing regardless of permission state.
NexverseAdManager.triggerLocationPermission(true, this, object : LocationPermissionListener{
override fun onPermissionResult(result: PermissionResult) {
when(result) {
PermissionResult.GRANTED -> {
// Permission granted, proceed with location-based features
Log.d(TAG, "Location permission granted by user")
}
PermissionResult.DENIED -> {
// Permission denied, handle accordingly
Log.d(TAG, "Location permission denied by user")
}
PermissionResult.ALREADY_DENIED -> {
// Permission already denied by user
Log.d(TAG, "Location permission already by user denied")
}
}
}
})
NexverseAdManager.INSTANCE.triggerLocationPermission(true, this, new LocationPermissionListener() {
@Override
public void onPermissionResult(@NotNull PermissionResult result) {
Log.d(TAG, "Location permission granted: $result");
switch (result) {
case GRANTED:
// Permission granted, proceed with location-based features
Log.d(TAG, "Location permission granted by user");
break;
case DENIED:
// Permission denied, handle accordingly
Log.d(TAG, "Location permission denied by user");
break;
case ALREADY_DENIED:
// Permission already denied by user
Log.d(TAG, "Location permission already by user denied");
break;
}
}
});
By default, Ads rendered by the SDK may include video playback controls (play/pause) and volume controls (mute/unmute).
Developers can choose to hide these controls for a customized Ad experience.
The following methods are available depending on the Ad format:
Banner Ads
bannerView.hideVideoControl()
Hides the video playback controls (play/pause) from a banner ad’s video element.
When to use:
If you want a simplified UI where the banner video runs without user controls.
For autoplay video banners where user interaction is not required.
Example:
bannerView?.hideVideoControl()
bannerView.hideVideoControl();
Interstitial & Reward Ads
For interstitial and rewarded Ad units, you can control visibility of playback and volume controls using the InterstitialAdUnit or RewardedAdUnit object.
adUnit?.hideVolumeControls()
adUnit.hideVolumeControls();
Hides the video playback controls in interstitial or rewarded ads.
Example:
info
Note
Hiding controls does not stop video playback or audio; it only removes the UI elements.
Default behavior (if these methods are not called):
By default, Ad click will opent the landing page in the Chrome Tab. Publishers can choose other options by setting RedirectionType to the bannerView or AdUnit as below -