Javascript/reactnative/admob/expo
提供: 初心者エンジニアの簡易メモ
admobプラグインのインストール
$ expo install expo-ads-admob
app.json にandroidとiosを追加
{ "android": { "config": { "googleMobileAdsAppId": "ca-app-pub-3940256099942544~3347511713" // sample id, replace with your own } }, "ios": { "config": { "googleMobileAdsAppId": "ca-app-pub-3940256099942544~1458002511" // sample id, replace with your own } }, }
以下エラーが出たとき
setTestDeviceIDAsyncでなく、setTestDeviceIDを使う
[Unhandled promise rejection: TypeError: _expoAdsAdmob.AdMobInterstitial.setTestDeviceIDAsync is not a function.
setTestDeviceIDでなく、setTestDeviceIDAsyncを使う
AdMobInterstitial.setTestDeviceID is deprecated. Test device IDs are now set globally. Use AdMob.setTestDeviceIDAsync instead.