facebook twitter hatena line email

「Javascript/reactnative/admob/expo」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(admobプラグインのインストール)
(以下エラーが出たとき)
行21: 行21:
 
setTestDeviceIDAsyncでなく、setTestDeviceIDを使う
 
setTestDeviceIDAsyncでなく、setTestDeviceIDを使う
 
  [Unhandled promise rejection: TypeError: _expoAdsAdmob.AdMobInterstitial.setTestDeviceIDAsync is not a function.
 
  [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.
  
 
==参考==
 
==参考==
 
https://honmushi.com/2019/11/28/expo-admob/
 
https://honmushi.com/2019/11/28/expo-admob/

2020年7月16日 (木) 15:12時点における版

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.

参考

https://honmushi.com/2019/11/28/expo-admob/