We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87604e8 commit 47170afCopy full SHA for 47170af
packages/firebase-admob/utils.ts
@@ -68,8 +68,9 @@ export const topViewController = (): UIViewController | undefined => {
68
};
69
70
const rootViewController = (): UIViewController | undefined => {
71
- const keyWindow = UIApplication.sharedApplication.keyWindow;
72
- return keyWindow != null ? keyWindow.rootViewController : undefined;
+ const app = UIApplication.sharedApplication;
+ const window = app.keyWindow || (app.windows.count > 0 && app.windows[0]);
73
+ return window != null ? window.rootViewController : undefined;
74
75
76
const findTopViewController = (root: UIViewController): UIViewController | undefined => {
0 commit comments