IOS camera returns black screen after leaving pwa

后端 未结 3 512
梦毁少年i
梦毁少年i 2021-01-01 01:55

I\'m using html file input to open camera and take photos for my PWA.



        
3条回答
  •  一生所求
    2021-01-01 02:25

    Recently I faced the same problem, the only solution I came up with was to open in the app in browser instead of the standard mode. But only on iOS.

    The trick was to create 2 manifest.json files with different configurations. The normal one and one for everything is Apple manifest-ios.json.

    Step 1: Add id to the manifest link tag:

    
    

    Step 2: Added this script to the bottom of the body:

    
    

    Step 3: in the manifest-ios.json set the display to browser

    {
        "name": "APP",
        "short_name": "app",
        "theme_color": "#0F0",
        "display": "browser", // <----
        ...
    }
    

    Hope it helps you guys!

提交回复
热议问题