# iOS PWA 中的返回按钮

**URL:** https://meta.discourse.org/t/back-button-in-ios-pwa/93909
**Category:** Support
**Created:** [2018年八月4日 10:59 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909 "2018-08-04T10:59:38Z")
**Posts on this page:** 20
**Page:** 3

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2018年十月23日 01:22 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/46 "2018-10-23T01:22:45Z")

</div>

Can you please share a screenshot of how it looks?

---

<div class="post-metadata">

### Author: ![notriddle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/notriddle/32/133055_2.png) [@notriddle](https://meta.discourse.org/u/notriddle)
#### Post date: [2018年十月23日 01:32 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/47 "2018-10-23T01:32:05Z")

</div>

According to [this page](https://www.bennadel.com/blog/1950-detecting-iphone-s-app-mode-full-screen-mode-for-web-applications.htm), you can detect if a page is running in app mode by checking `window.navigator.standalone`. Unfortunately, I don’t own an iPhone, so I can’t check. [You’ll need to do something different on Android](https://stackoverflow.com/questions/21125337/how-to-detect-if-web-app-running-standalone-on-chrome-mobile#34516083), since they use a CSS-based API instead.

---

<div class="post-metadata">

### Author: ![jaihaze](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jaihaze/32/95691_2.png) [@jaihaze](https://meta.discourse.org/u/jaihaze)
#### Post date: [2018年十月29日 04:06 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/48 "2018-10-29T04:06:06Z")

</div>

whats the setting under?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2018年十月29日 04:09 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/49 "2018-10-29T04:09:58Z")

</div>

Not implemented yet, soonish we will have it done.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2018年十月29日 13:42 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/50 "2018-10-29T13:42:00Z")

</div>

This is now configurable using the `pwa_display_browser_regex` **hidden** site setting.

@jaihaze it’s already set in your site.

---

<div class="post-metadata">

### Author: ![jaihaze](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jaihaze/32/95691_2.png) [@jaihaze](https://meta.discourse.org/u/jaihaze)
#### Post date: [2018年十月29日 17:10 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/51 "2018-10-29T17:10:33Z")

</div>

well it doesnt work. If i add it to home screen it then prompts me to login which when I login does nothing but kick me back to safari.

[https://cl.ly/24ce795d473b/ScreenRecording\_10-29-2018%25252013-08-48.MP4](https://cl.ly/24ce795d473b/ScreenRecording_10-29-2018%25252013-08-48.MP4)

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2018年十月29日 23:34 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/52 "2018-10-29T23:34:34Z")

</div>

Oh my, looks like now the PWA and the Safari are using different cookie contexts, so oauth2 login is impossible.

> **[185400 – Apps added to home screen lose context when multitasking and reload](https://bugs.webkit.org/show_bug.cgi?id=185400#c3)**

---

<div class="post-metadata">

### Author: ![jaihaze](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jaihaze/32/95691_2.png) [@jaihaze](https://meta.discourse.org/u/jaihaze)
#### Post date: [2018年十月30日 02:03 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/53 "2018-10-30T02:03:47Z")

</div>

so how do i get passed it?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2018年十月30日 03:04 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/54 "2018-10-30T03:04:33Z")

</div>

It looks like PWAs are kinda broken on iOS at the moment, per the bug report filed with Apple above.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2018年十月30日 21:59 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/55 "2018-10-30T21:59:48Z")

</div>

Looks like this was fixed in iOS 12.1. Can anyone confirm?

