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

Image link not working in Webview on iOS #456

Closed
WahibAbdul opened this issue Jun 25, 2019 · 3 comments
Closed

Image link not working in Webview on iOS #456

WahibAbdul opened this issue Jun 25, 2019 · 3 comments

Comments

@WahibAbdul
Copy link

I am trying to load some HTML in flutter webview. Normal links are working fine and navigating properly but the links embedded in the image are not navigating. Long press on image shows the Alertsheet to perform action on the link but it is not navigating from there also. This issue is only happening on iOS emulator and actual device but working fine on Android.

HTML

<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><em><strong><span style="font-size: 36pt;">Home Page</span></strong></em></p>
<p style="text-align: center;"><em><strong><span style="font-size: 36pt;"><iframe
                    src="https://www.youtube.com/embed/RuzVxQ9HmG0?rel=0" width="560" height="315" frameborder="0"
                    allowfullscreen=""></iframe></span></strong></em></p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: left;"><a href="https://www.customerconnect.biz"><em><strong><span style="font-size: 36pt;"> <img
                        src="https://cc-stage-images.s3-us-west-2.amazonaws.com/accounts/222/image_gallery/CC_logo.jpg"
                        alt="Image" width="194" height="194" /></span></strong></em></a></p>
<p style="text-align: left;"><em><strong><span style="font-size: 36pt;"><a title="Google"
                    href="https://www.google.com">https://www.google.com</a></span></strong></em></p>

System info

Issue occurs on: iOS
Plugin version: xxx
Flutter doctor output:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.6.3, on Mac OS X 10.14.3 18D42, locale en-US)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.35.1)
[✓] Connected device (1 available)

• No issues found!

Device Log on after tapping Image in webview

