Begin by following the instructions in the basic integration article, and then the instructions for any of the ad formats you want to integrate (interstitial or rewarded ads, banner ads, MREC ads). This article contains supplementary information and assumes you have completed basic integration.
Create a VungleSDKConfig
object and add it as a parameter in your SDK initialization to specify optional configuration settings.
VungleSDKConfig sdkConfig = new VungleSDKConfig(); sdkInstance = AdFactory.GetInstance(appID, sdkConfig);
VungleSDKConfig
contains parameters that allow you to limit Windows ASHWID
tracking and set the minimum disk space required to initialize or load ads. We recommend that you contact Vungle support before using any of these features. There are also additional properties not listed below, which can be set in VungleSDKConfig
, but these should only be used when requested by a Vungle support person.
sdkConfig.DisableAshwidTracking = true; sdkConfig.MinimumDiskSpaceForAd = 50 * 1024 * 1024; sdkConfig.MinimumDiskSpaceForInit = 50 * 1024 * 1024;
These are the available properties in the AdConfig
object instance.
Options |
Default Value/ |
Description |
|
AutoRotate DisplayOrientations |
Note: This option only applies to mobile applications. |
|
true bool |
Sets the starting sound state for the ad. If true (default), the audio respects device volume and sound settings. If false, video begins muted but user may modify. |
|
false bool |
If true, allows the user to immediately exit an ad using the back button. If false (default), the user cannot use the back button to exit the ad until the on-screen close button is shown. Note: This option only applies to mobile applications. |
|
1.0 double |
This setting represents a fraction of the device volume and accepts values between 0.0 and 1.0. Note: This setting is only available for v6.3.0 and above. |
|
- |
DEPRECATED You can set the rewarded configuration at the placement level from the dashboard. Refer to Setting Up and Reporting on Placements. |
The options for SoundEnabled
and incentivized dialogs for Dynamic Template ads are available on the dashboard to configure. Programmatic configuration will only apply to legacy ads.
To control whether a user has the option to close out of an ad, use the forced view options in your app's advanced settings on the Vungle Dashboard.
As of May 25, 2019, the General Data Protection Regulation (GDPR) is enforced in the European Union. To comply with GDPR, developers have two options.
- Option 1 (recommended): Allow Vungle to handle the requirements. Vungle will display a consent dialog before playing an ad for a European user, and will remember the user’s consent or rejection for subsequent ads.
- Option 2: Publisher controls the GDPR consent process at the user level, then communicates the user’s choice to Vungle. To do this, developers can collect the user’s consent using their own mechanism, and then use Vungle APIs to update or query the user’s consent status. Refer to the sample code below for details.
// To set the user’s consent status as opted in to version 1.0 of your consent dialog:
sdkInstance.UpdateConsentStatus(VungleConsentStatus.VungleConsentAccepted,"1.0");
// To set the user’s consent status as opted out of version 2.0 of your consent dialog:
sdkInstance.UpdateConsentStatus(VungleConsentStatus.VungleConsentDenied,"2.0"); // To find out what the user’s current consent status is: // This will return null if the GDPR Consent status has not been set // Otherwise, it will return VungleConsentStatus.VungleConsentAccepted or // VungleConsentStatus.VungleConsentDenied UpdateConsentStatus? currentStatus = sdkInstance.GetCurrentConsentStatus();
// To find out which version of your consent dialog the user was last shown:
sdkInstance.GetConsentMessageVersion();
If you are using Vungle SDK v6.2 or lower, set the consent status as follows:
// To set the user’s consent status on SDK versions 6.2 and below:
sdkInstance.UpdateConsentStatus(VungleConsentStatus.VungleConsentAccepted);