[![](https://global.discourse-cdn.com/meta/original/4X/0/4/3/0432a8fdebecbd4b232a8bb7ad40d3cb57e32950.jpeg "Aerosmith - Livin' On The Edge (Official Music Video)") ](https://www.youtube.com/watch?v=7nqcL0mjMjw)

---

<div class="post-metadata">

### Author: ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)
#### Post date: [2018年十月31日 04:19 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/56 "2018-10-31T04:19:43Z")

</div>

> [@Falco](#):
>
> This is now configurable using the `pwa_display_browser_regex` **hidden** site setting.

I’m a bit green at this but trying to learn, what would be the rails command to turn this setting on?

---

<div class="post-metadata">

### Author: ![jaihaze](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jaihaze/32/95691_2.png) [@jaihaze](https://meta.discourse.org/u/jaihaze)
#### Post date: [2018年十月31日 04:37 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/57 "2018-10-31T04:37:12Z")

</div>

the issue is now when you create the bookmark it brings you to the pwa style app, however logging in does nothing and creates a login loop

---

<div class="post-metadata">

### Author: ![jaihaze](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jaihaze/32/95691_2.png) [@jaihaze](https://meta.discourse.org/u/jaihaze)
#### Post date: [2018年十一月2日 19:09 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/58 "2018-11-02T19:09:13Z")

</div>

Ok so just a quick question, since it can’t be done is it safe to say I should go to the plugin marketplace?

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [2018年十一月2日 21:16 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/59 "2018-11-02T21:16:20Z")

</div>

The issue needs to be fixed by Apple - what would a plugin solve?

---

<div class="post-metadata">

### Author: ![jaihaze](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jaihaze/32/95691_2.png) [@jaihaze](https://meta.discourse.org/u/jaihaze)
#### Post date: [2018年十一月2日 21:45 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/60 "2018-11-02T21:45:25Z")

</div>

how is this an apple issue? I have it open right now with no menu bar on ios 12.1. I just cannot login to it. Everytime I go to login it loops back. Im not even worried about it not being supported at this point, even if im the only one using it. I was sent an email that the cookies are not being remembered or something which is apparently a bug. A plugin or some code apparently people here are saying it could be done - however I just cannot login to it

 ![IMG_8C9D75A45E16-1](https://global.discourse-cdn.com/meta/original/3X/3/5/35054cdf6f29c3bf05533fe2586433a67b51272b.jpeg)

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [2018年十一月2日 21:47 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/61 "2018-11-02T21:47:21Z")

</div>

It’s a Safari bug - @falco explained this four days ago and linked to the specific bug on the WebKit tracker:

> [@Back button in iOS PWA](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/52):
>
> Oh my, looks like now the PWA and the Safari are using different cookie contexts, so oauth2 login is impossible. [https://bugs.webkit.org/show\_bug.cgi?id=185400#c3](https://bugs.webkit.org/show_bug.cgi?id=185400#c3)

Webkit is the underlying browser engine Apple uses in Mobile Safari. Webkit has to ship a fix, then Apple has to ship an OS update to iOS with said fix.

Brady Eidson acknowledged that Apple is tracking the issue in Radar:

> **[185400 – Apps added to home screen lose context when multitasking and reload](https://bugs.webkit.org/show_bug.cgi?id=185400#c3)**

---

<div class="post-metadata">

### Author: ![jaihaze](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jaihaze/32/95691_2.png) [@jaihaze](https://meta.discourse.org/u/jaihaze)
#### Post date: [2018年十一月2日 21:50 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/62 "2018-11-02T21:50:44Z")

</div>

thats wrong, I would have made this post sooner if back in july this was happening. This is different. Read the bug report, different app. I am not using any other app, I login and safari asks me to login so the cookies arent being saved. I have no issues using this same method in all of june, july, august, and even september. Its since the update to business plan which is when it stopped working. So either my phones are stupid or the problem is a totally different one

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [2018年十一月2日 21:54 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/63 "2018-11-02T21:54:05Z")

</div>

The guy who acknowledged the bug is an Apple Engineer and handles Webkit architecture at Apple.

Yes - it can be a Webkit issue from that long ago, because your iPhone didn’t get any Webkit updates between 11.4 which shipped in May 2018 and iOS 12, which shipped on September 17, 2018. The version of Safari used in 11.4 is likely to be much older as they select a version early on and test it for several months.

Webkit isn’t safari, it’s a browser engine. Safari **uses** Webkit. iPhones get three or four Safari updates annually.

---

<div class="post-metadata">

### Author: ![jaihaze](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jaihaze/32/95691_2.png) [@jaihaze](https://meta.discourse.org/u/jaihaze)
#### Post date: [2018年十一月2日 22:00 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/64 "2018-11-02T22:00:30Z")

</div>

ok I see what youre saying here. What if I can show you an iOS video of 12.1 with the current date and it working? I am sure there is other people of my community that has the same icon set. is it possible to get an app made thru external sources where it basically frames discourse like how there is fb messengers and all use the web version but doesnt show anything else but fb messages?

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [2018年十一月2日 22:01 UTC](https://meta.discourse.org/t/back-button-in-ios-pwa/93909/65 "2018-11-02T22:01:16Z")

</div>

You mean this?

[https://github.com/discourse/DiscourseMobile](https://github.com/discourse/DiscourseMobile)

[上一頁](https://meta.discourse.org/t/back-button-in-ios-pwa/93909.md?page=2)

[下一頁](https://meta.discourse.org/t/back-button-in-ios-pwa/93909.md?page=4)
