Explore the integration of web technologies within your app. Discuss building web-based apps, leveraging Safari functionalities, and integrating with web services.

General Documentation

Posts under General subtopic

Post

Replies

Boosts

Views

Activity

iOS 18 beta5 webview terminated
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> .header { background-color: #fff; padding: .1rem .1rem; position: relative; width: 100%; } li { position: relative; line-height: .46rem; } .options { background-color: red; height: 4.8rem; height: 70vh; margin-top: -.01rem; max-height: 200px; overflow-x: hidden; overflow-y: auto; padding-bottom: .2rem; width: 100%; } .aaaa { max-width: 300px; max-height: 200px; } </style> </head> <body> <button id="aa_click">click</button> <div class="bbbbb"> <div class="aaaa"> <div class="header"> <h3>reason</h3><span class="close-pop"><i></i></span> </div> <div class="options"> <ul> <li class=""> <p class="optionItem">aa</p><i></i> </li> <li class=""> <p class="optionItem">bb</p><i></i> </li> <li class=""> <p class="optionItem">cc</p><i></i> </li> <li class=""> <p class="optionItem">dd</p><i></i> </li> <li class="selected"> <p class="optionItem">ee</p><i></i> </li> <li class=""> <p class="optionItem">ff</p><i></i> </li> <li class=""> <p class="optionItem">gg</p><i></i> </li> <li class=""> <p class="optionItem">sdf</p><i></i> </li> <li class=""> <p class="optionItem">aaa</p><i></i> </li> <li class=""> <p class="optionItem">aaa</p><i></i> </li> <li class=""> <p class="optionItem">aaa</p><i></i> </li> <li class=""> <p class="optionItem">aaa</p><i></i> </li> <li class=""> <p class="optionItem">aaa</p><i></i> </li> <li class=""> <p class="optionItem">aaa</p><i></i> </li> <li class=""> <p class="optionItem">aaa</p><i></i> </li> </ul> </div> </div> </div> <script> document.getElementById("aa_click").onclick = function () { let a = document.getElementsByClassName("bbbbb")[0]; let b = a.style.visibility if (b == 'hidden') { a.style.visibility = "visible"; } else { a.style.visibility = "hidden"; } }; </script> </body> </html> In iOS18 beta5, open this HTML with wkwebview, click the button to hide the list, and the webview will be terminated.If one of the following three conditions is triggered, the webview will not be terminated: Remove the elements in ul until the list is no longer slidable Remove the position:relative of the header element Remove the position:relative of the li element wkwebview error:
Topic: Safari & Web SubTopic: General
2
0
931
Aug ’24
Can't see response body in the web inspect.
When we activate the developer options and right-click to select "Inspect," then navigate to the Network tab, we can view the request entries. However, upon clicking on an entry, I can see the headers, cookies, and other details, but one crucial aspect is absent: the request and response data. This seems like a fundamental feature—why is it missing? 🤔
0
1
858
Aug ’24
App Creation
Hello, dear Apple community I have WordPress website: https://fritzboxwelt.de/ I was using Google Chrome to access the website dashboard. For some reason, I shifted from Chrome to Safari, but now I am facing errors when logging in. What should I do now? Is it a website issue or my browser settings are not okay? It will be great to hear from you.
0
0
423
Aug ’24
WKWebView adding cookie does not work with iOS 18 beta
If you create a cookie and add to the WKWebViewConfiguration the completionHandler returns 'Cookies synced' suggesting cookie was added with success. However, upon inspection of app in Safari the cookie is not there. This is broken in iOS 18 beta and works in previous versions without issue. Did Apple change the WKWebView API and break this feature? code snippet: NSDictionary* settings = self.commandDelegate.settings; WKWebViewConfiguration* configuration = [self createConfigurationFromSettings:settings]; configuration.userContentController = userContentController; NSMutableDictionary *cookieProperties = [NSMutableDictionary dictionary]; [cookieProperties setObject:@"foo" forKey:NSHTTPCookieName]; [cookieProperties setObject:@"bar" forKey:NSHTTPCookieValue]; [cookieProperties setObject:@"mydomain.com" forKey:NSHTTPCookieDomain]; [cookieProperties setObject:@"mydomain.com" forKey:NSHTTPCookieOriginURL]; [cookieProperties setObject:@"/" forKey:NSHTTPCookiePath]; NSHTTPCookie *cookie = [NSHTTPCookie cookieWithProperties:cookieProperties]; [configuration.websiteDataStore.httpCookieStore setCookie:cookie completionHandler:^{NSLog(@"Cookies synced");}]; WKWebView* wkWebView = [[WKWebView alloc] initWithFrame:self.engineWebView.frame configuration:configuration];
8
5
3.7k
Aug ’24
Cookies file path for WKWebView
Hi, I need to automate for testing/verification the cookies that were saved in my WKWebView application. I have used Activity Monitor to try and find the cookies file path but do not see it. I can see my local storage files saved to /Users/test/Library/WebKit/com.foo.ui/WebsiteData/Default/random_uuid/LocalStorage/localstorage.sqlite3 so I looked for a cookies file around there and found nothing. Where are cookies saved to on disk?
Topic: Safari & Web SubTopic: General
0
0
334
Aug ’24
Programmatically Opening an Installed PWA on iOS/iPadOS
Hello everyone, I am currently developing several Progressive Web Apps (PWAs) and I am wondering if it’s possible to programmatically open an installed PWA on iOS/iPadOS from another app or a link. My goal is to be able to launch an installed PWA directly from an action in another PWA, a web app, or a native app on iOS. For example, I’d like to know if this can be achieved via a deep link, a custom protocol (web+), or any other mechanism available on these platforms. Has anyone successfully implemented this feature or found a workaround to programmatically open an installed PWA on iOS/iPadOS? Thank you very much for your feedback and suggestions!
1
1
738
Aug ’24
Can the camera and microphone permission pop-up windows of wkwebview only pop up once when using wkwebview in the app?
When using wkwebview to load a web page for audio and video calls in iPhone and Mac apps, the permission box will pop up every time after reconstruction of wkwebview, affecting the user's use, is there any way to make the permission pop-up box only pop up for the first time, like app permision pop-up window,instead of popping up every time. If you have previously authorized the permission, even after the app is restarted, do not pop up the permission prompt box in the webview.
0
0
531
Aug ’24
WebView Upload File Can't Use Camera/Video
以下是包含完整日誌的回報範本: Title: WKWebView File Upload Causes App Crash When Selecting Camera or Recording Options Body: Hello, I am experiencing a critical issue with WKWebView in our iOS app when handling file uploads. We are using the following HTML element to allow users to capture images or videos, select from their photo library, or choose a file from the file system: <input type="file" accept="image/*;capture=camera" id="cameraInput"> Issue Description: When a user selects the camera or recording option, the app immediately crashes and returns to the WKWebView screen. This issue does not occur when selecting a file from the photo library or file system. Logs: Below are the relevant logs captured when the issue occurs: Presenting view controller <_UIContextMenuActionsOnlyViewController: 0x1034349e0> from detached view controller <MailVwCtl: 0x103838800> is not supported, and may result in incorrect safe area insets and a corrupt root presentation. Make sure <MailVwCtl: 0x103838800> is in the view controller hierarchy before presenting from it. Will become a hard exception in a future release. RotateN2:<MailVwCtl: 0x103838800> RotateN2:<MailVwCtl: 0x103838800> RotateN1:<Mail2000ViewController: 0x10350b780> RotateN2:<Mail2000ViewController: 0x10350b780> RotateN2:<MailVwCtl: 0x103838800> RotateN2:<MailVwCtl: 0x103838800> RotateN2:<Mail2000ViewController: 0x10350b780> RotateN1:<Mail2000ViewController: 0x10350b780> RotateN2:<Mail2000ViewController: 0x10350b780> RotateN2:<Mail2000ViewController: 0x10350b780> RotateN2:<Mail2000ViewController: 0x10350b780> RotateN2:<Mail2000ViewController: 0x10350b780> Unknown chipRevisionID (0xffffffff) Attempted to change to mode Portrait with an unsupported device (BackWideDual). Auto device for both positions unsupported, returning Auto device for same position anyway (BackAuto). Attempted to change to mode Portrait with an unsupported device (BackWideDual). Auto device for both positions unsupported, returning Auto device for same position anyway (BackAuto). Attempted to change to mode Portrait with an unsupported device (BackAuto). Auto device for both positions unsupported, returning Auto device for same position anyway (BackAuto). Attempted to change to mode Portrait with an unsupported device (BackWideDual). Auto device for both positions unsupported, returning Auto device for same position anyway (BackAuto). RotateN2:<Mail2000ViewController: 0x10350b780> RotateN2:<Mail2000ViewController: 0x10350b780> RotateN2:<Mail2000ViewController: 0x10350b780> WillDsAr:<MailVwCtl: 0x103838800> RotateN1:<Mail2000ViewController: 0x10350b780> RotateN2:<Mail2000ViewController: 0x10350b780> DidDsAr:<MailVwCtl: 0x103838800> <Mail2000ViewController: 0x10350b780>:VwWillAppear:1:x0 willAr:1,Fm:0,20,375,792-<MailVwCtl: 0x103838800> willAr:1,Bd:0,0,375,792-<MailVwCtl: 0x103838800> <MailVwCtl: 0x103838800>:VwDidAP: VwDidAP:Bd:0,0,375,792-<MailVwCtl: 0x103838800> VwDidAP:Fm:0,20,375,792-<MailVwCtl: 0x103838800> VwDiDAP:SetFm:0,20,375,792-<MailVwCtl: 0x103838800> ToolVwSetVwSize0:main,0,24,w=375,h=668,stepInd=0 ToolVwSetVwSize0:toobar_self,0,692,w=375,h=66 ToolVwSetVwSize:w=375,h=792 ToolVwSetVwSize1:main,0,0,w=375,h=727 ToolVwSetVwSize1:ToolBar,0,727,w=375,h=792 RotateN2:<Mail2000ViewController: 0x10350b780> RotateN2:<Mail2000ViewController: 0x10350b780> <Mail2000ViewController: 0x10350b780>:VwDidAppear:1:x0 M2KVC_DidAp0:0.000000 0.000000 375.000000 812.000000 Additional Context: This issue is critical as it affects the user experience severely. Notably, we have a similar issue in our Android app using WebView. In that case, the file upload options for camera, recording, and file selection do not appear at all, restricting users to only upload files from the phone's storage. We would like to inquire whether there have been recent changes to the APIs related to WKWebView and WebView or any known issues that could be causing this behavior. We are also concerned this might be a side effect of recent bug fixes or updates to WKWebView. Additional Context: This issue appears to be specific to iOS 17. We have tested the same functionality on devices running iOS versions below 17, and the camera and recording options work as expected without any crashes. This suggests that the issue may be introduced in iOS 17. You can view a video demonstrating the issue at this link: https://share.icloud.com/photos/001voevXriVXsEUmhzGsFBtSA Environment: iOS version: 17.6.1&17.5.1 Device: iPhone 15 Pro Max& iPhone 12 WKWebView version: [Your WKWebView version, if known] App platform: iOS Xcode version: 15.1 We appreciate any insights or guidance you can provide on this matter. Thank you.
2
0
2.0k
Aug ’24
WKWebView can't connect to external content in iOS 17.5+
My app Frax has long used a mechanism where a local webpage calls out to web-hosted content. In iOS 17.5+ (and iOS 18 beta) this has recently stopped working. The content fails to load, and the console log (running on iOS 17.6.1) contains: nw_application_id_create_self NECP_CLIENT_ACTION_GET_SIGNED_CLIENT_ID [80: Authentication error] Failed to resolve host network app id followed shortly by: Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "((target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.rendering AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.networking AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.webcontent))" UserInfo={NSLocalizedFailureReason=((target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.rendering AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.networking AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.webcontent))}> 0x128024480 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'XPCConnectionTerminationWatchdog' for process with PID=9736, error: (null) This same code has worked reliably for years, and continues to work properly under iOS 16 and earlier. But there are increasing reports of this new error showing up around the web. Nothing in recent iOS 17 release notes sheds any light on what might have changed, and all my efforts to troubleshoot or mitigate this issue have failed. Any help on how to solve or work around this would be greatly appreciated!
Topic: Safari & Web SubTopic: General
8
4
6.5k
Aug ’24
How to reduce manual user interaction in Safari Extension setup?
Currently, after installing our Safari Extension, users must manually enable it within Safari Preferences under Extensions settings. This involves: Navigating to Safari Preferences. Selecting Extensions. Checking the checkbox to enable the Extension. Clicking on “Always Allow on Every Website” to grant necessary permissions. We are seeking guidance or the possibility of introducing an automation feature that would streamline these steps. The goal is to reduce manual user interaction. Are there existing APIs or methods within Safari's framework that we could utilize to automate these setup steps? What are the best practices for ensuring a smooth setup process? Thanks.
0
0
376
Aug ’24
AASA File Not Working as Expected with Hybrid Mobile App and Web Authentication
Hello, We are currently offering both a mobile web and a mobile app service. Our mobile app operates in a hybrid manner by utilizing the mobile web. However, when the app is installed, it seems that the AASA file is not functioning correctly on the mobile web. The AASA file we are using is as follows: AASA : { "applinks": { "apps": [], "details": [ { "appID": "Z9VSKJ792A.com.coke.cokeplaynew", "components": [ { "exclude": true, "/": "/payment/" }, { "exclude": true, "/": "/member/pass/" }, { "exclude": true, "/": "/member/check/pass" }, { "exclude": true, "/": "/member/passWeb" }, { "exclude": true, "/event/spritecoolcoupon" } ] } ] } } We are experiencing an issue when performing pass authentication on the mobile web. When opening a new window for authentication, the new window is generated correctly in the mobile web browser. However, after completing the authentication and posting back to the parent window at the /member/check/pass URL, the app is being launched, which causes a service error. (This URL is excluded in the AASA file.) It doesn’t seem like there’s an issue with the AASA configuration, but we are wondering if there might be another underlying problem. Thank you for your assistance.
Topic: Safari & Web SubTopic: General
1
0
315
Aug ’24
Getting an MPAN, merchant token or merchantTokenIdentifier
We are trying to retrieve merchant tokens from ApplePay. We used the javascript codes from Apple Pay demo site to request for a recurring payment from the frontend. "recurringPaymentRequest": { "paymentDescription": "A description of the recurring payment to display to the user in the payment sheet.", "regularBilling": { "label": "Recurring", "amount": "4.99", "paymentTiming": "recurring", "recurringPaymentStartDate": "2023-08-11T11:20:32.369Z" }, "trialBilling": { "label": "7 Day Trial", "amount": "0.00", "paymentTiming": "recurring", "recurringPaymentEndDate": "2023-08-11T11:20:32.369Z" }, "billingAgreement": "A localized billing agreement displayed to the user in the payment sheet prior to the payment authorization.", "managementURL": "https://applepaydemo.apple.com", "tokenNotificationURL": "https://applepaydemo.apple.com" } Payment was successful, but merchantTokenIdentifier is not shown in the in decrypted ApplePay token, regardless of test card used. We tried Visa and MasterCard.
2
1
1.3k
Aug ’24
safaridriver failing to launch
MacOS Sonoma 14.6.1 Safari 17.6 Have been trying to launch Safaridriver and consistently getting the error: ERROR: safaridriver could not launch because it is not configured correctly or you need to authenticate. Re-run safaridriver(1) and pass the '--enable' flag to configure and/or authenticate. I have admin rights on the machine, but when I try the flag --enable, I get 'Password is not valid, please try again' (tried with different admin accounts). Sudo lets me use the --enable flag, but still getting the same error when trying to run. This seems to be a recent problem - worked a couple of months ago.
Topic: Safari & Web SubTopic: General
2
1
629
Aug ’24
Safari web extension content blocker takes time to reflect on simulator few devices
We have implemented a content blocker using the Safari Web Extension, which can be toggled on or off as needed. However, we've noticed that changes in the Safari browser take effect only after the page is reloaded again. This behaviour has been observed across all simulators as well as on iPhone 8 Plus running iOS 16.7.8. Is this due to a delay in the JS file rules updation on simulator and lower devices?
1
0
537
Aug ’24
Username & Password
I have a project where I have two text fields for a user to enter a username and password. When the user clicks the submit button, I want the text they enter to auto inject into a username/password field on a website to log them in. Any ideas how I can make this?
Topic: Safari & Web SubTopic: General
2
0
437
Aug ’24
Mobile IOS v17.5 crashes when opening specific pdf
I have a few pdfs that contains images/grayscale images that opened properly on my app with IOS 16.5 but since upgrading to 17.5, the app crashes with “A problem has repeatedly occured on...” this means the IOS itself is not able to handle the pdf otherwise we would get an error from our app. Previously, while we got a warning in the console saying that the max canvas has been exceeded. The app did not crash. Would it be possible to know what was the changes coming in version 17.0+ that could have caused this? And if so, should this be a bug that gets fixed? I’ve looked at the release note and can’t pinpoint which changes could have caused this new behaviour. This occurs on safari and chrome.
1
0
634
Aug ’24
SFSafariViewController lifecycle delegate
Hello, Is it possible to use a delegate or other approach to detect lifecycle events like form submissions / navigation events from the SFSafariViewController from the application that creates the Safari instance? The use case is a centralised session keep-alive requirement to extend the ttl on tokens for multiple third-party clients that use Single-Sign-On via browser cookies for authentication.
Topic: Safari & Web SubTopic: General
1
0
309
Aug ’24
Unable to manually or programmatically create cookie with SameSite=None on iPadOS 18 beta
Unable to create a cookie using WebKit API or manually create a cookie in Safari with SameSite=None on a device using iPadOS 18 beta. In Safari, the None option is still in the drop down as a selection for SameSite which leads me to believe this is a bug. Is this going to be fixed in the release version of iOS 18?
2
0
1.1k
Aug ’24
Issue with Authentication Sharing Between Native App and WebView
I’m working on an iOS app using WKWebView, and I’ve implemented the following authentication flow: Sign-In Process: The sign-in process is handled natively. Access Token Storage: Once the user is signed in, the access token is stored within the app. WebView Cookie Setting: When a webview is opened, the app sets the access token in the webview’s cookies. Token Validation: The web server validates the access token from the cookie. Problem: I’m encountering an issue where the authentication state between the native app and the webview doesn’t always synchronize correctly. Specifically: Sign-In Issue: If a user signs in while the webview is already open, the native app attempts to set the cookie in the webview. However, there are cases where the cookie isn’t set properly, and the server fails to retrieve the access token, similar to when a user is signed out. Sign-Out Issue: When a user signs out, the native app deletes the cookie. Although the app reports success in deleting the cookie, the webview sometimes still retains the cookie, which can cause inconsistencies. These issues don’t happen consistently, and the behavior seems to be somewhat random. My Questions: Is there a problem with how I’m sharing authentication between the native app and the webview? Do you have any suggestions or best practices for ensuring that the cookie management between the native app and WKWebView is reliable? Thank you in advance for your help! I believe that the native app should manage the cookies for the WKWebView. However, I’m encountering issues where the cookies are not always synchronized properly between the native app and the webview.
0
0
587
Aug ’24