Can I detect if my PWA is launched as an app or visited as a website?

前端 未结 2 1060
粉色の甜心
粉色の甜心 2021-02-04 16:24

If I have a PWA I might want to ask my user to add it to their launcher, but I don\'t want to ask this if it\'s actually launched from the launcher.

Is there any way to

2条回答
  •  自闭症患者
    2021-02-04 16:47

    To put it in another way, you dont have to do any code to achieve this. Browser triggeres Install to home screen banner/related events, only if its used in a browser and wont happen from launcher.

    What you expect to do is the default behavior of how web install banners work.

提交回复
热议问题