Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Admob #11

Closed
dev-jw opened this issue Jan 7, 2019 · 7 comments
Closed

Google Admob #11

dev-jw opened this issue Jan 7, 2019 · 7 comments
Labels
more details needed Need to provide more details

Comments

@dev-jw
Copy link

dev-jw commented Jan 7, 2019

When I use Google Admob, the pop can't show

@JonyFang
Copy link
Owner

Hi @SmallLion ,

Your problem description is a bit fuzzy. You can provide a demo project(demo repo link) and the steps to reproduce the issue, which will help us find the cause of the problem.

In addition, filling in the detailed description of the issue is also helpful.

@JonyFang JonyFang added the more details needed Need to provide more details label Jan 10, 2019
@cevanish12
Copy link

I noticed this issue as well. I believe admob adds a UIWindow to your app and my guess is that the popup is added to the wrong UIWindow. I managed to fix it by checking that the window is also the keyWindow when iterating through all the windows in the showWithParameters method.

@dev-jw
Copy link
Author

dev-jw commented Apr 8, 2019

@cevanish12 so, you solve it?

@cevanish12
Copy link

Hey @JonyFang, sorry it took so long but I created a demo project at https://github.com/cevanish12/FFPopupAdmob. Basically the popup won't show if you set up interstitial ads on the viewcontroller you're presenting on. I managed to fix it on my personal projects by adding
if (window.windowLevel == UIWindowLevelNormal && window.isKeyWindow)
in the showWithParameters method. Hope this helps.

@parkmino86
Copy link

I encountered the same issue.

@parkmino86
Copy link

parkmino86 commented Aug 27, 2019

@cevanish12 's way is helpful to me.

FFPopup.m

Change the code. When Google AdMob is in my project, there are 2 different window here. the first thing is our original window, the second one is AdMob's. So, add FFPopupView to first window.
Here is my change

if (!strongSelf.superview) {
                UIWindow *window = [[[UIApplication sharedApplication] windows] firstObject];
                if (window.windowLevel == UIWindowLevelNormal) {
                    [window addSubview:self];
                }
            }

...

@fengong
Copy link

fengong commented Feb 21, 2020

image
Hi @JonyFang , here are two way to resolve it

// 1. add to the target window before invoke show method
   // First, initial a pop up 
    FFPopup *popup = [FFPopup popupWithContentView:self];   
   //Add to you target window
    [[UIApplication sharedApplication].delegate.window addSubview:popup];
    // then show the popup
    [popup showWithLayout:FFPopupLayout_Center];

// 2. Modify source code in FFPopup.m file
 if (window.windowLevel == UIWindowLevelNormal && window.isHidden == NO) {
    [window addSubview:self];
    break;
}

JonyFang added a commit that referenced this issue Aug 30, 2020
Signed-off-by: JonyFang <[email protected]>
JonyFang added a commit that referenced this issue Aug 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more details needed Need to provide more details
Projects
None yet
Development

No branches or pull requests

5 participants