Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Violation about Preventing invalid impressions #20

Open
AmiriOS2019 opened this issue Nov 8, 2021 · 4 comments
Open

Violation about Preventing invalid impressions #20

AmiriOS2019 opened this issue Nov 8, 2021 · 4 comments

Comments

@AmiriOS2019
Copy link

I used the same code demo from Native Ads in my app and the banner displays correctly but when I published it on AppGallery I got the following message:

An ad cannot be displayed repeatedly for one request. After being displayed, the ad needs to be loaded again in real time for the next request.
[Recommended] The ad object on each page is independent. You need to use the createXX method to create ads and register a callback.

Please, has anyone had the same problem with this code being used?

@ttljtw
Copy link

ttljtw commented Nov 9, 2021

Yes, it is recommended to create a new one at a time, as in the demo.

@AmiriOS2019
Copy link
Author

I updated my code today and the ads are showing correctly on the phone. but i'm not sur if it's the correct way to avoid the message : An ad cannot be displayed repeatedly for one request

Please have a look https://github.com/AmiriOS2019/myfiles2/blob/main/MyActivity.java

@ttljtw
Copy link

ttljtw commented Nov 10, 2021

Look at the code and I think your problem can be solved.
But, I don't think it's handled right here, why did you destory ad just loaded?

@AmiriOS2019
Copy link
Author

AmiriOS2019 commented Nov 10, 2021

Thank you ttljtw for your remark. I put it first like on the demo code link, but after seeing the documentation I noticed that I should destroy the native ad after displaying it, so I move it after adScrollView.addView(nativeView);
but what I don't understand, why the value of nativeAd is not null after i have destroyed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants