YMAMobileAds

Objective-C

@interface YMAMobileAds : NSObject

Swift

class YMAMobileAds : NSObject

This class allows you to set general SDK settings.

  1. Methods
  2. +enableLogging
  3. +SDKVersion
  4. +audioSessionManager
  5. +setLocationTrackingEnabled:
  6. +enableVisibilityErrorIndicatorForDeviceType:
  7. +setUserConsent:

Methods

+enableLogging

Enables logging. By default, logging is disabled.

Declaration

Objective-C

+ (void)enableLogging;

Swift

class func enableLogging()

+SDKVersion

Returns the SDK version in X.YY format.

Declaration

Objective-C

+ (nonnull NSString *)SDKVersion;

Swift

class func sdkVersion() -> String

Return Value

SDK version in X.YY format.

+audioSessionManager

Returns the audio session manager (YMAAudioSessionManager).

Declaration

Objective-C

+ (nonnull YMAAudioSessionManager *)audioSessionManager;

Swift

class func audioSessionManager() -> YMAAudioSessionManager

Return Value

Audio session manager.

+setLocationTrackingEnabled:

The SDK automatically collects location data if the user allowed the app to track the location. This option is enabled by default.

Declaration

Objective-C

+ (void)setLocationTrackingEnabled:(BOOL)enabled;

Swift

class func setLocationTrackingEnabled(_ enabled: Bool)

Parameters

enabled

Enables or disables collecting location data.

enabled

Enables or disables collecting location data.

+enableVisibilityErrorIndicatorForDeviceType:

Enables/disables the incorrect integration indicator for native advertising. By default, the incorrect integration indicator (for native ads) is enabled for the YMADeviceTypeSimulator device type (the types are listed in YMADeviceType). To disable the indicator, pass the YMADeviceTypeNone value.

Note

The indicator is not displayed in apps installed from the AppStore, regardless of the deviceType parameter value.

Declaration

Objective-C

+ (void)enableVisibilityErrorIndicatorForDeviceType:(YMADeviceType)deviceType;

Swift

class func enableVisibilityErrorIndicator(forDeviceType deviceType: Any!)

Parameters

deviceType

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

deviceType

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

+setUserConsent:

Sets a value that indicates whether a user from the GDPR region permits the collection of personal data that will be used for analytics and ad targeting. User data will not be collected until data collection is permitted. If the user once permitted or prohibited data collection, this value must be passed each time the app is launched.

Declaration

Objective-C

+ (void)setUserConsent:(BOOL)consent;

Swift

class func setUserConsent(_ consent: Bool)

Parameters

consent

Permits or prohibits data collection. By default, data is not collected.

consent

Permits or prohibits data collection. By default, data is not collected.