iOS 12 上的 PWA 不再与 Safari 共享 Service Worker 缓存? [英] PWAs on iOS 12 no longer shares Service Worker cache with Safari?

查看:86
本文介绍了iOS 12 上的 PWA 不再与 Safari 共享 Service Worker 缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于 iOS 11 上的 PWA,我们通过将登录详细信息存储在 Service Worker Web 缓存中来解决在 Safari 中打开的外部第三方登录问题.

For the PWA on iOS 11 we solved the external third party login opened in Safari by storing the login details in the service worker web cache.

这不再适用于 iOS 12(在撰写本文时处于 Beta 版).我认为这一定是因为 PWA 现在拥有自己的 Service Worker 缓存,不再与 Safari 共享,但我无法确认这一点.

This no longer works in iOS 12 (in beta as of writing). I think this must be because the PWA now has its own service worker cache that it no longer shares with Safari, but I can't confirm this.

有谁知道是否有办法在 safari 和 PWA 之间共享 Service Worker 缓存?请注意,我们已经尝试过 IndexedDB,但这不是共享的,当然 cookie 也不是.

Does anyone know if there is a way to share the service worker cache between safari and the PWA? Note that we already tried IndexedDB, but that is not shared, and of course neither are cookies.

据我所知,这意味着 PWA 完全是从 safari 沙箱中进行的,并且无法让第三方登录工作.有什么解决办法吗?

As far as I can figure out this means that a PWA is totally sandboxed from safari and there is no way to get a third party login working. Any solutions?

推荐答案

OAuth 登录现在可以从 iOS 12.2(2019 年 3 月)开始,因为外部站点的链接现在在 PWA 应用内浏览器中打开,返回链接指向PWA.因此,我现在可以使用第三方 Auth0 登录在 iOS 上部署 PWA 应用程序(它已经在 Android 和 Windows 上运行).

OAuth login is now possible as of iOS 12.2 (March 2019) as links of external sites now open in a PWA in-app browser and return links point back to the PWA. As a result I am now able to deploy PWA apps on iOS with third-party Auth0 login (it was already working on Android and Windows).

但是请注意,登录会话不会像早期版本的 iOS 那样在 Safari 和 PWA 之间共享.

Note however that login session is not shared between Safari and PWA like in earlier versions of iOS.

我从 这篇文章 来自 Maximiliano Firtman.

I learned of this from this article from Maximiliano Firtman.

这篇关于iOS 12 上的 PWA 不再与 Safari 共享 Service Worker 缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