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

General Documentation

Post

Replies

Boosts

Views

Activity

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.
1
0
171
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
191
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!
6
3
1.4k
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
413
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
301
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!
0
0
282
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?
0
0
199
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
1.3k
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
229
Aug ’24
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:
2
0
490
Aug ’24
Authenticate Safari Extension with Web Application
Hi :) I am building browser extension that is integral part of our bigger web service. Since it needs to authenticate with our web application to use its api. Extension was originally developed for the Chrome and there everything works perfectly fine without any additional work. When I am authenticated on the platform I am able to use extension on any website and while making api calls from extensions background script to the platform backend the cookie is automatically attached to it. I just do fetch without any headers etc everything works out of the box. Then I used the xcrun safari-web-extension-converter and converted the chrome extension to safari. I tested local build as well as build submitted to test flight and none of these seems to work the same way as on chrome. Meaning I am not able to make this safari extension pick up the cookie from my web application. I found that if I disable: prevent cross-site tracking in Safari Settings it works. But obviously its not a solution for the normal users. Can anyone help me to make it work? I am not very familiar with apple dev environment.
3
0
354
Aug ’24
contenteditable + getBoundingClientRect() does not return the correct result.
If a sufficiently long text in an HTML tag leads to a text wrap, the calculated values (y and width) of getBoundingClientRect for characters or words directly after the wrap are not correct, if the element or one of a parent is contenteditable="true" the y value has the value as if it were still before the break the width value spans the entire width, Here a code that reproduces this failure: https://stackblitz.com/edit/vitejs-vite-jwghts?file=src%2Fmain.ts,src%2FcalcLetterRects.ts,src%2Fstyle.css
1
0
225
Aug ’24
Safari Extension iOS18: Image are not loading.
Hi, I'm experiencing an issue with my Safari extension on iOS 18. When trying to access images using browser.runtime.getURL(), it doesn't work as expected. The same code works on iOS 17 and earlier versions. Here's my manifest file and code snippet. "web_accessible_resources": [ { "resources": [ "html/*.html", "images/*.png", "images/*.gif", "images/*.svg", "json/*.json", "fonts/*.ttf", "css/*.css" ], "matches": [ "<all_urls>" ] }, "images/fs_loading.svg", "images/status_protected.svg", "images/safe_check_icon.svg" ] `var status_ok_svg = browser.runtime.getURL("images/status_protected.svg");` Note: Image all are added in Images folder only
1
0
342
Aug ’24
On iOS18 Beta 3 Version, Unable to load a javascript file from Salesforce in the WebView.
On iOS18 Beta 3 Version, Unable to load a javascript file from Salesforce in the WebView. When trying to load a javascript file (static resource) from Salesforce in WebView. It's throwing below mentioned error. Error: Refused to execute https://*.my.salesforce.com/resource/1722959303321/T1C_Base__DealsLib/src/ace-lib.js as script because "X-Content-Type-Options: nosniff" was given and its Content-Type is not a script MIME type. The error is only happening after upgrading to iOS18 Beta. It was working fine before. Expected Behaviour: File should be loaded successfully Actual Behaviour: File is not loading Xcode Version: 15.3
0
0
215
Aug ’24
iOS Safari extension background doesn't show any console logs
My Safari extension (based off a Chrome one) is working fine in a Mac OS Safari version but when I try to run it on the phone I'm experiencing some bugs in communication with the backend, which I cannot troubleshoot because when I click on Develop > my_phone > Safari Extension Background Content I don't see any logs in there. Where the background logs are supposed to appear? How can I find them? I don't see them in Xcode either.
2
0
287
Aug ’24
push notification on safari not work.
I am developing a web application with PWA and Vue.js (javascript). I would like to add a Web Push notification function, so I referred to the following site to execute notification permission and received the response result "granted". https://developer.mozilla.org/ja/docs/Web/API/Notification/requestPermission_static I have tried both requestPermission(); and requestPermission(callback). However, in this state, an error occurred when subscribing to pushManager, and push notification registration could not be executed. As a workaround, I found that by changing the notification permission setting from the OS Settings > Notification screen to Off and On, subscribing to pushManager was successful. Is there anything else I need to implement other than calling requestPermission(); or requestPermission(callback) to make it executable without following the workaround steps? In addition, this phenomenon was not occurring around the beginning of June 2024, and it was confirmed that the problem occurred as of August 5th. The confirmed OS and models are as follows. iOS 17.4 Mobile Safari iPad iOS 17.3 Mobile Safari iOS 15.8 Mobile Safari iOS 17.3 Mobile Safari iPad iOS 15.8 Mobile Safari iPad iOS 17.4 Mobile Safari iOS 16.7 Mobile Safari
0
0
397
Aug ’24
In iOS 18, browser.tabs.getSelected returns 'Undefined' for the Safari iOS App Extension
I was able to obtain the URL in iOS 17+ and lower versions by using the browser.tabs.getSelected method in background.js, and it was successful. I upgraded to iOS 18 and now this function is returning 'Undefined'. As a result, the Safari Extension feature is broken. Is this browser.tabs.getSelected no longer available or deprecated as of iOS 18? As an alternative, browser.tabs.query functions. is a useful substitute for that.
3
0
496
Aug ’24