如何使用物理设备测试广告 [Android]
how to use the physical device to test ads [Android]
google服务广告版本变更后,addTestDevice选项不再出现,请问如何在实体设备上看bonus videos?
AdRequest adRequest = new AdRequest.Builder().build();
RewardedAd.load(this, "ca-app-pub-3940256099942544/5224354917",
adRequest, new RewardedAdLoadCallback() {
@Override
public void onAdFailedToLoad(@NonNull LoadAdError loadAdError) {
// Handle the error.
// Log.d(TAG, loadAdError.getMessage());
mRewardedAd = null;
}
@Override
public void onAdLoaded(@NonNull RewardedAd rewardedAd) {
mRewardedAd = rewardedAd;
//Log.d(TAG, "Ad was loaded.");
}
});
您可以按照步骤here
Add a test device To make changes to a test device, such as enabling
or changing ad inspector gestures, you’ll need to remove the test
device and set it up again. Sign in to your AdMob account at
https://apps.admob.com.
Click Settings in the sidebar.
Click the Test devices tab.
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.
Enter your Advertising ID/IDFA. Learn how to find your advertising
ID/IDFA.
Select a gesture to use to activate ad inspector:
None. If you select none, you can still activate ad inspector with an
API call. Learn more.
Shake
Flick twice
Click Done.
google服务广告版本变更后,addTestDevice选项不再出现,请问如何在实体设备上看bonus videos?
AdRequest adRequest = new AdRequest.Builder().build();
RewardedAd.load(this, "ca-app-pub-3940256099942544/5224354917",
adRequest, new RewardedAdLoadCallback() {
@Override
public void onAdFailedToLoad(@NonNull LoadAdError loadAdError) {
// Handle the error.
// Log.d(TAG, loadAdError.getMessage());
mRewardedAd = null;
}
@Override
public void onAdLoaded(@NonNull RewardedAd rewardedAd) {
mRewardedAd = rewardedAd;
//Log.d(TAG, "Ad was loaded.");
}
});
您可以按照步骤here
Add a test device To make changes to a test device, such as enabling or changing ad inspector gestures, you’ll need to remove the test device and set it up again. Sign in to your AdMob account at https://apps.admob.com.
Click Settings in the sidebar.
Click the Test devices tab.
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.
Enter your Advertising ID/IDFA. Learn how to find your advertising ID/IDFA.
Select a gesture to use to activate ad inspector:
None. If you select none, you can still activate ad inspector with an API call. Learn more.
Shake
Flick twice
Click Done.