Initialization /
API for MoPub SDK initialization.
Public Properties
public static string /SdkName /+5.0.0
- Description: Returns a human-readable string of the MoPub SDK being used. A String with the MoPub SDK platform and version.
public static bool /IsSdkInitialized /+5.0.0
- Description: Flag indicating if the SDK has been initialized. Returns
true
if a call to initialize the SDK has been made;false
otherwise.
public static LogLevel /SdkLogLevel /+5.0.0
- Description: MoPub SDK log level. The default value is:
MPLogLevelInfo
before SDK initialization;MPLogLevelNone
after SDK initialization. Refer toMoPub.MoPub.LogLevel
for all possible options. Can also be set viaMoPub.MoPub.SdkConfiguration
onMoPub.MoPub.InitializeSdk(MoPub.SdkConfiguration)
.
public static bool /AllowLegitimateInterest /+5.5.0
- Description: Allow supported SDK networks to collect user information on the basis of legitimate interest.
Public Methods
public static void /InitializeSdk(string anyAdUnitId) /+5.0.0
-
Description: Asynchronously initializes the relevant (Android or iOS) MoPub SDK. Refer to
MoPubManager.OnSdkInitializedEvent
for resulting triggered event. The MoPub SDK needs to be initialized onStart()
to ensure all other objects have been enabled first. (Start()
rather thanAwake()
so thatMoPubManager
has had time toAwake()
andOnEnable()
in order to receive event callbacks.) -
Parameters:
anyAdUnitId
: String with any ad unit ID used by this app.
public static void /InitializeSdk(SdkConfiguration sdkConfiguration) /+5.0.0
-
Description: Asynchronously initializes the relevant (Android or iOS) MoPub SDK. Call this before making any rewarded ads or advanced bidding requests. This will perform the rewarded ad custom event initialization any number of times, but the SDK itself can only be initialized once, and the rewarded ads module can only be initialized once. Refer to
MoPubManager.OnSdkInitializedEvent
for the resulting triggered event. The MoPub SDK needs to be initialized onStart()
to ensure all other objects have been enabled first. ((Start()
rather thanAwake()
, so thatMoPubManager
has had time toAwake()
andOnEnable()
in order to receive event callbacks.) -
Parameters:
sdkConfiguration
: The configuration including at least an ad unit. Refer toMoPub.SdkConfiguration
for details.
public static void /LoadBannerPluginsForAdUnits(string[] adUnitIds) /+5.0.0
-
Description: Initializes a platform-specific MoPub SDK banner plugin for each given ad unit.
-
Parameters:
adUnitIds
: The ad units for which to initialize plugins.
public static void /LoadInterstitialPluginsForAdUnits(string[] adUnitIds) /+5.0.0
-
Description: Initializes a platform-specific MoPub SDK interstitial plugin for each given ad unit.
-
Parameters:
adUnitIds
: The ad units for which to initialize plugins.
public static void /LoadRewardedVideoPluginsForAdUnits /+5.0.0
-
Description: Initializes a platform-specific MoPub SDK interstitial plugin for each given ad unit.
-
Parameters:
adUnitIds
: The ad units for which to initialize plugins.
public static void /EnableLocationSupport(bool shouldUseLocation) /+5.0.0
-
Description: Enables or disables location support for banners and interstitials.
-
Parameters:
shouldUseLocation
: Whether location should be enabled or not.
public static void /ReportApplicationOpen(string iTunesAppId) /+5.0.0
-
Description: Reports an app download to MoPub.
-
Parameters:
iTunesAppId
: The app ID on the App Store (only applicable to iOS). Default value is null.
public static void /DisableViewability() /+5.14.0
-
Description: Disables viewability measurement for the rest of the app session.
-
Parameters: None.
Last updated March 30, 2021
TWITTER, MOPUB, and the Bird logo are trademarks of Twitter, Inc. or its affiliates. All third party logos and trademarks included are the property of their respective owners.
© 2021 MoPub (a division of Twitter, Inc.)