此问题可能是因为缺少对广告收入共享设置的授权所致。解决方法是通过 AdMob UI 创建一个新的广告收入共享设置,或者使用 AdMob API 更新现有设置。具体操作可以参考 AdMob API 文档中的“Admob Ad Network Optimizations”一节。示例代码如下:
import { AdMob } from 'expo';
import { AdUnitID, AdRevenue } from 'constants';
const adUnitID = AdUnitID;
const adRevenue = AdRevenue;
async function createAdRevenueShare() {
const adRevenueShare = await AdMob.createAdRevenueShare(adUnitID, adRevenue);
console.log('New ad revenue share created:', adRevenueShare);
}
createAdRevenueShare();