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

iOS13以后因为SenceDelegate导致广告图不显示 #246

Open
zhunjiee opened this issue Mar 1, 2021 · 2 comments
Open

iOS13以后因为SenceDelegate导致广告图不显示 #246

zhunjiee opened this issue Mar 1, 2021 · 2 comments

Comments

@zhunjiee
Copy link

zhunjiee commented Mar 1, 2021

No description provided.

@pianxian
Copy link

XHLaunchAd.m 的207行的setupLaunchAd 方法里换成这个就好了

UIWindow *window; if (@available(iOS 13.0, *)) { NSArray *array =[[[UIApplication sharedApplication] connectedScenes] allObjects]; UIWindowScene *windowScene = (UIWindowScene *)array.firstObject; window = [[UIWindow alloc] initWithWindowScene:windowScene]; window.frame = windowScene.coordinateSpace.bounds; } else { window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; }

@maybeliu
Copy link

XHLaunchAd.m 的207行的setupLaunchAd 方法里换成这个就好了

UIWindow *window; if (@available(iOS 13.0, *)) { NSArray *array =[[[UIApplication sharedApplication] connectedScenes] allObjects]; UIWindowScene *windowScene = (UIWindowScene *)array.firstObject; window = [[UIWindow alloc] initWithWindowScene:windowScene]; window.frame = windowScene.coordinateSpace.bounds; } else { window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; }

这里还需要一个判断,如果项目中保留了SenceDelegate,但是没有实际应用,windowScene获取为nil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants