Dear Community,
We encountered a problem working with the webview.
Working principle:
the user navigates to the webview screen where a site is called that expects 3DSecure payment confirmation, the webview itself makes constant requests and polls the confirmation page (an example of the response we get, but we do not directly control these calls):
{
"code": "1",
"data": {
"response": {
"success": "true"
}
}
}
{
"code": "1",
"data": {
"response": {
"thisTranId": "8034327064401",
"mcpResponse": "<Envelope><Header><RequestId>8034327064401</RequestId></Header><Body><Invoke><ActionRs><ActionResult><Item Name=\"Status\">null</Item><Item Name=\"CRes\"><String>someString</String></Item></ActionResult></ActionRs></Invoke></Body></Envelope>"
}
}
}
If the application is not minimized, upon receiving confirmation, a POST request redirect occurs and the user successfully completes the flow.
If during the receipt of confirmation, the application is minimized, upon returning the application to the foreground, the expected POST request with the redirect does not execute
The problem only arose when users upgraded to iOS version 16.4 and above.
Perhaps with the release of new versions, additional conditions have appeared and it is necessary to add some permission in the project settings or the webview itself?
Best regards,
Oleksii Baridn
General
RSS for tagExplore the integration of web technologies within your app. Discuss building web-based apps, leveraging Safari functionalities, and integrating with web services.
Post
Replies
Boosts
Views
Activity
When I tap my app's icon on suggestion of safari sharesheet, I gets URL of website through Share Extension. I want to get PDF file cached url for default. User can select PDF inside option menu on the top of sharesheet. Can I set it to PDF as default?
ShareExtension Info-plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsAttachmentsWithMaxCount</key>
<integer>20</integer>
<key>NSExtensionActivationSupportsFileWithMaxCount</key>
<integer>20</integer>
<key>NSExtensionActivationSupportsWebPageWithMaxCount</key>
<integer>0</integer>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>0</integer>
</dict>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>
</dict>
</plist>
Main App info-plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>PDF</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.adobe.pdf</string>
</array>
<key>UIActivityTypes</key>
<array>
<string>UIActivityTypeAirDrop</string>
<string>UIActivityTypeCopyToPasteboard</string>
<string>UIActivityTypeAddToReadingList</string>
<string>UIActivityTypeMarkupAsPDF</string>
<string>UIActivityTypeOpenInIBooks</string>
<string>UIActivityTypePrint</string>
</array>
</dict>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>sharePDF</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>quickAction</string>
</array>
</dict>
</array>
<key>ITSEncryptionExportComplianceCode</key>
<string>$(PRODUCT_NAME)</string>
<key>UIFileSharingEnabled</key>
<true/>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
<string>public.composite-content</string>
</array>
<key>UTTypeDescription</key>
<string>PDF Document</string>
<key>UTTypeIdentifier</key>
<string>com.adobe.pdf</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>pdf</string>
<key>public.mime-type</key>
<string>application/pdf</string>
</dict>
</dict>
</array>
</dict>
</plist>
Hello everyone Please help me, I have a WebGL template for the game and it perfectly stretches the game space to the entire size of the browser on desktop and android browsers, however, on iOS devices with horizontal orientation, white stripes appear on the sides that cannot be removed in any way, what can be done in this situation?
I used a css template
border: 0;
padding: 0;
margin: 0;
font-family: 'Noto Sans', sans-serif;
font-size: 1.1em;
}
html,
body {
width: 100%;
height: 100%;
padding: constant(safe-area-inset-top) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left);
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#unity-container {
position: absolute;
width: 100%;
height: 100%;
min-width: 100%;
min-height: 100%;
}
#unity-container.unity-desktop {
width: 100%;
height: 100%
}
#unity-container.unity-mobile {
width: 100%;
height: 100%
}
#unity-canvas {
width: 100%;
height: 100%;
min-width: 100%;
min-height: 100%;
{ background:{ #ffffff;} }
}
.unity-desktop #unity-canvas {
width: 100%;
height: 100%
}
.unity-mobile #unity-canvas {
width: 100%;
height: 100%
}
#unity-canvas+* {
z-index: 2;
}
![]("https://developer.apple.com/forums/content/attachment/976b3f3e-3e10-43a8-aaa6-06a2163bf626" "title=zBom7vEWA9I.jpg;width=1280;height=591")
I can create a new JSContext and use this to perform JavaScript operations. But if I want to shut down the JS Core after I have finished with it (without killing the app this is running in) I can find no means of doing that.
Is there a way to get the iOS system to release all memory/resources associated with the JSCore after I have finished with it?
The Apple docs at https://developer.apple.com/documentation/javascriptcore/jscontext don't provide any guidance for how to remove the JS Core after use. Maybe I am missing something.
I did also look at the underlying JSVirtualMemory instance, but again there is no obvious way to shut this down and release all memory.
If I simply dereference the JSContext instance, I would have hoped that this might trigger cleanup but it does not.
Hello,
I am trying to apply ProxyConfiguration on the WebKit webview.
I've tried HTTP and SOCKSv5 without authentication, and it proxies normally. However, after I set up username authenticate on the server side, then set username and password with applyCredential on the client side, it couldn't authenticate the connection.
Logs on the server side show the client side says it doesn't support any authentication.
So I have some questions about the authentication:
Does the ProxyConfiguration support authentication now?
Does applyCredential apply credentials on HTTP/HTTPS and SOCKSv5 proxy?
var session = new ApplePaySession(9, mySimpleRequest);
window.session = session;
//Setup handler for validation the merchant session.
= function (event) {
alert("onvalidatemerchant AppleSession before validation-" + JSON.stringify(session));
//Create the payload.
var data = {
validationUrl: event.validationURL
};
var antiforgeryHeader = $("meta[name='x-antiforgery-name']").attr("content");
var antiforgeryToken = $("meta[name='x-antiforgery-token']").attr("content");
var headers = {};
headers[antiforgeryHeader] = antiforgeryToken;
// alert("merchantRequest: " + JSON.stringify(data));
// alert("Controller:" + $("link[rel='merchant-validation']").attr("href"));
$.ajax({
url: $("link[rel='merchant-validation']").attr("href"),
method: "POST",
contentType: "application/json; chaxset=utf-8",
data: JSON.stringify(data),
headers: headers
}).then(function (merchantSession) {
alert("onvalidatemerchant AppleSession after validation-" + JSON.stringify(session));
alert("merchantSession-" + JSON.stringify(merchantSession));
console.log("merchantSession-" + JSON.stringify(merchantSession));
//alert("jsonparse: "+JSON.parse(merchantSession));
if (session == null || session == undefined) {
alert("nsession object is null, skipping");
}
else {
alert("nsession object is NOT null, Calling completeMerchantValidation");
session.completeMerchantValidation(merchantSession);
}
}).catch((error) => {
alert(error + "------------- in line")
});
};
this is my code and this is my merchantSession object :
merchantSession-{"status":"200","statusMessage":{"epochTimestamp":1690527282002,"expiresAt":1690530882002,"merchantSessionIdentifier":"SSH79603FE752F1424D8A5DE6F3D4850847_916523AAED1343F5BC5815E12BEE9250AFFDC1A17C46B0DE5A943F0F94927C24","nonce":"96538fcc","merchantIdentifier":"6DC048609B1AF64EDF23F1BE4EE4984A0A6DF1E80B16A816204A0541B2613627","domainName":"applepay.traveazy.dev","displayName":"ApplePay","signature":"308006092a864886f70d010702a0803080020101310d300b0609608648016503040201308006092a864886f70d0107010000a080308203e330820388a00302010202084c304149519d5436300a06082a8648ce3d040302307a312e302c06035504030c254170706c65204170706c69636174696f6e20496e746567726174696f6e204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b3009060355040613025553301e170d3139303531383031333235375a170d3234303531363031333235375a305f3125302306035504030c1c6563632d736d702d62726f6b65722d7369676e5f5543342d50524f4431143012060355040b0c0b694f532053797374656d7331133011060355040a0c0a4170706c6520496e632e310b30090603550406130255533059301306072a8648ce3d020106082a8648ce3d03010703420004c21577edebd6c7b2218f68dd7090a1218dc7b0bd6f2c283d846095d94af4a5411b83420ed811f3407e83331f1c54c3f7eb3220d6bad5d4eff49289893e7c0f13a38202113082020d300c0603551d130101ff04023000301f0603551d2304183016801423f249c44f93e4ef27e6c4f6286c3fa2bbfd2e4b304506082b0601050507010104393037303506082b060105050730018629687474703a2f2f6f6373702e6170706c652e636f6d2f6f63737030342d6170706c65616963613330323082011d0603551d2004820114308201103082010c06092a864886f7636405013081fe3081c306082b060105050702023081b60c81b352656c69616e6365206f6e207468697320636572746966696361746520627920616e7920706172747920617373756d657320616363657074616e6365206f6620746865207468656e206170706c696361626c65207374616e64617264207465726d7320616e6420636f6e646974696f6e73206f66207573652c20636572746966696361746520706f6c69637920616e642063657274696669636174696f6e2070726163746963652073746174656d656e74732e303606082b06010505070201162a687474703a2f2f7777772e6170706c652e636f6d2f6365727469666963617465617574686f726974792f30340603551d1f042d302b3029a027a0258623687474703a2f2f63726c2e6170706c652e636f6d2f6170706c6561696361332e63726c301d0603551d0e041604149457db6fd57481868989762f7e578507e79b5824300e0603551d0f0101ff040403020780300f06092a864886f76364061d04020500300a06082a8648ce3d0403020349003046022100be09571fe71e1e735b55e5afacb4c72feb445f30185222c7251002b61ebd6f55022100d18b350a5dd6dd6eb1746035b11eb2ce87cfa3e6af6cbd8380890dc82cddaa63308202ee30820275a0030201020208496d2fbf3a98da97300a06082a8648ce3d0403023067311b301906035504030c124170706c6520526f6f74204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b3009060355040613025553301e170d3134303530363233343633305a170d3239303530363233343633305a307a312e302c06035504030c254170706c65204170706c69636174696f6e20496e746567726174696f6e204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b30090603550406130255533059301306072a8648ce3d020106082a8648ce3d03010703420004f017118419d76485d51a5e25810776e880a2efde7bae4de08dfc4b93e13356d5665b35ae22d097760d224e7bba08fd7617ce88cb76bb6670bec8e82984ff5445a381f73081f4304606082b06010505070101043a3038303606082b06010505073001862a687474703a2f2f6f6373702e6170706c652e636f6d2f6f63737030342d6170706c65726f6f7463616733301d0603551d0e0416041423f249c44f93e4ef27e6c4f6286c3fa2bbfd2e4b300f0603551d130101ff040530030101ff301f0603551d23041830168014bbb0dea15833889aa48a99debebdebafdacb24ab30370603551d1f0430302e302ca02aa0288626687474703a2f2f63726c2e6170706c652e636f6d2f6170706c65726f6f74636167332e6300","operationalAnalyticsIdentifier":"ApplePay:6DC048609B1AF64EDF23F1BE4EE4984A0A6DF1E80B16A816204A0541B2613627","retries":0,"pspId":"6DC048609B1AF64EDF23F1BE4EE4984A0A6DF1E80B16A816204A0541B2613627"},"statusCode":200}
browser.scripting.registerContentScripts was introduced in Safari 16.4.
However, in Safari 16.6, we have just noticed that browser.scripting.registerContentScripts removes content scripts declared in the manifest (FB12817504).
Any work-arounds?
I'm curious if there is a limit to number of PWA push notifications that can be sent.
We estimate roughly 10,000 pushes a day.
If anyone has any insight it would be greatly appreciated.
My team is working on creating a web app which is working great on all tested devices except iPad (4GB RAM). In safari (or chrome) on iPad the web app crashes on pretty much any page after spam clicking through the app for a minute or so. Looking at the jetsam logs, the process that is being killed is consistently com.apple.WebKit.GPU due to "highwater". The memory usage of this process at the time of crashing ranges from 316MB to 522MB.
What steps would you suggest next to diagnose the root cause? We are testing out a bunch of different changes to improve overall memory management and performance of the app, but I'm wondering if there is a way to find exactly what is taking up memory instead of brute-force solutioning, and why is it always the GPU process that is being killed?
Does AVP simulator have a way to simulate hand events on safari such as click, double click, etc.?
The Problem
Whilst using the AVP Simulator with a Trackpad on my Macbook Pro, Safari on VisionOS produces trackpad events such as as touchstart, touchmove, mouseout, etc on the window object. To ensure things work well with hands, we need to know what kind of events will be generated on the window object when hands is used as an input.
Can anyone recommend how this can be tested?
Hi there,
I'm currently making a web application using webRTC.
Even though all the SDP info and ICES of caller, callee are well transmitted, the connection was kept failing.
The other devices are functioning well.
However at just Iphone(13), it's not working.
I tried to connect at same network. And it's working.
Therefore I think it's a problem about Ice candidates.
I read similar post to avoid this issue.
And when one of safari's advanced option called WebRTC platform UDP sockets is disabled it's working.
Is there a way that I can connect without tuning options of Safari?
Thanks.
FYI
this is one of my Iphone's Ice
candidate:842163049 1 udp 1685921535 118.235.10.100 50750 typ srflx raddr 0.0.0.0 rport 50750 generation 0 ufrag 7e7f network-id 3 network-cost 900
Hello,
I am developing a PWA (Progressive Web App) for schedule management and I'd like to implement a feature where users receive notifications at specified times, even when offline. Currently, notifications appear while the PWA is active in the foreground, but they do not appear when the app is in the background. I understand that Safari currently only supports push notifications and not local notifications.
I am curious to know if there are any plans or upcoming support for this feature in Safari for PWAs. Could you please provide any insight or updates on this matter?
Thank you in advance for your assistance.
I am trying to automate Web app on iOS Safari for e2e test.
Even though following code worked for emulator in iOS 17 beta,
it seems not working on Real Device(iPhone 12, iOS 16.6).
code for test
describe("test0", () => {
const getDriver = async () => {
const options = new safari.Options()
const capabilities = webdriver.Capabilities.safari()
capabilities.setPlatform('ios')
capabilities.set('safari:deviceType', 'iphone')
capabilities.set('safari:useSimulator', false)
const driver = new Builder().forBrowser('safari').withCapabilities(capabilities).setSafariOptions(options).build()
return driver
}
let driver
beforeAll(async () => {
driver = await getDriver()
}, 10000000)
afterAll(async () => {
await driver.quit();
});
test("test", async () => {
await driver.get("https://google.com");
}, 1000000);
});
Following error will happen when testing through real device while device is listed on Device and Simulators opened by Xcode > Window > Device and Simulators.
SessionNotCreatedError: Could not create a session: Some devices were found, but could not be used:
- iPhone (***-xxxxxxx): Remote Automation is turned off (turn it on via Settings > Safari > Advanced > Remote Automation)
- [unknown wireless device]: device is not paired
at Object.throwDecodedError (../node_modules/selenium-webdriver/lib/error.js:524:15)
at parseHttpResponse (../node_modules/selenium-webdriver/lib/http.js:601:13)
at Executor.execute (../node_modules/selenium-webdriver/lib/http.js:529:28)
What I tried
I turned on Safari > Advanced > Web Inspector, Safari > Advanced > Remote Automation, Developper > Enable UI Automation on iOS setting.
I enabled safaridriver running safaridriver --enable.
Versions
XCode: 15.0 beta
iOS: 17 beta
Following works fine for https url with self signed certificate.
But it does not work for secured websocket protocol with self signed ceritificate
(void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler
{
NSURLCredential * credential = [[NSURLCredential alloc] initWithTrust:[challenge protectionSpace].serverTrust];
completionHandler(NSURLSessionAuthChallengeUseCredential, credential);
}
}
hello! the problem is that about 2 months ago, the iphone browser sent such formats as webp/avif in http accept headers. a normal header should look like "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,/;q=0.8".
on iphone now it looks like "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"
The Safari version for VisionOS (or spatial computing) supports WebXR, as reported here.
I am developing a Web App that intends to leverage WebXR, so I've tested several code samples on the safari browser of the Vision Pro Simulator to understand the level of support for immersive web content.
I am currently facing an issue that seems like a bug where video playback stops working when entering an XR session (i.e. going into VR mode) on a 3D web environment (using ThreeJS or similar).
There's an example from the Immersive Web Community Group called Stereo Video (https://immersive-web.github.io/webxr-samples/stereo-video.html) that lets you easily replicate the issue, the code is available here.
It's worth mentioning that video playback has been successfully tested on other VR platforms such as the Meta Quest 2.
The issue has been reported in the following forums:
https://discourse.threejs.org/t/videotexture-playback-html5-videoelement-apple-vision-pro-simulator-in-vr-mode-not-playing/53374
https://bugs.webkit.org/show_bug.cgi?id=260259
I am developing a web application that leverages WebGL to display 3D content. The app would benefit from tracking headset movement when viewing the 2D page as a Window while wearing Vision Pro. This would ultimately allow me a way to convey the idea of the Window acting as a portal into a virtual environment, as the rendered perspective of the 3D environment would match that of the user wearing the headset.
This is a generic request/goal, as it would be applicable to any browser and any 6dof device, but I am interested in knowing if it is currently possible with Vision Pro (and the Simulator) and its version of Safari for "spatial computing".
I can track the head movement while in a WebXR XR or "immersive" session, but I would like to be able to track it without going into VR mode.
Is this possible? If so, how and using which tools?
Hi,
I am developing an app that allows users to connect their Instagram accounts. However, I have a problem that someone may be able to help with.
So, in the app(frontend) the web view is presented with the specific URL that Instagram API requires to receive the necessary access token, in the URL you have to supply a redirect_uri which is where Instagram will send its response (authorization_code), you then have to send that authorization code to another Instagram URL to which it will respond with the token, I need to store this token in my database. The redirect_uri is a domain that points to my backend server, and I have to keep it this way since Instagram requires that the redirect_uri uses HTTPS.
Finally the problem, I don't know how to associate the authorization code with the user that made the request since Instagram acts as a middleman between the front-end and back-end. Upon signup, each user is assigned a user ID. I tried to find a way to include that in the redirect_url with no luck.
Thanks in advance!
The new protection of a private window in safari is great. But what if you share your iPad or Macbook with your children who also can acces the device with their fingerprint or passcode?
I would like to see the option for a separate passcode for a private window. Is that something that is in the development pipeline?
I'm working with an installer pkg that works correctly in the gui, but when using the installer command in terminal it fails with the error:
"installer: Error - This volume does not meet the requirements for this update."
This is not a OS update package, but I'm assuming this error is based on some standard installer error.
Any thoughts?