[DEVICE LOG] 2019-06-25 17:24:34.191229+0500  localhost Runner[9428]: (UIKitCore) Created Activity ID: 0x20db0, Description: send gesture
actions
[ +118 ms] [DEVICE LOG] 2019-06-25 17:24:34.311544+0500  localhost Runner[9428]: (UIKitCore) Created Activity ID: 0x20db1, Description: send gesture
actions
[  +62 ms] [DEVICE LOG] 2019-06-25 17:24:34.357494+0500  localhost Runner[9428]: (UIKitCore) Created Activity ID: 0x20db2, Description: send gesture
actions
[   +4 ms] [DEVICE LOG] 2019-06-25 17:24:34.357893+0500  localhost Runner[9428]: (UIKitCore) Created Activity ID: 0x20db3, Description: send gesture
actions
[  +53 ms] [DEVICE LOG] 2019-06-25 17:24:34.395527+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:ProcessSwapping] Launching a new process
[        ] [DEVICE LOG] 2019-06-25 17:24:34.397942+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:ProcessSwapping] 0x7f8b1c973e18 -
WebPageProxy::decidePolicyForNavigationAction, swapping process 9630 with process 0 for navigation, reason: Navigation is cross-site
[        ] [DEVICE LOG] 2019-06-25 17:24:34.398006+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:Loading] 0x7f8b1c973e18 -
WebPageProxy::continueNavigationInNewProcess: webPID = 9630, pageID = 3
[        ] [DEVICE LOG] 2019-06-25 17:24:34.398148+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:ProcessSwapping] 0x1372942c0 -
ProvisionalPageProxy::loadRequest: pageID = 3
[   +3 ms] [DEVICE LOG] 2019-06-25 17:24:34.398181+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:Loading] 0x7f8b1c973e18 -
WebPageProxy::loadRequestWithNavigation: webPID = 0, pageID = 3
[ +582 ms] [DEVICE LOG] 2019-06-25 17:24:35.022066+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:ProcessSwapping] 0x1372942c0 -
ProvisionalPageProxy::processDidFinishLaunching: pageID = 3
[        ] [DEVICE LOG] 2019-06-25 17:24:35.022142+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x1372a95a0 -
ProcessThrottler::didConnectToProcess(9699)
[        ] [DEVICE LOG] 2019-06-25 17:24:35.022172+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x1372a9380 -
WebProcessProxy::didSetAssertionState(Foreground) taking foreground assertion for network process
[  +23 ms] [DEVICE LOG] 2019-06-25 17:24:35.046800+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:ProcessSwapping] 0x1372942c0 -
ProvisionalPageProxy::didCreateMainFrame: pageID = 3, frameID = 1
[  +43 ms] [DEVICE LOG] 2019-06-25 17:24:35.088949+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:ProcessSwapping] 0x1372942c0 -
ProvisionalPageProxy::didStartProvisionalLoadForFrame: pageID = 3, frameID = 1, navigationID = 6
[        ] [DEVICE LOG] 2019-06-25 17:24:35.089047+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:Loading] 0x7f8b1c973e18 -
WebPageProxy::didStartProvisionalLoadForFrame: webPID = 9699, pageID = 3, frameID = 1
[        ] [DEVICE LOG] 2019-06-25 17:24:35.089157+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x600000fa3410 -
NavigationState is taking a process network assertion because a page load started
[  +21 ms] [DEVICE LOG] 2019-06-25 17:24:35.109635+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:ProcessSwapping] 0x7f8b1c973e18 -
WebPageProxy::decidePolicyForNavigationAction: keep using process 9630 for navigation, reason: Process has not yet committed any provisional loads
[   +1 ms] [DEVICE LOG] 2019-06-25 17:24:35.111142+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:Loading] 0x7f8b1c973e18 -
WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame: webPID = 9699, pageID = 3, frameID = 1
[  +17 ms] [DEVICE LOG] 2019-06-25 17:24:35.122835+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:ProcessSwapping] 0x1372942c0 -
ProvisionalPageProxy::didFailProvisionalLoadForFrame: pageID = 3, frameID = 1, navigationID = 6
[   +1 ms] [DEVICE LOG] 2019-06-25 17:24:35.122926+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:Process] 0x7f8b1c973e18 -
WebPageProxy::didFailProvisionalLoadForFrame: webPID = 9699, pageID = 3, frameID = 1, domain = NSURLErrorDomain, code = -1022
[  +14 ms] [DEVICE LOG] 2019-06-25 17:24:35.123008+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x600000fa3410 -
NavigationState will release its process network assertion soon because the page load completed
[        ] [DEVICE LOG] 2019-06-25 17:24:35.123066+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x1372a95a0 -
ProcessThrottler::updateAssertion() sending PrepareToSuspend IPC
[        ] [DEVICE LOG] 2019-06-25 17:24:35.123112+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x1372a9380 -
WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process
[+2975 ms] [DEVICE LOG] 2019-06-25 17:24:38.124339+0500  localhost Runner[9428]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x600000fa3410
NavigationState is releasing background process assertion because a page load completed
[ +746 ms] [DEVICE LOG] 2019-06-25 17:24:38.871304+0500  localhost Runner[9428]: (libxpc.dylib) Could not signal service com.apple.WebKit.WebContent:
113: Could not find specified service
[+14874 ms] [DEVICE LOG] 2019-06-25 17:24:53.746520+0500  localhost Runner[9428]: (libxpc.dylib) Could not signal service com.apple.WebKit.WebContent:
113: Could not find specified service
[+11378 ms] [DEVICE LOG] 2019-06-25 17:2
@charafau
Copy link
Collaborator

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    <key>NSAllowsArbitraryLoadsInWebContent</key>
    <true/>
</dict>

I think you need that in you Info.plist

@boozy-ph
Copy link

boozy-ph commented Dec 3, 2019

Hi @charafau I also encountered this issue even if NSAppTransportSecurity was already added in to Info.plist.

But most of the time, the following logs is what showing up, and that leaves on a blank screen if hidden option was set to false and non-stop loading if true.

