Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I allow orientation rotation while using manifest.json?

When I use a manifest.json file within my web application and "add to home screen" on Chrome for Android, it loads in fullscreen mode (great) but also gets locked in portrait orientation (not great).

I want to load in fullscreen, but still allow for orientation rotation. Is this possible?

{
  "name": "MyApp",
  "icons": [
    {
      "src": "launcher-icon-0-75x.png",
      "sizes": "36x36",
      "type": "image/png",
      "density": 0.75
    }
  ],
  "start_url": "/home",
  "display": "standalone",
  "orientation": "natural" // I have tried natural, any, leaving this property out altogether without success
}

According to boyofgreen, you should be able to supply one of many orientation options.

like image 575
Brian FitzGerald Avatar asked Jul 02 '16 23:07

Brian FitzGerald


1 Answers

It turns out Chrome for Android was aggressively caching my manifest.json file. By manually clearing the cache "from the beginning of time" and setting the orientation property to a value of any I was able to get the desired behavior.

Worth noting, an orientation value of natural did not allow the screen to rotate.

like image 189
Brian FitzGerald Avatar answered Oct 20 '22 01:10

Brian FitzGerald