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

Smart banner for app doesn't work
Hello everyone. I have a very strange behavior with smart app banners in Safari. When I don't have installed app on my phone, I can't see the banner on our product main page. When I installed the app, I can see the banner, which allows me to go directly to the app. When I put any other app's ID in the meta tag it works perfectly even if I don't have its installed app. So the code is right, what can be the reason of this behavior? Any settings of the app are required?
Topic: Safari & Web SubTopic: General Tags:
1
0
452
Mar ’25
Smart App Banner not appearing
I'm trying to set up a smart app banner for my app, but it doesn't appear on the website when I try to test it. I have the meta tag on my website: <meta name="apple-itunes-app" content="app-id=6740216045" /> When I inspect the website, I can see that the meta tag is showing up in the head, but the banner is nowhere to be found. I tried clearing website data but still no dice.
0
0
266
Jan ’25
Issue with Copy Functionality in WKWebView Using Mac Catalyst
Hello, I am developing a Mac application via Mac Catalyst and encountering an issue with WKWebView. Specifically, I'm loading a webpage (e.g., https://translate.google.com) in WKWebView, but when I press the copy button on the page, the content doesn't actually copy to the clipboard. I've attempted modifying the UserAgent without any success. Here is the relevant part of my code: override func viewDidLoad() { super.viewDidLoad() let config = WKWebViewConfiguration() config.preferences = WKPreferences() config.defaultWebpagePreferences.preferredContentMode = .desktop let webView = WKWebView(frame: .zero, configuration: config) webView.translatesAutoresizingMaskIntoConstraints = false view.addSubview(webView) webView.scrollView.showsVerticalScrollIndicator = false webView.backgroundColor = UIColor.white webView.scrollView.backgroundColor = UIColor.white webView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true webView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true webView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true webView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true if let url = URL(string: "https://translate.google.com") { let req = URLRequest(url: url) webView.load(req) } }
5
0
891
Jun ’25
WebRtc video not displayed in safari
Hi, I have implement a WebRtc cameras server: IP camera -> ffmpeg -> WebRtc -> browser The video codec used is H264. I test it on a MAC mini using safari browser (latest version) The Rtc peer connection is correctly connect but the video is not display. looking for the event on the video control, I got this: loadstart progress suspend On the MAC, I have also a chrome browser installed and trying the same, it works fine, I got this: loadstart progress loadmetadata loadeddata canplay canplaythrough playing the video control on the html page is declared like this: Does anyone have an idea why the video stay suspend or have a clue or tips to make it work? Thanks in advance
Topic: Safari & Web SubTopic: General
0
0
415
Dec ’24
Are my 3d stereo Mars images working fine on Vision Pro? (HEIC format created from 2 JPEGs)
I'm currently experimenting to add 3d stereo images in HEIC format to my daily Mars Rover Images website https://areo.info/mars20 which can be opened on a Vision Pro. Only a few images are yet converted into that mode, those on the sol 1411 page. As I'm currently only working in the Vision Pro Simulator from Xcode, no real 3d effect if of course visible and I'm curious if anyone using the real hardware can confirm that the images are working. Especially the eye distance correction is important to know about as the Mars Rover camera has a much wider pupil distance than humans and while I entered that distance in the conversion tool, I'm not sure if it worked well. So feedback is welcome! For those who like to try to create stereo images themselves: I used https://developer.apple.com/documentation/ImageIO/writing-spatial-photos to create a HEIC file from two JPEGs.
0
0
210
Feb ’25
iOS18 Static Rulesets Stop Working
iOS16 and iOS17 were fine, but on iOS18, our Safari extension that blocks content via static rulesets randomly stops working. Frequently, when a tab is left in the background for a long time (i.e. hours), the content blocker will stop working (until I either kill safari, or reload the extension). I've debugged this and the background.js script reports the ruleset as being loaded, but nevertheless, our rules aren't applied. I really don't think that it's an issue with the way that the rules are defined, since iOS16 and iOS17 worked fine, and on iOS18, the rules DO work. They just stop working after a while. "declarative_net_request": { "rule_resources": [ { "id": "ruleset_1", "enabled": true, "path": "ruleset_1.json" } ] }, Some theories: I have other content blockers on my phone that have LOTS of rules (adguard). Could I be seeing the effects of too many rules? Can I debug this somehow? Do logs get printed somewhere when the max rule limit is reached? Does the use of private and regular tabs mess things up? Please, any input is appreciated, as all of our logs are normal and error-free.
0
0
475
Nov ’24
Browser.tabs.create method "active"property not working on IOS 18.3
As of IOS 18.3, there browser.tabs.create methods active property which is supposed to determine whether a tab get open in the active window or not is not working as it should. I have the active property set to false but the tab still gets opened and is active on the window. Tested on older ios versions 18.2 and below and it works as it should. please advise
2
0
353
Feb ’25
A problem repeatedly occurred on website
We are having an issue on our website whilst using Iphones. A soon as the page loads it crashes and the it seems A problem repeatedly occurred to display page. This has been happening lately. This is the link. Can someone tell us what could be the issue? https://www.showshappening.com/TheTravellers/Travellers-Concert-2024 Thanks
Topic: Safari & Web SubTopic: General
1
0
474
Dec ’24
Add Authorization header to WKWebView.
How can i add Authorization header to a wkwebview. I checked https://developer.apple.com/documentation/foundation/nsurlrequest#1776617 which says Authorization header is a reserved http header and shouldn’t be set. I want to set it when requesting a url to the server which will be used for verification. How can i do that?
0
0
334
Feb ’25
WKWebView Authorization Challenge fails to refresh
I have a url that I want to stream, the stream is protected by basic auth. I am using URLAuthenticationChallenge (wkwebview navigation delegate function) method to provide my credentials. the credential changes with every stream url. The issue I am facing is that URLAuthenticationChallenge is never called upon refresh or on new URL request until the app is killed and opened again. I have tried: clearing cooking setting cache to ignore opening an another blank url using child view approach setting wkwebview instance to nil I always end up with 401 in decidePolicy (wkwebview delegate functions) on subsequent refresh call. Upon inspecting I see that it is using my previous used credentials and never calling challenge to update. *Backend has a no-cache policy in its header. **I am using http resource, the aim is to have streaming service on iOS. class ViewController: UIViewController, WKNavigationDelegate, WKUIDelegate { @IBOutlet weak var wkWebView: WKWebView! override func viewDidLoad() { super.viewDidLoad() let url = URL(string: "http://some-ip-address/some-path")! var request = URLRequest(url: url) request.httpMethod = "GET" wkWebView.configuration.allowsInlineMediaPlayback = true wkWebView.navigationDelegate = self wkWebView.load(request) } // this is just called once. we want to call it everytime our page refreshes. // we have tried clearing cache and cookies but failed to call challenge func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping(URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { let credential = URLCredential(user: "user", password: "password", persistence: .forSession) completionHandler(.useCredential, credential) } }
Topic: Safari & Web SubTopic: General Tags:
1
0
615
Nov ’24
Angular/Cordova application not responding to touch events
We have a Angular/Cordova application which is internal and is deployed on 10th gen iPad's currently. After updating the iOS version to 18.2 (current patch 18.2.1) the touch events on buttons and other views forms such as div are not firing the desired typescript methods. We are getting the touch events on the screen with relevant script which uses eventListner for debugging the touchevent but it doesn't fire at relevant methods at times. "click" can be replaced with "touchend "and "submit". document.addEventListener('click', (event) => { handleGlobalEvent(event, 'click'); });
Topic: Safari & Web SubTopic: General
1
0
282
Feb ’25
JavaScriptCore Crashed in iOS17 and above system
After the release of iOS17, our app has collected JavaScriptCore crashes, and the crash has recently appeared in iOS17 and above. The number of crashes collected recently is increasing. The following are several complete crash log information. Currently, crashes are only collected on iOS17 and above systems. 2024-05-08_20-45-00.5216_+0800-fdb980f66f56d73b944ccc3466922d7fd0690089.crash 2024-05-11_02-42-46.0303_+0800-5ea1f23ba38c4782b80bd6304a9625e305c296a2.crash 2024-05-13_14-30-03.2084_+0800-d9598b08a153f5214b51257400423d4079049578.crash
14
0
1.2k
Nov ’24
Safari App Extension – conflicting Bundle Identifier
Sometimes the Safari App Extension i'm developing does not show up in my Safari Extensions unless i change mu bundle identifier to some unique name. Even if I delete all other apps i've built with the same (and different) bundle ID, the extension is still does not show up. The only solution for me is to always change the bundle ID. For example: Now it is "kopyl.tab-finder-10" If i change it to "kopyl.tab-finder-11", the extension does show up in the Safari extensions settings page again. Is there any other way to fix it?
9
0
474
Feb ’25
iCloud Private Relay on local network (LAN)
Hi, I need a version of a web app to be accessible on a local network (LAN), when the users connect to a wifi without internet access. I provide a valid TLS certificate to validate the website. There is also a local DNS (dnsmasq), with the following entries to return NXDOMAIN, as specified by the documentation. server=/mask.icloud.com/ server=/mask-h2.icloud.com/ However, without internet (no cellular data), there is an error in Safari instead of the website. When there is some internet connection, there is a warning that allows to continue to the website by showing the IP address, which is not clear for the user. iPhone users are very frustrated. Is there a solution?
0
0
447
Nov ’24
PWA Web Push not arriving on iOS 18.0 - solved
Update: turns out the testphone with iOS 18 was set to 'Do not disturb'. Case closed. Hi all, I created a progressive web app. I is hosted on an actual live domain, served over https. When installed on an iPhone homescreen on iOS 17.7.2, sending web push notifications works fine: the response from the push service endpoint has a status code of 201, indicating all is good. In the service worker of the PWA, an eventlistener for the 'push' event is trigggered and displays an OS notification. On iOS18.0 however, even though the response from the push service endpoint has a status code of 201, there is no notification showing. Even though permission has been granted, and registration.pushManager.subscribe() is successful. When working locally, I've setup my server to run on localhost in https mode as well by following this excellent Technical Note to setup my own Certificate Authority, have it be trusted by my iOS test devices and have the CA issue a certificate so TLS can be set up. On this locally running https server, web push notifications do arrive for iOS 17.7.2, but also not for iOS18.0. I'm not sure how to start debugging this, as I can't seem to get the webinspector to show for the service worker most times, and when I can, there is no console.log() output visible. This still stands: So really, I'm looking for a (reliable) way to be able to debug this issues in safari, or find some documentation on what changed for Safari on iOS 18 that requires changes. Any help or thoughts on this matter?
1
0
841
Dec ’24
Apple Psy Button
I have enabled apple pay in my website.. After paying it collect my card details in popup and not showing to proceed the payment.. ![] [Image Edited by Moderator to Remove Personal Information]
Topic: Safari & Web SubTopic: General
0
0
223
Oct ’24
Safari Web Extension Handle Concurrency
We are building a Safari web extension utilising native messaging, to send messages to the Swift native part of the app. We sometimes experience, that the beginRequest handler is executed multiple times, at the same time. We have a special part of the code in the handler, that must be run only once. Because it uses NS defaults storage, and also because it calls our servers. We have tried to use a serial dispatch queue, as well as other locking and mutex techniques, to no success. We suspect that the instances of the handler are isolated in a way, that these locks don’t work (maybe they don’t share memory?). But we are not sure. When looking at os_logs from the handlers, they all share the same PID. Has anyone experienced anything similar and can shed some light on what's going on?
1
0
238
Feb ’25