I have multiple devices, and I probably will have more, and do not want to add them one by one. Does anybody know what ID Admob uses?
There are several ways to find an ID to use in your AdMob account to configure your device as a test device. Note that Android devices use the advertising ID and iOS devices use the IDFA. On Android devices, you can find your advertising ID in your device settings. Navigate to Settings, click Google, and then Ads:
Click Add test device. Select the platform of your device. Enter a device name. Consider using a name that will help you quickly identify your devices in your AdMob account. Note: The device name will be visible to anyone who has access to your AdMob account.
Setting up a test device lets you safely test production ads and verify your implementation code without violating AdMob’s invalid traffic policy. When you configure your Android or iOS device as a test device, the AdMob Network sends production ads in test mode to your device using the ad unit IDs you've created in your AdMob account.
Connect your device in USB debug mode to Android Studio Open any app on your device which shows live ads from Admob:On the connected device, if you have your app downloaded from play store(showing live ads) open that app or else open any other app that shows live Admob ads. Your device should have an internet connection.
String aid = Settings.Secure.getString(getContext().getContentResolver(), "android_id");
Object obj = null;
try {
((MessageDigest) (obj = MessageDigest.getInstance("MD5"))).update(
aid.getBytes(), 0, aid.length());
obj = String.format("%032X", new Object[] { new BigInteger(1,
((MessageDigest) obj).digest()) });
} catch (NoSuchAlgorithmException localNoSuchAlgorithmException) {
obj = aid.substring(0, 32);
}
I hope this will help you ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With