bidalihq / commerce-sdk-ios Goto Github PK
View Code? Open in Web Editor NEWBidali Commerce SDK for iOS
Bidali Commerce SDK for iOS
Click Close button before the webview's content is loaded successfully and got this crash:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[BidaliWebViewController close]: unrecognized selector sent to instance 0x7f9707e5f340'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23b98bde __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff503b5b20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23bb9704 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 UIKitCore 0x00007fff47190773 -[UIResponder doesNotRecognizeSelector:] + 302
4 CoreFoundation 0x00007fff23b9d7bc forwarding + 1436
5 CoreFoundation 0x00007fff23b9f6c8 _CF_forwarding_prep_0 + 120
6 UIKitCore 0x00007fff47163d19 -[UIApplication sendAction:to:from:forEvent:] + 83
7 UIKitCore 0x00007fff46b55599 -[UIControl sendAction:to:forEvent:] + 223
8 UIKitCore 0x00007fff46b558e3 -[UIControl _sendActionsForEvents:withEvent:] + 398
9 UIKitCore 0x00007fff46b54842 -[UIControl touchesEnded:withEvent:] + 481
10 UIKitCore 0x00007fff4719e21f -[UIWindow _sendTouchesForEvent:] + 2604
11 UIKitCore 0x00007fff4719fb26 -[UIWindow sendEvent:] + 4596
12 UIKitCore 0x00007fff4717b1a7 -[UIApplication sendEvent:] + 356
13 UIKitCore 0x00007fff471faa18 __dispatchPreprocessedEventFromEventQueue + 6847
14 UIKitCore 0x00007fff471fd4de __handleEventQueueInternal + 5980
15 CoreFoundation 0x00007fff23afbac1 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
16 CoreFoundation 0x00007fff23afb9ec __CFRunLoopDoSource0 + 76
17 CoreFoundation 0x00007fff23afb21c __CFRunLoopDoSources0 + 268
18 CoreFoundation 0x00007fff23af5ecf __CFRunLoopRun + 1263
19 CoreFoundation 0x00007fff23af56b6 CFRunLoopRunSpecific + 438
20 GraphicsServices 0x00007fff3815cbb0 GSEventRunModal + 65
21 UIKitCore 0x00007fff47162a67 UIApplicationMain + 1621
22 TestApp 0x0000000104b8887b main + 75
23 libdyld.dylib 0x00007fff5123bcf5 start + 1
24 ??? 0x0000000000000001 0x0 + 1
)
I got this crash from crashlytics:
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0x91d3c __exceptionPreprocess
1 libobjc.A.dylib 0x146a8 objc_exception_throw
2 CoreFoundation 0xe4da4 __CFDictionaryCreateGeneric
3 WebKit 0x163b3c WebKit::CompletionHandlerCallChecker::~CompletionHandlerCallChecker()
4 WebKit 0x2864ec WTF::Ref<WebKit::CompletionHandlerCallChecker, WTF::RawPtrTraitsWebKit::CompletionHandlerCallChecker >::~Ref()
5 WebKit 0x310924 WTF::BlockPtr<void (WKNavigationResponsePolicy)> WTF::BlockPtr<void (WKNavigationResponsePolicy)>::fromCallable<WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse(WebKit::WebPageProxy&, WTF::Ref<API::NavigationResponse, WTF::RawPtrTraitsAPI::NavigationResponse >&&, WTF::Ref<WebKit::WebFramePolicyListenerProxy, WTF::RawPtrTraitsWebKit::WebFramePolicyListenerProxy >&&, API::Object*)::$_11>(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse(WebKit::WebPageProxy&, WTF::Ref<API::NavigationResponse, WTF::RawPtrTraitsAPI::NavigationResponse >&&, WTF::Ref<WebKit::WebFramePolicyListenerProxy, WTF::RawPtrTraitsWebKit::WebFramePolicyListenerProxy >&&, API::Object*)::$_11)::'lambda'(void const*)::__invoke(void const*)
6 libsystem_blocks.dylib 0x1834 _Block_release
7 WebKit 0x308a34 WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse(WebKit::WebPageProxy&, WTF::Ref<API::NavigationResponse, WTF::RawPtrTraitsAPI::NavigationResponse >&&, WTF::Ref<WebKit::WebFramePolicyListenerProxy, WTF::RawPtrTraitsWebKit::WebFramePolicyListenerProxy >&&, API::Object*)
8 WebKit 0x3e2674 WebKit::WebPageProxy::decidePolicyForResponseShared(WTF::Ref<WebKit::WebProcessProxy, WTF::RawPtrTraitsWebKit::WebProcessProxy >&&, WTF::ObjectIdentifierWebCore::PageIdentifierType, WTF::ObjectIdentifierWebCore::FrameIdentifierType, WebKit::FrameInfoData&&, WebCore::PolicyCheckIdentifier, unsigned long long, WebCore::ResourceResponse const&, WebCore::ResourceRequest const&, bool, WTF::String const&, bool, unsigned long long, WebKit::UserData const&)
9 WebKit 0x3e22e4 WebKit::WebPageProxy::decidePolicyForResponse(WTF::ObjectIdentifierWebCore::FrameIdentifierType, WebKit::FrameInfoData&&, WebCore::PolicyCheckIdentifier, unsigned long long, WebCore::ResourceResponse const&, WebCore::ResourceRequest const&, bool, WTF::String const&, bool, unsigned long long, WebKit::UserData const&)
10 WebKit 0x706f84 WebKit::WebPageProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
11 WebKit 0x53ae0 IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&)
12 WebKit 0x4212f8 WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
13 WebKit 0x33174 IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_deleteIPC::Decoder >)
14 WebKit 0x328a4 IPC::Connection::dispatchIncomingMessages()
15 JavaScriptCore 0xfd1968 WTF::RunLoop::performWork()
16 JavaScriptCore 0xfd284c WTF::RunLoop::performWork(void*)
17 CoreFoundation 0xb22b0 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION
18 CoreFoundation 0xc22d8 __CFRunLoopDoSource0
19 CoreFoundation 0x5678 __CFRunLoopDoSources0
20 CoreFoundation 0xaaa8 __CFRunLoopRun
21 CoreFoundation 0x1de1c CFRunLoopRunSpecific
22 GraphicsServices 0x19a0 GSEventRunModal
23 UIKitCore 0x4ebb90 -[UIApplication _run]
24 UIKitCore 0x28116c UIApplicationMain
25 AppTest 0x54f0 main + 15 (AppDelegate.swift:15)
26 ??? 0x105190250 (Missing)
Reason:
It could be related to missing calling completion handler on [WKWebViewJavascriptBridge webView:decidePolicyForNavigationResponse:decisionHandler:] in some cases.
1. WKWebViewJavascriptBridge.m at line 114
(void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler {
if (webView != _webView) { return; }
__strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate;
if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:decidePolicyForNavigationResponse:decisionHandler:)]) {
[strongDelegate webView:webView decidePolicyForNavigationResponse:navigationResponse decisionHandler:decisionHandler];
}
else {
decisionHandler(WKNavigationResponsePolicyAllow);
}
}
2. BidaliWebViewController.m at line 145 to 148
if (response.statusCode >= 400) {
[self close:nil];
return;
}
Solution:
Should call decisionHandler(WKNavigationResponsePolicyCancel); in that cases before return command.
Please help to check and fix it if possible.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.