YMAMobileAds
Objective-C
@interface YMAMobileAds : NSObject
Swift
class YMAMobileAds : NSObject
This class allows you to set general SDK settings.
- Methods
- +enableLogging
- +SDKVersion
- +audioSessionManager
- +setLocationTrackingEnabled:
- +enableVisibilityErrorIndicatorForDeviceType:
- +setUserConsent:
Enables logging. By default, logging is disabled.
Declaration
Objective-C
+ (void)enableLogging;
Swift
class func enableLogging()
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.
Returns the audio session manager (YMAAudioSessionManager
).
Declaration
Objective-C
+ (nonnull YMAAudioSessionManager *)audioSessionManager;
Swift
class func audioSessionManager() -> YMAAudioSessionManager
Return Value
Audio session manager.
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. |
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.
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. |
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. |