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

The provided view controller is not being presented #59

Closed
1 of 2 tasks
ShivamJoker opened this issue Nov 20, 2021 · 6 comments · Fixed by #62
Closed
1 of 2 tasks

The provided view controller is not being presented #59

ShivamJoker opened this issue Nov 20, 2021 · 6 comments · Fixed by #62

Comments

@ShivamJoker
Copy link

Description

The provided view controller is not being presented while trying to load the ad on iOS
Continuing from #48

Snack or minimal code example

Just the example from docs

Package versions

  • React Native: 0.66.1
  • React Native AdMob: ^1.2.1
  • Google Mobile Ads SDK(if specified):
  • Xcode: 13.1
  • Java & Gradle: Gradle 4.2.2

Affected platforms

  • Android
  • iOS
@wjaykim
Copy link
Collaborator

wjaykim commented Nov 20, 2021

while trying to load the ad

Did you mean trying to show ad

@ShivamJoker
Copy link
Author

Yes! The ad does load but when I call show it just throws the error

@wjaykim
Copy link
Collaborator

wjaykim commented Nov 20, 2021

In what timing are you trying to show ad?

@ShivamJoker
Copy link
Author

I have button when I click it loads the ad if isLoaded is true else it calls the show

@wjaykim
Copy link
Collaborator

wjaykim commented Nov 20, 2021

Can you try installing library from this branch and tell me if it fixes.

@ShivamJoker
Copy link
Author

Hey @wjaykim it seems to be working perfect in that branch
image

Thanks ❤️

wjaykim added a commit that referenced this issue Nov 21, 2021
Add logic to find topmost presenting view controller.
This fixes problem ad is not showing when current presenting controller is differ from RCTPresentedViewController.

Refs: #59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants