Package com.yandex.mobile.ads.common
Class MobileAds
- java.lang.Object
-
- com.yandex.mobile.ads.common.MobileAds
-
public final class MobileAds extends java.lang.Object
Class contains logic that applies to the Mobile Ads SDK as a whole. Right now, the only methods in it are used for enabling SDK logs, getting SDK version and enabling visibility error indicator.
-
-
Constructor Summary
Constructors Constructor Description MobileAds()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
enableDebugErrorIndicator(boolean enableIndicator)
Enable or disable visibility error indicator in Debug Mode.static void
enableLogging(boolean enableLogging)
Enables SDK logs.static java.lang.String
getLibraryVersion()
Returns the SDK version in the X.Y.Z format.static void
initialize(android.content.Context context, InitializationListener initializationListener)
Initializes the Yandex Mobile Ads SDK internal state.static void
setLocationConsent(boolean locationConsent)
Enables location usage for ad loading.static void
setUserConsent(boolean consent)
Set a value indicating whether user from GDPR region allowed to collect personal data which is used for analytics and ad targeting.
-
-
-
Method Detail
-
enableLogging
public static void enableLogging(boolean enableLogging)
Enables SDK logs. Logs are disabled by default.- Parameters:
enableLogging
- If set totrue
, logs will be enabled, otherwise disabled. Default param isfalse
.
-
setLocationConsent
public static void setLocationConsent(boolean locationConsent)
Enables location usage for ad loading. Disabled by default Location permission is still required to be granted additionally to the consent.- Parameters:
locationConsent
- If set totrue
, location will be used for ads loading, otherwise not. Default param isfalse
.
-
getLibraryVersion
public static java.lang.String getLibraryVersion()
Returns the SDK version in the X.Y.Z format.- Returns:
- The version of the SDK in X.Y.Z format.
-
enableDebugErrorIndicator
public static void enableDebugErrorIndicator(boolean enableIndicator)
Enable or disable visibility error indicator in Debug Mode. Indicator is enabled by default.- Parameters:
enableIndicator
- If set totrue
, visibility error indicator will be displayed, otherwise not.
-
setUserConsent
public static void setUserConsent(boolean consent)
Set a value indicating whether user from GDPR region allowed to collect personal data which is used for analytics and ad targeting. If the value is set to false personal data will not be collected.- Parameters:
consent
-true
if user provided consent to collect personal data, otherwisefalse
.
-
initialize
public static void initialize(@NonNull android.content.Context context, @NonNull InitializationListener initializationListener)
Initializes the Yandex Mobile Ads SDK internal state.- Parameters:
context
- The application context.initializationListener
- A listener for receiving notifications about SDK initialization complete.
-
-