Explore WKWebView additions

RSS for tag

Discuss the WWDC21 session Explore WKWebView additions.

Posts under wwdc21-10032 tag

73 Posts

Post

Replies

Boosts

Views

Activity

IOS 13 webview keyboard messes up with webview display
I am displaying this contact form inside my webview but when I click on the bottom most text area it focuses on it and moves the point of view into the center ( I think this is a normal / desirable behavior ) But after the keyboard hides it remains like that thus creating a white space on the bottom part and It will get stuck into this state unless I click the top most input text. I checked this behavior on IOS 14 and it seems like it got fixed. But I am just wondering how to get around this on IOS 13.
0
0
443
Sep ’21
How to enable Cross-Site tracking on WKWebView
I have an iOS webview app which require access to third party cookies accessed from inside an iFrame, even if I clear the Prevent Cross Site Tracking on IPhone Safari Settings, it does not work! But when I access the webview link directly using Safari (Desktop) and clear the Prevent Cross-Site Tracking, it works fine! I have been trying for over a week now, and no luck I have added NSCrossWebsiteTrackingUsageDescription to the info.plist on the iOS app and I can see the new settings for the app, but even if I allow cross-site tracking, still does not work! I have also added WKAppBoundDomains to the info.plist as an array with different combination as below: thirdparty.com, *.thirdparty.com, a.thirdparty.com, a.b.thirdparty.com with no luck either! I have been searching SO, Apple Forum and webkit for many days, seems some people have it working but i have no clue how did they get it to work as there were no clear solutions? I am not sure why Safari (Desktop) behaves in a different manner to Safari (Mobile)! I have tried on simulator and an iphone device, cleared all data and website cookies, still not working. If you have successfully implemented WkAppBoundDomains or NSCrossWebsiteTrackingUsageDescription, please share your solution as I am out of ideas. Your time is greatly appreciated Xcode: 12, iOS: 14
0
0
1.4k
Sep ’21
WKWebView keyboard suggestions not showing for email field.
WKWebView keyboard suggestions not showing for email field/username field. We tried the autocomplete attribute - ‘username’ in the HTML page content.  The HTML page has the following code for the above - input id="user-text-field" type="email" autocomplete="username We are currently using iPhone7 with iOS version 14.4, and iPhone X with 14.5 iOS version. Any help would be greatly appreciated. Thank you
0
0
603
Sep ’21
Microphone access - WKBWebview
For iOS 14.3 apple announced WebRTC support for WKWebViews. For iOS 15, extension in such support was announced. I have loaded a WebView in both, iOS 14.5 and iOS 15 and observed different behaviors. Things do not work for either iOS. My website, requires access to the microphone. When I load it for iOS 14.5, and click on the microphone, the app crashes with a memory exception (Malloc) for webkit userPermissionRequestProxy. When I use iOS 15, no error or crash occurs, yet the microphone is not working. I have updated the info.plist file to allow permissions I am giving access to AVAudioSession. Is there anything else I need to do?
0
0
734
Sep ’21
WKWebView + ReactJS + HTTP Request issues
Hi there, I am currently working on a small MacOS status bar app that involves running a local ReactJS app within a WKWebView. For the most part communication between Swift and React is accomplished via evaluateJavaScript / userContentController handler/listeners, but in some instances, I am using fetch GET/POST requests within the React app to retrieve data from an API I am serving elsewhere. The problem I am running into is when I make an HTTP GET request within the React app to retrieve some data from my server, I can see it reaching the endpoint, however the response in React is never fulfilled. When testing this in React alone in a web browser it works fine, which leads me to believe this is a security issue with WKWebView or a greater extent the app. I've tried numerous NSAppTransport settings to no avail. Any thoughts on this issue would be greatly appreciated.
0
0
573
Sep ’21
Getting error “Could not create sandbox extension” while loading Webview on Flutter iOS.
I am trying to load HTML along with JavaScript file from the assets folder using "webview_flutter" plugin. On the webview loading page I am getting this error I have also added "NSAppTransportSecurity" permissions to the Info.plist file and changed the iOS deployment target version to 11.0, 12.0. But still not working any solution.
0
0
542
Aug ’21
iOS 15 Beta 2 - WKWebView - Web socket server not receives large Message (2MB)
I have iOS application which has WebSocket communication between Xcode libraries and WKWebView (Java script) front end UI. client usually sends 200 bytes. however on demand, it may send upto 2MB encrypted binary data messages. In iOS 14, server (Java script) was able to receive 2 MB of binary message. In iOS 15 Beta 1 & 2, not able receive message beyond 500 KB. Do I need to tune any properties to receive 2 MB data ? , is there any relation between this issue and com.apple.developer.kernel.increased-memory-limit entitlements
1
0
1.2k
Aug ’21
Print page numbers in WKWebView
I am printing the contents rendered on a WKWebView using this API. https://developer.apple.com/documentation/webkit/wkwebview/3516861-printoperationwithprintinfo?language=objc The print preview loads fine, but I am unable to print page numbers. I tried overriding the drawPageBorderWithSize method of NSView (since WKWebView inherits from NSView) but that never gets called. I asked a question in the Apple Developer Technical Support and I was asked to use CSS styling to print page numbers. I then tried to use the following solution in CSS: #content { display: table; } #pageFooter { display: table-footer-group; } #pageFooter:after { counter-increment: page; content: counter(page); } <div id="content"> <div id="pageFooter">Page </div> multi-page content here... </div> However, when I try this I only get Page1 at the bottom of the last page. Are there any working solutions for printing page numbers using CSS styling?
0
0
889
Aug ’21
WKWebview page redirect blocked by security rules
We are loading a web page on wkwebview, the page redirects and loads another page but, lately we are seeing the page is blocked by security rules. (PFA) The same code works fine in PROD environment. it is a third party provider claims we are redirecting twice but, we are not doing any reduction on our own but, I do see more than one call in Charles proxy. we are using navigation delegates to check for response and see 403 response as seen in the report. I did enable Allow Arbitrary Loads in ATS but, still same result. please advise
0
0
811
Jul ’21
Can someone tell me Does iOS App Bound Domain feature supports Wildcard domain? Any help is appreciated.
iOS 14 introduced a new feature called App Bound Domains where you can provide few particular domain names, and you can show web content from that limited number of domains only, in your app, and it does not navigate away from those domains. I would like to know Does this feature supports the wildcards Domain? Any help is appreciated.
0
0
459
Jul ’21
Terminating app when using camera as file input in WKWebView
I'm building an ios app using WKWebView. In HTML I'm using the following as file upload <input type="file" accept="image/*" capture="environment"> but the app terminated with an error Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Source type must be UIImagePickerControllerSourceTypeCamera' In the Info.plist i've added the Privacy - Camera Usage Description also for Microphone and Photo Library usage
0
0
645
Jul ’21
IOS 13 webview keyboard messes up with webview display
I am displaying this contact form inside my webview but when I click on the bottom most text area it focuses on it and moves the point of view into the center ( I think this is a normal / desirable behavior ) But after the keyboard hides it remains like that thus creating a white space on the bottom part and It will get stuck into this state unless I click the top most input text. I checked this behavior on IOS 14 and it seems like it got fixed. But I am just wondering how to get around this on IOS 13.
Replies
0
Boosts
0
Views
443
Activity
Sep ’21
How to enable Cross-Site tracking on WKWebView
I have an iOS webview app which require access to third party cookies accessed from inside an iFrame, even if I clear the Prevent Cross Site Tracking on IPhone Safari Settings, it does not work! But when I access the webview link directly using Safari (Desktop) and clear the Prevent Cross-Site Tracking, it works fine! I have been trying for over a week now, and no luck I have added NSCrossWebsiteTrackingUsageDescription to the info.plist on the iOS app and I can see the new settings for the app, but even if I allow cross-site tracking, still does not work! I have also added WKAppBoundDomains to the info.plist as an array with different combination as below: thirdparty.com, *.thirdparty.com, a.thirdparty.com, a.b.thirdparty.com with no luck either! I have been searching SO, Apple Forum and webkit for many days, seems some people have it working but i have no clue how did they get it to work as there were no clear solutions? I am not sure why Safari (Desktop) behaves in a different manner to Safari (Mobile)! I have tried on simulator and an iphone device, cleared all data and website cookies, still not working. If you have successfully implemented WkAppBoundDomains or NSCrossWebsiteTrackingUsageDescription, please share your solution as I am out of ideas. Your time is greatly appreciated Xcode: 12, iOS: 14
Replies
0
Boosts
0
Views
1.4k
Activity
Sep ’21
WKWebView keyboard suggestions not showing for email field.
WKWebView keyboard suggestions not showing for email field/username field. We tried the autocomplete attribute - ‘username’ in the HTML page content.  The HTML page has the following code for the above - input id="user-text-field" type="email" autocomplete="username We are currently using iPhone7 with iOS version 14.4, and iPhone X with 14.5 iOS version. Any help would be greatly appreciated. Thank you
Replies
0
Boosts
0
Views
603
Activity
Sep ’21
Microphone access - WKBWebview
For iOS 14.3 apple announced WebRTC support for WKWebViews. For iOS 15, extension in such support was announced. I have loaded a WebView in both, iOS 14.5 and iOS 15 and observed different behaviors. Things do not work for either iOS. My website, requires access to the microphone. When I load it for iOS 14.5, and click on the microphone, the app crashes with a memory exception (Malloc) for webkit userPermissionRequestProxy. When I use iOS 15, no error or crash occurs, yet the microphone is not working. I have updated the info.plist file to allow permissions I am giving access to AVAudioSession. Is there anything else I need to do?
Replies
0
Boosts
0
Views
734
Activity
Sep ’21
WKWebView + ReactJS + HTTP Request issues
Hi there, I am currently working on a small MacOS status bar app that involves running a local ReactJS app within a WKWebView. For the most part communication between Swift and React is accomplished via evaluateJavaScript / userContentController handler/listeners, but in some instances, I am using fetch GET/POST requests within the React app to retrieve data from an API I am serving elsewhere. The problem I am running into is when I make an HTTP GET request within the React app to retrieve some data from my server, I can see it reaching the endpoint, however the response in React is never fulfilled. When testing this in React alone in a web browser it works fine, which leads me to believe this is a security issue with WKWebView or a greater extent the app. I've tried numerous NSAppTransport settings to no avail. Any thoughts on this issue would be greatly appreciated.
Replies
0
Boosts
0
Views
573
Activity
Sep ’21
Getting error “Could not create sandbox extension” while loading Webview on Flutter iOS.
I am trying to load HTML along with JavaScript file from the assets folder using "webview_flutter" plugin. On the webview loading page I am getting this error I have also added "NSAppTransportSecurity" permissions to the Info.plist file and changed the iOS deployment target version to 11.0, 12.0. But still not working any solution.
Replies
0
Boosts
0
Views
542
Activity
Aug ’21
iOS 15 Beta 2 - WKWebView - Web socket server not receives large Message (2MB)
I have iOS application which has WebSocket communication between Xcode libraries and WKWebView (Java script) front end UI. client usually sends 200 bytes. however on demand, it may send upto 2MB encrypted binary data messages. In iOS 14, server (Java script) was able to receive 2 MB of binary message. In iOS 15 Beta 1 & 2, not able receive message beyond 500 KB. Do I need to tune any properties to receive 2 MB data ? , is there any relation between this issue and com.apple.developer.kernel.increased-memory-limit entitlements
Replies
1
Boosts
0
Views
1.2k
Activity
Aug ’21
Print page numbers in WKWebView
I am printing the contents rendered on a WKWebView using this API. https://developer.apple.com/documentation/webkit/wkwebview/3516861-printoperationwithprintinfo?language=objc The print preview loads fine, but I am unable to print page numbers. I tried overriding the drawPageBorderWithSize method of NSView (since WKWebView inherits from NSView) but that never gets called. I asked a question in the Apple Developer Technical Support and I was asked to use CSS styling to print page numbers. I then tried to use the following solution in CSS: #content { display: table; } #pageFooter { display: table-footer-group; } #pageFooter:after { counter-increment: page; content: counter(page); } <div id="content"> <div id="pageFooter">Page </div> multi-page content here... </div> However, when I try this I only get Page1 at the bottom of the last page. Are there any working solutions for printing page numbers using CSS styling?
Replies
0
Boosts
0
Views
889
Activity
Aug ’21
WKWebiew snapshot configuration not supported in iOS 9
I m getting crash when I try to take snapshot of wkwebview in iOS 9.can anyone please help me to resolve this issue? webView takeSnapshotWithConfiguration:theConfiguration completionHandler:^(UIImage * _Nullable snapshotImage, NSError * _Nullable error)
Replies
0
Boosts
0
Views
435
Activity
Jul ’21
WKWebview page redirect blocked by security rules
We are loading a web page on wkwebview, the page redirects and loads another page but, lately we are seeing the page is blocked by security rules. (PFA) The same code works fine in PROD environment. it is a third party provider claims we are redirecting twice but, we are not doing any reduction on our own but, I do see more than one call in Charles proxy. we are using navigation delegates to check for response and see 403 response as seen in the report. I did enable Allow Arbitrary Loads in ATS but, still same result. please advise
Replies
0
Boosts
0
Views
811
Activity
Jul ’21
Can someone tell me Does iOS App Bound Domain feature supports Wildcard domain? Any help is appreciated.
iOS 14 introduced a new feature called App Bound Domains where you can provide few particular domain names, and you can show web content from that limited number of domains only, in your app, and it does not navigate away from those domains. I would like to know Does this feature supports the wildcards Domain? Any help is appreciated.
Replies
0
Boosts
0
Views
459
Activity
Jul ’21
WKWebView content stretch in iOS 14
When I hit one specific URL into WKWEbView , Barcode get stretch in iOS 14 , Barcode displays proper in iOS 13. Can anyone help me on this problem?
Replies
0
Boosts
0
Views
394
Activity
Jul ’21
Terminating app when using camera as file input in WKWebView
I'm building an ios app using WKWebView. In HTML I'm using the following as file upload <input type="file" accept="image/*" capture="environment"> but the app terminated with an error Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Source type must be UIImagePickerControllerSourceTypeCamera' In the Info.plist i've added the Privacy - Camera Usage Description also for Microphone and Photo Library usage
Replies
0
Boosts
0
Views
645
Activity
Jul ’21