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

How to setup IMAAdDisplayContainer #48

Open
kilirushi opened this issue Jan 4, 2021 · 3 comments
Open

How to setup IMAAdDisplayContainer #48

kilirushi opened this issue Jan 4, 2021 · 3 comments

Comments

@kilirushi
Copy link

My player is UIView, it add to UIWindow. But IMAAdDisplayContainer init require UIViewController. How to setup it?.

@bauloc
Copy link

bauloc commented Aug 9, 2021

I am also facing the same problem.

I have tried the following:
let viewController = MyDelegate.window?.rootViewController
let adDisplayContainer = IMAAdDisplayContainer(
adContainer: viewIMA,
viewController: viewController
)

however my app crashes sometimes for no other reason

Log crash:
child view controller:<IMAAdViewController: 0x10aa8a000> should have parent view controller:<PlayerViewController: 0x10b149600> but actual parent is:<MainAppViewController: 0x10a992f30>

Please guide how to fix the above error.
Sincerely thank everyone.

@cadalt
Copy link

cadalt commented Apr 14, 2022

hi, i'm a dev with a major media corporation. we are facing a similar crash ever since we moved to ima sdk v13.4

@Rupendragautam
Copy link

Rupendragautam commented May 12, 2023

I have a same issue. application is crashing while we launch app with video player in landscape mode.
'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<IMAAdViewController: 0x107c1ca70> should have parent view controller:(null) but actual parent is:<ABC.HomeViewController: 0x109049800>'

*** First throw call stack:
thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x0000000200f8b674 libsystem_kernel.dylib__pthread_kill + 8 frame #1: 0x00000002116ef1ac libsystem_pthread.dylibpthread_kill + 268
frame #2: 0x00000001caaecc8c libsystem_c.dylibabort + 180 frame #3: 0x000000021162eb8c libc++abi.dylibabort_message + 132
frame #4: 0x000000021161ea80 libc++abi.dylibdemangling_terminate_handler() + 336 frame #5: 0x00000001bc60dd3c libobjc.A.dylib_objc_terminate() + 144
frame #6: 0x000000021162df28 libc++abi.dylibstd::__terminate(void (*)()) + 20 frame #7: 0x0000000211630c2c libc++abi.dylib__cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 36
frame #8: 0x0000000211630bd8 libc++abi.dylib__cxa_throw + 140 frame #9: 0x00000001bc607a38 libobjc.A.dylibobjc_exception_throw + 412
frame #10: 0x00000001c3560c28 CoreFoundation+[NSException raise:format:] + 112 frame #11: 0x00000001c56eb86c UIKitCore-[UIView(Hierarchy) _associatedViewControllerForwardsAppearanceCallbacks:performHierarchyCheck:isRoot:] + 220
frame #12: 0x00000001c56eb654 UIKitCore-[UIView(Hierarchy) _willMoveToWindow:withAncestorView:] + 188 frame #13: 0x00000001c56599f4 UIKitCore-[UIView(Internal) _addSubview:positioned:relativeTo:] + 376
frame #14: 0x0000000109d3a998 GoogleInteractiveMediaAds-[IMAAdDisplayContainer setAdViewController:] + 332 frame #15: 0x0000000109d2d9d0 GoogleInteractiveMediaAds-[IMAAdsManager handleMessageContentPauseRequested:] + 256
frame #16: 0x00000001c349e3b4 CoreFoundation__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148 frame #17: 0x00000001c3545444 CoreFoundation___CFXRegistrationPost_block_invoke + 88
frame #18: 0x00000001c35286f4 CoreFoundation_CFXRegistrationPost + 440 frame #19: 0x00000001c34b29b8 CoreFoundation_CFXNotificationPost + 704
frame #20: 0x00000001bd836d0c Foundation-[NSNotificationCenter postNotificationName:object:userInfo:] + 92 frame #21: 0x0000000109d49950 GoogleInteractiveMediaAds-[IMAJavaScriptSession didReceiveMessage:] + 272
frame #22: 0x0000000109d48ef0 GoogleInteractiveMediaAds-[IMABaseDispatcher processNewMessage:] + 204 frame #23: 0x0000000109d48e14 GoogleInteractiveMediaAds-[IMABaseDispatcher processNewMessageWithChannelName:data:] + 52
frame #24: 0x0000000109d4897c GoogleInteractiveMediaAds-[IMAWebViewDispatcher processNewMessageWithChannelName:data:] + 80 frame #25: 0x0000000109d27d88 GoogleInteractiveMediaAds-[IMAJavaScriptIosBridge webView:didReceiveMessage:] + 132
frame #26: 0x0000000109d482ec GoogleInteractiveMediaAds-[IMAWKWebView userContentController:didReceiveScriptMessage:] + 136 frame #27: 0x00000001d6182e98 WebKitScriptMessageHandlerDelegate::didPostMessage(WebKit::WebPageProxy&, WebKit::FrameInfoData&&, API::ContentWorld&, WebCore::SerializedScriptValue&) + 192
frame #28: 0x00000001d657fbf0 WebKitWebKit::WebUserContentControllerProxy::didPostMessage(WTF::ObjectIdentifier<WebKit::WebPageProxyIdentifierType>, WebKit::FrameInfoData&&, unsigned long long, WTF::Span<unsigned char const, 18446744073709551615ul> const&, WTF::CompletionHandler<void (WTF::Span<unsigned char const, 18446744073709551615ul> const&, WTF::String const&)>&&) + 680 frame #29: 0x00000001d69003d8 WebKitWebKit::WebUserContentControllerProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 2204
frame #30: 0x00000001d6273c28 WebKitIPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) + 192 frame #31: 0x00000001d64bde00 WebKitWebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 40
frame #32: 0x00000001d626c35c WebKitIPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >) + 260 frame #33: 0x00000001d626bae8 WebKitIPC::Connection::dispatchIncomingMessages() + 268
frame #34: 0x00000001d6b9a0b0 JavaScriptCoreWTF::RunLoop::performWork() + 200 frame #35: 0x00000001d6b9ade8 JavaScriptCoreWTF::RunLoop::performWork(void*) + 36
frame #36: 0x00000001c353cf24 CoreFoundation__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 frame #37: 0x00000001c35492fc CoreFoundation__CFRunLoopDoSource0 + 176
frame #38: 0x00000001c34cd1c0 CoreFoundation__CFRunLoopDoSources0 + 244 frame #39: 0x00000001c34e2b7c CoreFoundation__CFRunLoopRun + 836
frame #40: 0x00000001c34e7eb0 CoreFoundationCFRunLoopRunSpecific + 612 frame #41: 0x00000001fd6dd368 GraphicsServicesGSEventRunModal + 164
frame #42: 0x00000001c59dd668 UIKitCore-[UIApplication _run] + 888 frame #43: 0x00000001c59dd2cc UIKitCoreUIApplicationMain + 340
frame #44: 0x00000001cc00a308 libswiftUIKit.dylibUIKit.UIApplicationMain(Swift.Int32, Swift.Optional<Swift.UnsafeMutablePointer<Swift.UnsafeMutablePointer<Swift.Int8>>>, Swift.Optional<Swift.String>, Swift.Optional<Swift.String>) -> Swift.Int32 + 104 frame #45: 0x000000010506cd88 AajTakstatic UIApplicationDelegate.main() at :0

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

4 participants