[ +134 ms] [DEVICE LOG] 2019-12-03 16:46:09.626553+0800  localhost Runner[87603]: (WebKit) [com.apple.WebKit:Loading] 0x7f889b802020 -
WebPageProxy::constructor: webPID = 0, pageID = 6
[   +4 ms] [DEVICE LOG] 2019-12-03 16:46:09.631491+0800  localhost Runner[87603]: (WebKit) [com.apple.WebKit:ProcessSwapping] 0x12aeeb208 -
WebProcessCache::updateCapacity: Cache is disabled by client
[  +17 ms] [DEVICE LOG] 2019-12-03 16:46:09.648623+0800  localhost Runner[87603]: (WebKit) [com.apple.WebKit:ViewState] 0x6000016845f0 -
ApplicationStateTracker::ApplicationStateTracker(): m_isInBackground: 0
[  +17 ms] [DEVICE LOG] 2019-12-03 16:46:09.665895+0800  localhost Runner[87603]: (WebKit) [com.apple.WebKit:ViewState] 0x7f889b802020 -
WebPageProxy::updateActivityState: view visibility state changed 0 -> 1
[   +1 ms] [DEVICE LOG] 2019-12-03 16:46:09.667086+0800  localhost Runner[87603]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x7f889b802020 -
WebPageProxy::updateThrottleState: UIProcess is taking a foreground assertion because the view is visible
[        ] [DEVICE LOG] 2019-12-03 16:46:09.667485+0800  localhost Runner[87603]: (WebKit) [com.apple.WebKit:Loading] 0x7f889b802020 -
WebPageProxy::loadRequest: webPID = 0, pageID = 6
[   +1 ms] [DEVICE LOG] 2019-12-03 16:46:09.669096+0800  localhost Runner[87603]: (WebKit) [com.apple.WebKit:Loading] 0x7f889b802020 -
WebPageProxy::loadRequestWithNavigation: webPID = 0, pageID = 6
[  +14 ms] [DEVICE LOG] 2019-12-03 16:46:09.682764+0800  localhost Runner[87603]: (MobileAsset) [com.apple.mobileassetd:Notice]
_MobileAssetSendCopyMatchingAssetsCommand: [MobileAssetError:29] Unable to copy asset information from https://mesu.apple.com/assets/ for asset type
com.apple.MobileAsset.TextInput.SpellChecker
[ +138 ms] [DEVICE LOG] 2019-12-03 16:46:09.821361+0800  localhost Runner[87603]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x7f8897052fa0 -
ProcessThrottler::didConnectToProcess(87768)
[   +1 ms] [DEVICE LOG] 2019-12-03 16:46:09.821630+0800  localhost Runner[87603]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x12aef74b0 -
ProcessAssertion() PID 87603 acquiring assertion for process with PID 87768, name 'Web content visibility'
[        ] [DEVICE LOG] 2019-12-03 16:46:09.821947+0800  localhost Runner[87603]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x12aedd228 -
ProcessThrottler::didConnectToProcess(87767)
[        ] [DEVICE LOG] 2019-12-03 16:46:09.821998+0800  localhost Runner[87603]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x12aef74e0 -
ProcessAssertion() PID 87603 acquiring assertion for process with PID 87767, name 'Web content visibility'
[        ] [DEVICE LOG] 2019-12-03 16:46:09.822093+0800  localhost Runner[87603]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x6000020aa000 -
WKProcessAssertionBackgroundTaskManager - beginBackgroundTaskWithName
[   +2 ms] [DEVICE LOG] 2019-12-03 16:46:09.823201+0800  localhost Runner[87603]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x12aedd000 -
WebProcessProxy::didSetAssertionState(Foreground) taking foreground assertion for network process
[        ] [DEVICE LOG] 2019-12-03 16:46:09.823262+0800  localhost Runner[87603]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x7f8897052fa0 -
ProcessThrottler::updateAssertionNow() updating process assertion state to 3 (foregroundActivities: 1, backgroundActivities: 0)
[        ] [DEVICE LOG] 2019-12-03 16:46:09.823324+0800  localhost Runner[87603]: (WebKit) [com.apple.WebKit:ProcessSuspension] 0x12aef74b0 -
ProcessAssertion::setState(3) previousState: 0
[ +677 ms] [DEVICE LOG] 2019-12-03 16:46:10.507881+0800  localhost Runner[87603]: (WebKit) [com.apple.WebKit:Process] Created visibility propagation
view 0x7f8895500ca0 for WebContent process with PID 87767

Flutter doctor

[✓] Flutter (Channel dev, v1.12.16, on Mac OS X 10.15.1 19B88, locale
    en-PH)
 
[✓] Android toolchain - develop for Android devices (Android SDK version
    28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.40.2)
[✓] Connected device (1 available)

@boozy-ph
Copy link

boozy-ph commented Dec 4, 2019

Hi guys, I managed to fix my issue by encoding URL with this Uri.encodeFull(my_URL);.

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