Detect if iOS is using webapp

后端 未结 2 1294
醉酒成梦
醉酒成梦 2021-02-07 07:06

I was wondering if it\'s possible to detect if an iOS user is using the webapp, or just visiting the normal way with safari browser.

The reason I want to achieve is tha

2条回答
  •  时光取名叫无心
    2021-02-07 07:32

    iOS and Chrome WebApp behaves different, thats the reason i came to following:

    isInWebAppiOS = (window.navigator.standalone == true);
    isInWebAppChrome = (window.matchMedia('(display-mode: standalone)').matches);
    

提交回复
热议问题