问题
I wanted to ask where should I keep my AdMob ad unit IDs? Is it wrong to keep it in the strings.xml inside my Android Project? And what happens if someone gets my ad unit IDs?
回答1:
You can keep ad unit ID in string.xml or in activity same results, but if someone get your ad unit ID he may do sabotage
Here more details from admob about sabotage and how to prevent it
https://support.google.com/admob/answer/7062933
......
Also they suggest to make Authorized Sellers for Apps (app-ads.txt)
standard, originally designed for protecting web ad inventory. It extends compatibility to support ads shown in mobile apps.
Use of app-ads.txt is not mandatory, but is highly recommended, especially if you are concerned that others may be spoofing your app.
You need to create website (domain) and create txt file name it "app-ads.txt" place it in root...
put inside it google.com, pub-xxxxxxxxxxxxx, DIRECT, f088c47fec942fa0
pub-xxxxxxxxxxxxx change this with yours..
in app listing in store add link of your website
here more details
https://support.google.com/admob/answer/9363762?hl=en
来源:https://stackoverflow.com/questions/59792952/do-i-need-to-keep-admob-ad-unit-ids-in-a-safe-place