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

useAppOpenAd still shows after disabling it #33

Closed
andkom opened this issue Sep 24, 2021 · 12 comments
Closed

useAppOpenAd still shows after disabling it #33

andkom opened this issue Sep 24, 2021 · 12 comments

Comments

@andkom
Copy link

andkom commented Sep 24, 2021

I have paid option to disable ads:

useAppOpenAd(initialized && !disableAds ? unitId : null, {
  showOnColdStart: false,
  showOnAppForeground: true,
});

but after an user purchases ads removal, app open ad still shows on app foreground

@nguyen95
Copy link

nguyen95 commented Oct 6, 2021

I used AppOpenAd component and it work. In your case, I think init method not called again
Doc: https://react-native-admob.github.io/admob/docs/api/AppOpenAd

@andkom
Copy link
Author

andkom commented Oct 6, 2021

the issue is: once AppOpenAd has been initialized, there is no way do disable it runtime. Only restart the app.

@nguyen95
Copy link

nguyen95 commented Oct 6, 2021

Please read the doc.
Call AppOpenAd.createAd('', {
showOnColdStart: false,
showOnAppForeground: false,
})
again to disable

@nguyen95
Copy link

nguyen95 commented Oct 6, 2021

Note that the unitId in second must be different in first, if not, the init() method in native code will not call again

@wjaykim
Copy link
Collaborator

wjaykim commented Oct 6, 2021

@nguyen95 Yes, that is one way to disable it, but it is not hookish way. I'll improve the code to disable just by setting unitId undefined.

@andkom
Copy link
Author

andkom commented Oct 6, 2021

@nguyen95 yeah, but it looks like a hack

@wjaykim
Copy link
Collaborator

wjaykim commented Nov 4, 2021

Fixed in 1.2.0

@wjaykim wjaykim closed this as completed Nov 4, 2021
@andkom
Copy link
Author

andkom commented Nov 27, 2021

@wjaykim bug is not fixed

<AppOpenAdProvider
      unitId={isPaid ? null : TestIds.APP_OPEN}
      options={{ showOnColdStart: true, showOnForeground: true }}
    >
      {/* ... */}
</AppOpenAdProvider>

if isPaid changes to true, ad still shows on app foreground

@wjaykim
Copy link
Collaborator

wjaykim commented Nov 27, 2021

@andkom oh, thank you for reporting. This issue had been fixed, but it has been occurring again since several updates. I'll fix this issue again.

@wjaykim wjaykim reopened this Nov 27, 2021
@wjaykim
Copy link
Collaborator

wjaykim commented Nov 28, 2021

Fixed in 1.4.0

@wjaykim wjaykim closed this as completed Nov 28, 2021
@andkom
Copy link
Author

andkom commented Nov 28, 2021

as for now showOnAppForeground behavior is not consistent, sometimes it works, sometimes not, but disabling AppOpenAd in runtime is still not working

@wjaykim
Copy link
Collaborator

wjaykim commented Nov 28, 2021

I've tested and it's working you have to reproduce your code so that I can help you.

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