MobileAds

@objc(YMAMobileAds)
@objcMembers
public class MobileAds : NSObject

Undocumented

  • Enables logging. By default, logging is disabled.

    Declaration

    Swift

    public static func enableLogging()
  • Returns the SDK version in the X.YY format.

    Declaration

    Swift

    public static func sdkVersion() -> String

    Return Value

    The version of the SDK in X.YY format.

  • Undocumented

    Declaration

    Swift

    public static func audioSessionManager() -> AudioSessionManager
  • The SDK automatically collects location data if the user allowed the app to track the location. This option is enabled by default.

    Declaration

    Swift

    public static func setLocationTrackingEnabled(_ enabled: Bool)

    Parameters

    enabled

    Enables or disables collecting location data.

  • Enables/disables the incorrect integration indicator for native advertising.

    Remark

    By default, the indicator of incorrect integration (for native ads) is enabled for the DeviceType.simulator device type (the types are listed in YMADeviceTypes). To disable the indicator, pass the DeviceType.none value. @warning The indicator is not displayed in apps installed from the AppStore, regardless of the deviceType parameter value.

    Declaration

    Swift

    @objc(enableVisibilityErrorIndicatorForDeviceType:)
    public static func enableVisibilityErrorIndicator(for deviceType: DeviceType)

    Parameters

    deviceType

    The type of a device for displaying the incorrect integration indicator.

  • 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 NO personal data will not be collected. The default value is NO.

    Declaration

    Swift

    public static func setUserConsent(_ consent: Bool)

    Parameters

    consent

    YES if user provided consent to collect personal data, otherwise NO.

  • Initializes the Yandex Mobile Ads SDK internal state.

    Declaration

    Swift

    public static func initializeSDK(completionHandler: (() -> Void)? = nil)

    Parameters

    completionHandler

    The block that will be executed after sdk initialization.

  • Launches SDK debug panel.

    Declaration

    Swift

    public static func showDebugPanel()
  • Set a value indicating whether anonymous AppMetrica reports are enabled. If the value is set to false anonymous reports will not be sent. The default value is true.

    Declaration

    Swift

    public static func setAppAdAnalyticsReportingEnabled(_ enabled: Bool = true)

    Parameters

    enabled

    false if you want to disable anonymous AppMetrica reports, otherwise true.