Javascript/reactnative/admob/expo
提供: 初心者エンジニアの簡易メモ
admob-expoの公式
https://docs.expo.io/versions/latest/sdk/admob/
admobプラグインのインストール
$ expo install expo-ads-admob
app.json にandroidとiosを追加
{ "expo": { "name": "Ads Showcase", "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のfunctionは存在しないと出たとき
以下エラーが出たとき
[Unhandled promise rejection: TypeError: _expoAdsAdmob.AdMobInterstitial.setTestDeviceIDAsync is not a function.
setTestDeviceIDAsyncでなく、setTestDeviceIDを使う
AdMobInterstitial.setTestDeviceID is deprecated. Test device IDs are now set globally. Use AdMob.setTestDeviceIDAsync instead.
setTestDeviceIDでなく、setTestDeviceIDAsyncを使う