Hi there,
Thanks for reaching out to the GMA SDK Forum.
Kindly note that the Native ads are loaded with the GADAdLoader objects, which send messages to their delegates according to the GADAdLoaderDelegate protocol. Before you can load an ad, you have to initialize the ad loader. The following code demonstrates how to initialize a GADAdLoader:
adLoader = GADAdLoader(adUnitID: "ca-app-pub-3940256099942544/3986624511", rootViewController: self, adTypes: [ .native ], options: [ ... ad loader options objects ... ]) adLoader.delegate = self
Once your GADAdLoader is initialized, call its loadRequest: method to request an ad:
adLoader.load(GADRequest())
The loadRequest: method in GADAdLoader accepts the same GADRequest objects as banners and interstitials. You can use request objects to add targeting information, just as you would with other ad types.
Also, note that the Apps displaying native ads are free to request them in advance of when they'll actually be displayed. In many cases, this is the recommended practice. An app displaying a list of items with native ads mixed in, for example, can load native ads for the whole list, knowing that some will be shown only after the user scrolls the view and some may not be displayed at all.
Once you have loaded an ad, all that remains is to display it to your users. Head over to our Native Advanced guide to see how.
You may refer to documentation on iOS here - https://developers.google.com/admob/ios/native/start#load_ads
In addition, you may refer to this iOS sample application if you need further implementation reference.
Let us know if you have any questions.
Regards,
|
||||||
Hi,
Thanks for getting back to us.
It’s good to know that Native ads are showing on your card view layout and also implemented a swipe feature. For your user case, have you tried to load an NativeAd as mentioned in the above post inside your right swipe function along with GADNativeAdCustomClickGestureOptions?
As per this guide, GADNativeAdCustomClickGestureOptions interface is for Ad loader options for custom click gestures. However, this is available for allowlisted publishers only, and these options will be ignored for publishers not allowlisted. Account manager should help to allowlist this ad loader options for the customer click gestures if you are not allowlisted.
You may call below loadRequest: method to request an ad after your GADAdLoader is initialized:
adLoader.load(GADRequest())
You may need to use nativeAd.delegate = self to be notified of events related to the native ad interactions, set the delegate property of the native ad. Then implement GADNativeAdDelegate to receive the following delegate calls:
func nativeAdDidRecordImpression(_ nativeAd: GADNativeAd) {
// The native ad was shown.
}
func nativeAdDidRecordClick(_ nativeAd: GADNativeAd) {
// The native ad was clicked on.
}
Let us know if this works for your user case.
Regards,
|
||||||