GoogleMobileAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
AI-generated Key Takeaways
-
The GADMAdNetworkConnector protocol is used by ad network adapters to interact with the mediation SDK.
-
The connector object provides information for ad requests and facilitates callbacks to the mediation SDK on ad request returns and user interactions.
-
The protocol includes methods for obtaining a view controller to present modal views and retrieving preferred ad volume and mute status.
-
The GADMAdNetworkConnector defines callbacks for various ad events, such as ad load success/failure, clicks, and the presentation/dismissal of full-screen modals and interstitials.
-
Several methods within the protocol are marked as deprecated, with recommendations to use alternative methods.
GADMAdNetworkConnector
@protocol GADMAdNetworkConnector <GADMediationAdRequest>
Ad network adapters interact with the mediation SDK using an object that implements the GADMAdNetworkConnector protocol. The connector object can be used to obtain necessary information for ad requests, and to call back to the mediation SDK on ad request returns and user interactions.
-
When you need to show a landing page or any other modal view, such as when a user clicks or when your Ads SDK needs to show an interstitial, use this method to obtain a UIViewController that you can use to show your modal view. Call the -presentViewController:animated:completion: method of the returned UIViewController.
Declaration
Swift
func viewControllerForPresentingModalView() -> UIViewController!
Objective-C
- (UIViewController *)viewControllerForPresentingModalView;
-
Returns the preferred ad volume as a fraction of system volume (0.0 to 1.0).
Declaration
Swift
func adVolume() -> Float
Objective-C
- (float)adVolume;
-
Returns whether the ad should be muted.
Declaration
Swift
func adMuted() -> Bool
Objective-C
- (BOOL)adMuted;
-
Tells the connector that the adapter failed to receive an ad.
Declaration
Swift
func adapter(_ adapter: (any GADMAdNetworkAdapter)!, didFailAd error: (any Error)!)
Objective-C
- (void)adapter:(id<GADMAdNetworkAdapter>)adapter didFailAd:(NSError *)error;
-
Tells the connector that the adapter received a banner ad.
Declaration
Swift
func adapter(_ adapter: (any GADMAdNetworkAdapter)!, didReceiveAdView view: UIView!)
Objective-C
- (void)adapter:(id<GADMAdNetworkAdapter>)adapter didReceiveAdView:(UIView *)view;
-
Tells the connector that the adapter received an interstitial.
Declaration
Swift
func adapterDidReceiveInterstitial(_ adapter: (any GADMAdNetworkAdapter)!)
Objective-C
- (void)adapterDidReceiveInterstitial:(id<GADMAdNetworkAdapter>)adapter;
-
Tells the connector that the adapter has received a unified mediated native ad. mediatedUnifiedNativeAd is used by the Google Mobile Ads SDK to construct a unified native ad object.
Declaration
Swift
func adapter(_ adapter: (any GADMAdNetworkAdapter)!, didReceive mediatedUnifiedNativeAd: (any MediatedUnifiedNativeAd)!)
Objective-C
- (void)adapter:(id<GADMAdNetworkAdapter>)adapter didReceiveMediatedUnifiedNativeAd: (id<GADMediatedUnifiedNativeAd>)mediatedUnifiedNativeAd;
-
Tells the connector that the adapter recorded a user click.
Declaration
Swift
func adapterDidGetAdClick(_ adapter: (any GADMAdNetworkAdapter)!)
Objective-C
- (void)adapterDidGetAdClick:(id<GADMAdNetworkAdapter>)adapter;
-
Tells the connector that the adapter will present a full screen modal.
Declaration
Swift
func adapterWillPresentFullScreenModal(_ adapter: (any GADMAdNetworkAdapter)!)
Objective-C
- (void)adapterWillPresentFullScreenModal:(id<GADMAdNetworkAdapter>)adapter;
-
Tells the connector that the adapter will dismiss a full screen modal.
Declaration
Swift
func adapterWillDismissFullScreenModal(_ adapter: (any GADMAdNetworkAdapter)!)
Objective-C
- (void)adapterWillDismissFullScreenModal:(id<GADMAdNetworkAdapter>)adapter;
-
Tells the connector that the adapter dismissed a full screen modal.
Declaration
Swift
func adapterDidDismissFullScreenModal(_ adapter: (any GADMAdNetworkAdapter)!)
Objective-C
- (void)adapterDidDismissFullScreenModal:(id<GADMAdNetworkAdapter>)adapter;
-
Tells the connector that the adapter will present an interstitial.
Declaration
Swift
func adapterWillPresentInterstitial(_ adapter: (any GADMAdNetworkAdapter)!)
Objective-C
- (void)adapterWillPresentInterstitial:(id<GADMAdNetworkAdapter>)adapter;
-
Tells the connector that the adapter will dismiss an interstitial.
Declaration
Swift
func adapterWillDismissInterstitial(_ adapter: (any GADMAdNetworkAdapter)!)
Objective-C
- (void)adapterWillDismissInterstitial:(id<GADMAdNetworkAdapter>)adapter;
-
Tells the connector that the adapter did dismiss an interstitial.
Declaration
Swift
func adapterDidDismissInterstitial(_ adapter: (any GADMAdNetworkAdapter)!)
Objective-C
- (void)adapterDidDismissInterstitial:(id<GADMAdNetworkAdapter>)adapter;
-
Deprecated
Use -adapterDidReceiveInterstitial:.
Deprecated. Use -adapterDidReceiveInterstitial:.
Declaration
Swift
func adapter(_ adapter: (any GADMAdNetworkAdapter)!, didReceiveInterstitial interstitial: NSObject!)
Objective-C
- (void)adapter:(id<GADMAdNetworkAdapter>)adapter didReceiveInterstitial:(NSObject *)interstitial;
-
Deprecated
Use -adapterDidGetAdClick:.
Deprecated. Use -adapterDidGetAdClick:.
Declaration
Swift
func adapter(_ adapter: (any GADMAdNetworkAdapter)!, clickDidOccurInBanner view: UIView!)
Objective-C
- (void)adapter:(id<GADMAdNetworkAdapter>)adapter clickDidOccurInBanner:(UIView *)view;
-
Deprecated
Use -adapter:didFailAd:
Deprecated. Use -adapter:didFailAd:.
Declaration
Swift
func adapter(_ adapter: (any GADMAdNetworkAdapter)!, didFailInterstitial error: (any Error)!)
Objective-C
- (void)adapter:(id<GADMAdNetworkAdapter>)adapter didFailInterstitial:(NSError *)error;
-
Deprecated
Deprecated. No replacement.
Deprecated. No replacement.
Declaration
Swift
func adapterWillLeaveApplication(_ adapter: (any GADMAdNetworkAdapter)!)
Objective-C
- (void)adapterWillLeaveApplication:(id<GADMAdNetworkAdapter>)adapter;