googleads / googleads-mobile-android-native-templates

Apache License 2.0
116 stars 100 forks source link

Preload native ads #35

Closed AbdellahSoul closed 11 months ago

AbdellahSoul commented 1 year ago

Is there anyway to preload the ads. #

AndroidDeveloperLB commented 1 year ago

Kinda, but Google is against it, especially for AdView. Their reason is that they say Context should be the same Activity that is supposed to show the ad, because they claim that some ad-providers assume it's an Activity. Thing is, sometimes we know that an ad should be loaded before the Activity that shows it would be started. Sometimes we don't even use an Activity.

I requested this here: https://groups.google.com/g/google-admob-ads-sdk/c/gX4f-VISpIM/m/hi1LPjl1AQAJ?utm_medium=email&utm_source=footer

Please consider starring.

NVentimiglia commented 1 year ago

Thanks for the context.

JillSong commented 11 months ago

You can preload native ads with loadAds() https://developers.devsite.corp.google.com/admob/android/native#loadads.

AndroidDeveloperLB commented 11 months ago

@JillSong This link doesn't work. Need to work at Google to reach it. Also, preloading ads, as I was told - doesn't really work, as it requires Activity even if you don't have it yet. Look here: https://groups.google.com/g/google-admob-ads-sdk/c/gX4f-VISpIM/m/8VFMsDGcAQAJ Example for banner ads: https://syncme.atlassian.net/browse/SMA-1035?focusedCommentId=44554

Are you saying that we finally are allowed to load ads in the background, using Application as Context? Have you made sure it works with all ad-networks, with ads of all kinds (native, banner, and others) ?