Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

Cannot read property 'requestAd' of null #56

Closed
OmkoBass opened this issue Nov 13, 2021 · 5 comments
Closed

Cannot read property 'requestAd' of null #56

OmkoBass opened this issue Nov 13, 2021 · 5 comments

Comments

@OmkoBass
Copy link

I want to show an interstitial add, but i'm always getting Cannot read property 'requestAd' of null.

The only thing I'm doing is this

const interstitialAd = useInterstitialAd(
    "ca-app-pub-3940256099942544/1033173712",
    {}
  );

I'm sorry if this is a dumb question. Can someone give me an example or something.

@OmkoBass
Copy link
Author

OmkoBass commented Nov 14, 2021

This code will work, but I can't show an add then.

const interstitialAd = useInterstitialAd(null, {});

but if i place in any string for the ad id it will throw
null is not an object (evaluating 'this.nativeModule.requestAd')

@marcoizzo
Copy link

+1

@OmkoBass
Copy link
Author

I updated changed the test app id in android manifest to my app id and now i get a Maximum Depth Loop.

@OmkoBass
Copy link
Author

I solved my problem by switching to this library: https://github.com/ammarahm-ed/react-native-admob-native-ads
You can implement any type of ad with the native ad format.

@wjaykim
Copy link
Collaborator

wjaykim commented Nov 26, 2021

Try latest version and reopen issue if it does not work.

@wjaykim wjaykim closed this as completed Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants