invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.68k stars 2.21k forks source link

Admob interstitial crash continuously in application firebase 7.1.0 version #3715

Closed cubukcuoglu3 closed 4 years ago

cubukcuoglu3 commented 4 years ago

Admob interstitial crash continuously in application firebase 7.1.0 version Adsız Adsız2

mikehardy commented 4 years ago

@cubukcuoglu-3

It looks like in certain cases the ad can fail to show: https://github.com/invertase/react-native-firebase/blob/71dc17371e8b5c7e3ae70feb921ac5c56dbf0484/packages/admob/android/src/main/java/io/invertase/firebase/admob/ReactNativeFirebaseAdMobInterstitialModule.java#L70-L71

Which would mean that ad is not in the array of ads Which could lead to this null pointer I think if you persist in calling show despite an error event. Are you listening for the error events? Posting code might help.

Does appear that when the ad is fetched from the ad array it should be tested from null and a nicer error message should be shown.

This issue is not likely to see high priority attention, I strongly advise you to manually go into node_modules, and manually alter the Java. I would add an import of android.util.Log at the top, and before I sent the error event I would log that it was happening, then down below I would add a null check and log the results, then do a promise reject similar to the others in the method.

You will likely be able to solve your own problem in just a few minutes effort, propose a PR to help everyone, and with https://github.com/ds300/patch-package you can easily persist your change so it's fixed permanently in your project everywhere (even CI) until your PR is merged

stale[bot] commented 4 years ago

Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.

afkcodes commented 4 years ago

@mikehardy this happened to me too also i wanted to know is there anyway to mute interstitial as it interupts the music played by my app

mikehardy commented 4 years ago

@ashishfeels how did it go when you followed my advice above?

This issue is not likely to see high priority attention, I strongly advise you to manually go into node_modules, and manually alter the Java. I would add an import of android.util.Log at the top, and before I sent the error event I would log that it was happening, then down below I would add a null check and log the results, then do a promise reject similar to the others in the method.

You will likely be able to solve your own problem in just a few minutes effort, propose a PR to help everyone, and with https://github.com/ds300/patch-package you can easily persist your change so it's fixed permanently in your project everywhere (even CI) until your PR is merged