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

All subtopics
Posts under Safari & Web topic

Post

Replies

Boosts

Views

Activity

Issue with SFSafariViewController Not Always Detecting Redirect After Stripe Payment
I am using SFSafariViewController to process payments via a Stripe checkout URL. Once the payment is completed, the user is redirected to a success URL. I have also added associated domains for deep linking. Below is my implementation: func presentCheckout(url: String) { showProgressHUD() let checkoutURL = URL(string: url)! safariVC = SFSafariViewController(url: checkoutURL) safariVC.delegate = self self.present(safariVC, animated: true) } // Delegate method implementations func safariViewControllerDidFinish(_ controller: SFSafariViewController) { print("SafariViewController dismissed") // Handle dismissal } func safariViewController(_ controller: SFSafariViewController, initialLoadDidRedirectTo URL: URL) { print(URL.absoluteString) if URL.absoluteString.contains("xsworld/payment/stripe/checkout/success") { controller.dismiss(animated: true) { if URL.absoluteString.contains("/v1/resources/xsworld/payment/stripe/checkout") { NotificationCenter.default.post( name: Notification.Name("StripePaymentStatus"), object: nil, userInfo: ["url": URL] ) } } } else if URL.absoluteString.contains("xsworld/payment/stripe/checkout/cancel") { // Handle failure NotificationCenter.default.post( name: Notification.Name("StripePaymentStatus"), object: nil, userInfo: ["url": URL] ) } } func safariViewController(_ controller: SFSafariViewController, didCompleteInitialLoad didLoadSuccessfully: Bool) { if didLoadSuccessfully { print("Initial page loaded successfully") } else { print("Initial page load failed") } } Issue: The safariViewController(_:initialLoadDidRedirectTo:) method does not always get called after the payment is completed. Sometimes it works as expected, and sometimes it does not trigger at all. What I’ve Tried: Ensuring the associated domains for deep linking are correctly set up. Checking the success and failure URLs. Debugging to see if the redirect happens but is not detected. What I Need Help With: I want to ensure that the redirection always works after the payment process is completed, whether through deep linking or another reliable approach. How can I guarantee that my app correctly detects and handles the redirect every time? Any guidance or best practices would be greatly appreciated.
0
0
411
Feb ’25
Fullscreen Api
Hi, i embedded vimeo video on the website and alreay make it allowfullscreen. However, when i open chrome/firefox on Ipad, the vidoe not showing fullscreen. Also on iPhone, when exit the fullscreen video. It doesnt hide the iframe element. Initially, i hide the iframe and implement button so that when user click on it, the video will display full screen
Topic: Safari & Web SubTopic: General Tags:
0
0
482
Oct ’24
XMLHttpRequest cannot load https://demo2.artios.cz/app37g/v105/php/endpoint.php due to access control checks
Hi, we are experiencing a strange issue with our Web App. Our web app runs entirely on the same domain , and we are making several AJAX requests to the same server. The Error occurs only on Iphones, the app works completely fine on androids and computers. Most of the requests work fine, but suddenly, one specific request always fails with the following error: XMLHttpRequest cannot load https://demo2.artios.cz/app37g/v105/php/endpoint.php due to access control checks What we have checked so far: ✅ CORS headers seem correct. Also we operate entirely on the same domain, client and server. ✅ The same request works fine in computer and android devices. ✅ The issue occurs only on iPhone (tested on Chrome and Safari). ✅ Some requests to the same endpoint pass, but suddenly, this specific request always fails. ✅ There is no OPTIONS preflight request logged in the network tab, but we use only simple requests. ✅ We are making a POST request with multipart/form-data. What is Your advice, or where I can find more info about this error? We do not think the CORS is the problem. We have tried to inspect with WebInspector but with no relevant answers. Thank You very much!
0
1
508
Feb ’25
Safari - cookie setting default behavior in iOS 18
Hello! I have a question about changes in default behavior of Safari related to cookie setting. We had an issue - our Single Sign On login was not working, because of lost cookie on some step of the flow. Only changes in Safari cross-website tracking settings helped to fix the issue So the question is - are there any official documentation about changes in cookie setting policy in Safari on iOS 18?
Topic: Safari & Web SubTopic: General Tags:
0
0
376
Oct ’24
iPadOSにおけるChromeブラウザとWKWebView API利用時のWebRTCカメラアクセスに関する問い合わせ
私たちはJavaアプリケーション開発者で、iPadOS上でのWebRTCによるカメラアクセスに関して、iPadOS 17.1での挙動について質問がございます。 具体的には、iPadOS 17.1でChromeブラウザを利用し、WKWebView API経由でカメラにアクセスしようとした際、エラーが発生し、カメラ撮影が実行できない現象が発生しております。弊社の調査では、WKWebView APIのnavigator.mediaDevicesプロパティを通じたデバイスアクセスが、Chromeで動作しない可能性が示唆されました。しかし、Safariブラウザでは正常に動作するため、Chromeに固有の制限があるのか、またはiPadOSの設定や仕様に起因するのか判断しかねております。 現在、iPadOS 17.1でのカメラアクセスに関するWKWebViewとWebRTCの仕様やChromeでの制約について、ご見解や解決策についてご教示いただけますと幸いです。 どうぞよろしくお願いいたします。
Topic: Safari & Web SubTopic: General
0
0
368
Nov ’24
Apple Pay on the Web fails with an "AbortError" in production
Apple Pay fails with an "AbortError" when the dialog for the fingerprint sensor opens. How do I find the cause of the "AbortError" which only occurs in the web integration in our production environment? In the sandbox environment, Apple Pay works flawlessly. This concerns a web integration of Apple Pay using the Apple Pay SDK, one version before 1.2.0. The error occurs when I call the show() method on the PaymentRequest object. The Apple Pay dialog opens with the fingerprint icon, but after one second, an exclamation mark appears, and the Apple Pay dialog closes again while throwing the "AbortError". I know that our Apple Pay integration worked for multiple customers in the production environment already. The current problem is that Apple's error message, called "AbortError," provides no indication of the cause. This could be greatly improved. One affected customer, for example, is the one with the Merchant ID … (Is it safe to post a Merchant ID in this forum?) I can reproduce the "AbortError" issue at any time using my iPhone with iOS 16.7.8.
0
0
357
Jan ’25
I am using WkWebview
I am trying to access a camera from web view and I'm unable to load the updated UI in web view and web view gets flick for every few seconds. The updated UI has some more functionality, but the web page not getting loaded.
0
0
380
Oct ’24
Local storage/db of WKWebView in App Clips and installed Apps
Hello, I am studying a possible scenario. Let's say I create an App Clip that features a WKWebView. The WKWebView hosts a sort of webapp that uses local storage and IndexDB. When the complete app is installed, are the data persisted so the WKWebView of the complete app finds them as it was reading them before? Are the data transferred by the operating system to a new location but still accessed the same way by the WKWebView (Or even the location is the same because it is the WKWebView special storage)? Or are they wiped out? Thank you in advance Best regards
0
0
422
Jan ’25
FetchEvent.respondWith is terminated in 70 seconds in ServiceWorker
Hi, there. I am trying to use ServiceWorker on iPad to retry a request that has a communication error. However, I am having trouble with the process being terminated after 70 seconds. Occurs at least on iPadOS 17.6.1 and 16.3. The following is the service worker code to reproduce the problem: self.addEventListener('fetch', (event) => { if (event.request.url.includes('test.html')) { event.respondWith(longRunFetch()); } }); async function longRunFetch(request) { await new Promise(resolve => setTimeout(resolve, 75000)); return new Response('Fetch completed'); } When this code is executed on an iPad and a request is made to test.html, the service worker stops after about 70 seconds. When it stops, it falls back to the network request and the contents of test.html are displayed. The service worker thread appears to be killed and is unavailable until the browser is restarted. If timeout is set to 65000, 'Fetch completed' is displayed as expected. Why is the process terminated in 70 seconds? Is there any way to continue processing beyond 70 seconds?
0
0
499
Sep ’24
Pay dialog never times out?
We're using the PaymentRequestAPI, and to my surprise I see that if we open the payment dialog then don't interact with it - biometrics to approve or cancel/X button - it sits there open indefinitely. Is there any way to tell it to only sit there for some limited time period before canceling?
0
0
332
Jan ’25
WKWebview termination due to memory. Adjustable threshold for termination?
Hi, Our company has an application uses the WKWebview to host a lot of content. The content is web based and hosts a lot of charts and metrics. Because of the high content, we've seen the memory of the WebContent hit above 1.25 GB. When that happens, it'll eventually terminate and we have our recovery code to reload the same page Seems like the limit is hidden / internal. Some Apple devs also noted something might be hard coded to be limited as well. Yes, we have our optimizations but we still need to keep our queries, use react, cache, etc... It's just a heavy web application. Request: Can you help us raise that limit? Are there some limitations in Webkit for such a need to terminate? As some devices have much higher RAM than before, we were hoping to be able to dynamically adjust the limit for the wkwebview before it resets. We contacted our internal contacts but they said to post here.
0
1
453
Jan ’25
Apple Messages strips URL from HTML clipboard
Hi there, I use the Clipboard API to create formatted project links with a "copy link" button. This has been really versatile for end users. When they paste into their email, they get a hyperlinked project name that leads to the project, and when they paste into the URL bar, they just get the project URL. It used to be that pasting into Messages on Mac would yield the same behavior as pasting into the URL bar. But recently, Messages started only pasting the inner text of the HTML clipboard, so no URL, just the project name, which isn’t very useful for a copy link function. Is there any way to ensure that Messages pastes the URL while maintaining my formatting options on other surfaces?
0
0
334
Feb ’25
Smart Banner for Testflight App
Hi, I am wondering if anyone has experience with Smart Banners for an application not released on the app store, but still in TestFlight, specifically an AppClip. I am working on an exisiting project where a Smart Clip is used with a smart banner on the website for core functionality. Previously, even in test environment (app is in test flight and not app store) the smart banner would correctly show on the website and allow testers to launch the app clip experience, however this no longer seems to work. Its noted the test environment was last tested and deployed 2 years ago, and was working correctly, and there have been no changes to the website (the meta tag and .aasa file are all setup correctly). The only recent change was upgrading the app to support the latest iOS version, however beyond that no functionality in the app has changed. Apple developer support hasn't been very helpful, and reviewed our account and stated "everything appears to be running as expected on our end" Has something changed in Safari in that it no longer accepts test flight app smart banners, and if it doesn't, does anyone have any other suggestions? Cheers
0
1
403
Jan ’25
XSRF-TOKEN can not be set in Safari 17.0 over IPv6
Hi, When we using Safari on MacOS with IPv6 we found that the XSRF-TOKEN can be set into the cookies. We have set-cookie in the authentication response headers 'Set-Cookie: XSRF-TOKEN=*******; SameSite=Strict; Secure'. It works by using Safari with IPv4. And also works with Chrome/FireFox with IPv4/IPv6. And also worked with Safari 15.6.1 over IPv6. May I know if this an issue or by design? Anyone aware of this? Thanks.
0
0
368
Dec ’24
HTMLAudioElement on iOS is paused when video plays again
On iOS (iPhone or iPad) the following behaviour happens: when both an HTML video element and an HTML audio element are playing on a page, and the video source ends, and the video source is programmatically forced to play again then the system will automatically pause the audio. See following stackblitz project for a sample: https://stackblitz.com/edit/ios-audio-paused-on-video-playing?file=README.md Steps to reproduce Feel free to try with both another audio and video source, here limited by the available space in Stackblitz plan. On an iPhone/iPad device or simulator, in Safari: browse to index.html when on iPhone, press iPhone Load to force preloading video. Not needed on iPad press Play to start playing both audio and video wait until clip ends and then restarts from 0:00 Expected Audio should keep on playing and eventually loop. Actual When clip restarts from 0, audio is put to pause by the system. Further details This does not happen e.g. on Mac Safari nor on another device/browser. Also, some alternative scenarios: when HTML video element has the muted attribute, the issue disappears and audio is not paused when HTML audio element is replace with Web Audio API, the issue disappears and audio is not paused
Topic: Safari & Web SubTopic: General Tags:
0
0
292
Jan ’25
关于 Ipad 18 在 Safari 浏览器的 PUT 请求问题
正常情况下,浏览器执行PUT请求会返回上传进度 在Safari 浏览器上,Ipad 16,Ipad 17 均正常,Ipad 18 上传进度返回一直不变 ipad版本兼容性问题 ipad (16+Safari):动作正常(逐步显示上传进度) ipad (17+Safari):动作正常(逐步显示上传进度) ipad (18+Safari):动作不正常(显示1%直到完成)
Topic: Safari & Web SubTopic: General
0
0
172
Nov ’24
iOS 18.0.1 - SafariViewService - LIBXPC - XPC_EXIT_REASON_FAULT
Title: SafariViewService Recurring "Hard Refresh" Issue on iOS 18.0.1 Hello, Many of my app users are experiencing a recurring "hard refresh" issue related to SafariViewService, which appears only on iOS 18.0.1 across various iPhone models. Users on earlier iOS versions are not encountering this problem. Our app relies on SafariViewService, and the logs show an event triggered by an EXC_GUARD exception with a termination reason from LIBXPC, causing the app to stop. Below are key details from the log report: App Version: 4.1.2 (build 4.1.1.0) OS Version: iPhone OS 18.0.1 Exception Type: EXC_GUARD Subtype: GUARD_TYPE_USER Termination Reason: LIBXPC, XPC_EXIT_REASON_FAULT Device Model: iPhone 11 Pro Max Process Path: [Removed] Here’s an excerpt from the logs: ... {"codes":"0x6000000000000007, 0x0000000000000009","reason":9,"message":"namespc 7 reason_code 0x0000000000000009","subtype":"GUARD_TYPE_USER","type":"EXC_GUARD","rawCodes":[Removed],"namespc":7}, "termination" : {"flags":518,"code":9,"namespace":"LIBXPC","indicator":"XPC_EXIT_REASON_FAULT"}, ... I would greatly appreciate any guidance on resolving this issue, particularly if there are known concerns with inter-process communication (LIBXPC) in iOS 18.0.1 or advice on how to manage the EXC_GUARD exception more effectively. Full log details are in the attachment. Thank you for your help! ExcUserFault_SafariViewService-2024-10-10-102717 (1).ips ExcUserFault_OnixWorker.Maui-2024-10-10-102718 (1).ips Thank you for your help!
0
8
1.4k
Oct ’24