commit | author | age
|
96fe76
|
1 |
// |
L |
2 |
// GADMobileAds.h |
|
3 |
// Google Mobile Ads SDK |
|
4 |
// |
|
5 |
// Copyright 2015 Google LLC. All rights reserved. |
|
6 |
// |
|
7 |
|
|
8 |
#import <Foundation/Foundation.h> |
|
9 |
#import <UIKit/UIKit.h> |
|
10 |
#import <WebKit/WebKit.h> |
|
11 |
|
|
12 |
#import <GoogleMobileAds/GADAudioVideoManager.h> |
|
13 |
#import <GoogleMobileAds/GADInitializationStatus.h> |
|
14 |
#import <GoogleMobileAds/GADRequestConfiguration.h> |
|
15 |
#import <GoogleMobileAds/Mediation/GADVersionNumber.h> |
|
16 |
|
|
17 |
/// A block called with the initialization status when [GADMobileAds startWithCompletionHandler:] |
|
18 |
/// completes or times out. |
|
19 |
typedef void (^GADInitializationCompletionHandler)(GADInitializationStatus *_Nonnull status); |
|
20 |
|
|
21 |
/// Completion handler for presenting Ad Inspector. Returns an error if a problem was detected |
|
22 |
/// during presentation, or nil otherwise. |
|
23 |
typedef void (^GADAdInspectorCompletionHandler)(NSError *_Nullable error); |
|
24 |
|
|
25 |
/// Google Mobile Ads SDK settings. |
|
26 |
@interface GADMobileAds : NSObject |
|
27 |
|
|
28 |
/// Returns the shared GADMobileAds instance. |
|
29 |
+ (nonnull GADMobileAds *)sharedInstance; |
|
30 |
|
|
31 |
/// Returns the Google Mobile Ads SDK's version number. |
|
32 |
@property(nonatomic, readonly) GADVersionNumber versionNumber; |
|
33 |
|
|
34 |
/// The application's audio volume. Affects audio volumes of all ads relative to other audio output. |
|
35 |
/// Valid ad volume values range from 0.0 (silent) to 1.0 (current device volume). Defaults to 1.0. |
|
36 |
/// |
|
37 |
/// Warning: Lowering your app's audio volume reduces video ad eligibility and may reduce your app's |
|
38 |
/// ad revenue. You should only utilize this API if your app provides custom volume controls to the |
|
39 |
/// user, and you should reflect the user's volume choice in this API. |
|
40 |
@property(nonatomic, assign) float applicationVolume; |
|
41 |
|
|
42 |
/// Indicates whether the application's audio is muted. Affects initial mute state for all ads. |
|
43 |
/// Defaults to NO. |
|
44 |
/// |
|
45 |
/// Warning: Muting your application reduces video ad eligibility and may reduce your app's ad |
|
46 |
/// revenue. You should only utilize this API if your app provides a custom mute control to the |
|
47 |
/// user, and you should reflect the user's mute decision in this API. |
|
48 |
@property(nonatomic, assign) BOOL applicationMuted; |
|
49 |
|
|
50 |
/// Manages the Google Mobile Ads SDK's audio and video settings. |
|
51 |
@property(nonatomic, readonly, strong, nonnull) GADAudioVideoManager *audioVideoManager; |
|
52 |
|
|
53 |
/// Request configuration that is common to all requests. |
|
54 |
@property(nonatomic, readonly, strong, nonnull) GADRequestConfiguration *requestConfiguration; |
|
55 |
|
|
56 |
/// Initialization status of the ad networks available to the Google Mobile Ads SDK. |
|
57 |
@property(nonatomic, nonnull, readonly) GADInitializationStatus *initializationStatus; |
|
58 |
|
|
59 |
/// Returns YES if the current SDK version is at least |major|.|minor|.|patch|. This method can be |
|
60 |
/// used by libraries that depend on a specific minimum version of the Google Mobile Ads SDK to warn |
|
61 |
/// developers if they have an incompatible version. |
|
62 |
/// |
|
63 |
/// Available in Google Mobile Ads SDK 7.10 and onwards. Before calling this method check if the |
|
64 |
/// GADMobileAds's shared instance responds to this method. Calling this method on a Google Mobile |
|
65 |
/// Ads SDK lower than 7.10 can crash the app. |
|
66 |
- (BOOL)isSDKVersionAtLeastMajor:(NSInteger)major |
|
67 |
minor:(NSInteger)minor |
|
68 |
patch:(NSInteger)patch |
|
69 |
NS_SWIFT_NAME(isSDKVersionAtLeast(major:minor:patch:)); |
|
70 |
|
|
71 |
/// Starts the Google Mobile Ads SDK. Call this method as early as possible to reduce latency on the |
|
72 |
/// session's first ad request. Calls completionHandler when the GMA SDK and all mediation networks |
|
73 |
/// are fully set up or if set-up times out. The Google Mobile Ads SDK starts on the first ad |
|
74 |
/// request if this method is not called. |
|
75 |
- (void)startWithCompletionHandler:(nullable GADInitializationCompletionHandler)completionHandler; |
|
76 |
|
|
77 |
/// Disables automated SDK crash reporting. If not called, the SDK records the original exception |
|
78 |
/// handler if available and registers a new exception handler. The new exception handler only |
|
79 |
/// reports SDK related exceptions and calls the recorded original exception handler. |
|
80 |
- (void)disableSDKCrashReporting; |
|
81 |
|
|
82 |
/// Disables mediation adapter initialization during initialization of the GMA SDK. Calling this |
|
83 |
/// method may negatively impact your ad performance and should only be called if you will not use |
|
84 |
/// GMA SDK controlled mediation during this app session. This method must be called before |
|
85 |
/// initializing the GMA SDK or loading ads and has no effect once the SDK has been initialized. |
|
86 |
- (void)disableMediationInitialization; |
|
87 |
|
|
88 |
/// Presents Ad Inspector. The device calling this API must be registered as a test device in order |
|
89 |
/// to launch Ad Inspector. Set |
|
90 |
/// GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers to enable test mode on |
|
91 |
/// this device. |
|
92 |
/// @param viewController A view controller to present Ad Inspector. If nil, uses the top view |
|
93 |
/// controller of the app's main window. |
|
94 |
/// @param completionHandler A handler to execute when Ad Inspector is closed. |
|
95 |
- (void)presentAdInspectorFromViewController:(nullable UIViewController *)viewController |
|
96 |
completionHandler: |
|
97 |
(nullable GADAdInspectorCompletionHandler)completionHandler; |
|
98 |
|
|
99 |
/// Registers a web view with the Google Mobile Ads SDK to improve in-app ad monetization of ads |
|
100 |
/// within this web view. |
|
101 |
- (void)registerWebView:(nonnull WKWebView *)webView; |
|
102 |
|
|
103 |
@end |