**`react-native info` output:**
```
OUTPUT GOES HERE
```
- **Platform that you're experiencing the issue on**:
- [ ] iOS
- [ ] Android
- [ ] **iOS** but have not tested behavior on Android
- [ ] **Android** but have not tested behavior on iOS
- [x] Both
- **Are you using `TypeScript`?**
- `No`
---
- 👉 Check out [`Invertase`](https://twitter.com/invertaseio) on Twitter for updates on the library.
Issue
There might be several reasons why an interstitial ad doesn't load properly (e.g. ad network error, frequency capping, etc...). When this happens,
show
won't work since the ad wasn't loaded, but unfortunatelyload
won't work either because this line is preventing subsequent calls toload
: https://github.com/invertase/react-native-google-mobile-ads/blob/8026f65686b0562f974a6d48b3f8d22571c7182f/src/ads/MobileAd.ts#L176This makes the ad instance useless unless the property
ad._isLoadCalled
is manually set tofalse
. This is especially bad for hooks, where only theshow
,load
handlers are available and there is no way to recreate the ad instance unless you use a differentadUnitId
orrequestOptions
: https://github.com/invertase/react-native-google-mobile-ads/blob/8026f65686b0562f974a6d48b3f8d22571c7182f/src/hooks/useInterstitialAd.ts#L39-L43IMO multiple calls to
load
should be allowed even ifthis._isLoadCalled
istrue
Note: This issue was already reported in https://github.com/invertase/react-native-google-mobile-ads/issues/126 but was closed without a solution
Project Files
Javascript
Click To Expand
#### `package.json`: ```json { "name": "sample_app", "private": true, "scripts": { "start": "expo start --dev-client", "android": "expo run:android", "ios": "expo run:ios", "eject": "expo eject" }, "dependencies": { "@react-native-async-storage/async-storage": "~1.17.3", "expo": "^45.0.0", "expo-application": "~4.1.0", "expo-constants": "~13.1.1", "expo-font": "~10.1.0", "expo-haptics": "~11.2.0", "expo-keep-awake": "~10.1.1", "expo-linear-gradient": "~11.3.0", "expo-linking": "~3.1.0", "expo-navigation-bar": "~1.2.0", "expo-splash-screen": "~0.15.1", "expo-status-bar": "~1.3.0", "expo-store-review": "~5.2.0", "expo-system-ui": "~1.2.0", "expo-tracking-transparency": "~2.2.0", "prop-types": "^15.7.2", "react": "17.0.2", "react-dom": "17.0.2", "react-native": "0.68.2", "react-native-google-mobile-ads": "^7.0.1", "react-native-web": "0.17.7" }, "devDependencies": { "@babel/core": "^7.12.9", "@babel/runtime": "^7.4.2", "babel-preset-expo": "~9.1.0", "babel-runtime": "^6.26.0", "expo-dev-client": "~1.0.0" }, "rnpm": { "assets": [ "./assets/fonts" ] }, "version": "1.0.0" } ``` #### `admob.json`: ```json # N/A ```
iOS
Click To Expand
#### `ios/Podfile`: ```ruby # N/A ``` --- ### Android
---
## Environment
---
- 👉 Check out [`Invertase`](https://twitter.com/invertaseio) on Twitter for updates on the library.
Click To Expand
#### `android/build.gradle`: ```groovy // N/A ``` #### `android/app/build.gradle`: ```groovy // N/A ``` #### `android/settings.gradle`: ```groovy // N/A ``` #### `AndroidManifest.xml`: ```xml ```
Click To Expand
**`react-native info` output:** ``` OUTPUT GOES HERE ``` - **Platform that you're experiencing the issue on**: - [ ] iOS - [ ] Android - [ ] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [x] Both - **Are you using `TypeScript`?** - `No`