LifecycleObserver is used to detect the app state. Hence by applying boolean flags to the code snippet I'm able to show the ad only at the app open. Similarly your use case shall be achievable by using Flags.
private boolean isAdShown = false;
private void loadAd(Context context) { // Do not load ad if there is an unused ad or one is already loading. if (isLoadingAd || isAdAvailable() || isAdShown) { return; }
public void onShowAdComplete() { // Empty because the user will go back to the activity that shows the ad. isAdShown = true; Log.d("isAdShown", String.valueOf(isAdShown)); }
Mobile Ads SDK Team |
If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:
1. Navigate to
https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002tJRYgQAO&entry.80707362=002434902. Fill out all fields, and attach your file(s).
3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.
Hi Ing. Slavomir Fabian
Thank you for getting back to us.
Can you please confirm whether the issue still exists in your AdMob account and is replicating in the Google AppOpen sample? If yes, kindly provide us with the below information privately for further investigation so that we can debug from our end and provide a solution:
You can provide the following details via reply privately to the author option or directly provide it to the link below.
If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:
1. Navigate to
https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002tJRYgQAO&entry.80707362=002434902. Fill out all fields, and attach your file(s).
3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.
Mobile Ads SDK Team |
ما هى المشكله
--
---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/h1yWc000000000000000000000000000000000000000000000SFOLTO00sTAIi-WYSq-7Y8nHdfdg4w%40sfdc.net.
Hi
Thank you for getting back to us.
I will check with our team regarding your query and one of my team members will reach out to you once we have an update on this. Meanwhile, your patience is highly appreciated.