v2land-frontend
v2land-frontend copied to clipboard
Display “add Langchao to your home screen” instruction on timeline page footer for iOS devices
iOS users can add our website to their Home Screen via Safari. We should display an instruction for them to do so at the footer of the timeline page.
Details
- Add a text button to the end of the timeline page that reads “喜欢浪潮?添加至你的 iPhone[/iPad] 首页”. When users tap on it, an Ant Design modal pop up with the detailed instructions.
- This should only show up on iOS Safari. One can detect that on front end with
navigator.userAgent.match(/(iPod|iPhone|iPad)/) && navigator.userAgent.match(/AppleWebKit/)
. [source] - This should not show up for users who are already visiting our website in the full-screen mode (meaning they have already added Surge.fm to the home screen.) One might be able to detect that on front end with
!!document.fullscreenElement
. [source]