Web Manifest goes into redirect loop - progressive-web-apps

I'm looking at potential of using PWA, however when I put a manifest.webmanifest it ends up in a redirect loop and results in the browser returning a "Too many redirects error", this is the only resource which is doing this, I'm loading other resources, such as CSS, JS, Images, Favicon, robots.txt using the same method and not getting an issue
The server is running on localhost:8080 using HTTPS and HTTP/2
The Chrome DevTools console shows
GET https://localhost:8080/manifest.webmanifest net::ERR_TOO_MANY_REDIRECTS
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Title</title>
<meta name="description" content="Meta Description">
<link rel="manifest" href="/manifest.webmanifest">
<link rel="stylesheet" href="/assets/uikit-3.5.9/css/uikit.min.css">
<link rel="stylesheet" href="/assets/css/app.min.css">
</head>
The manifest file itself is served by the web server which is written in Go using Gorilla Mux
r.PathPrefix("/manifest.webmanifest").Handler(http.FileServer(http.Dir(os.Getenv("PUBLIC_ROOT"))))
I have also tried using HandleFunc to construct and serve the manifest as well, but this results in a redirect loop as well.
If I navigate directly to the manifest in the browser it successfully loads successfully (without any redirects showing in the chrome dev tools)
Below is a screenshot of the chrome dev tools when navigating the website

Not sure how or why, but the issue seemed to be within the session middleware where a Cookie was being set against the webmanifest link
By excluding the URL for the manifest from the session manager the issue has gone away

Related

No Manifest Detected Flutter PWA

Although there is a valid manifest.json and <link rel="manifest" href="manifest.json"> in the head tag, chrome shows No Manifest Detected, service workers are installed successfully and http://127.0.0.1:8080/manifest.json is fine and accessible, but chrome not even requesting the manifest.json file! this is a flutter project which currently build for web using flutter build web --release
Finally I figured out the bug was introduced by flutter_native_splash which added some picture tag to the root of html page which caused the chrome not requesting the manifest.json, so moving the picture tag to body solved the issue.
https://pub.dev/packages/flutter_native_splash

How to create Android app links using branch.io in Ionic 2/3 app?

I'm having a bit of difficulty understanding the implementation of some of the branch concepts for the Ionic platform Wrapper SDK .
I've generated short URLs using the SDK, but it seems to get redirected in the browser before the app is launched. Link -> Browser -> App handoff.
How do I avoid this redirection? I've enabled Android app link, added SHA 256 of certs and added all configs in config.xml as per SDK docs.
Is it possible to generate long links as using the "/a/ and the Branch Key" as in https://bnc.lt/a/key_live_kaFuWw8WvY7yn1d9yYiP8gokwqjV0Swt?foo=bar&baz=456&$fallback_url=https%3A%2F%2Fbranch.io%2F
Something like branchcordova://a/key_live_kaFuWw8WvY7yn1d9yYiP8gokwqjV0Swt?foo=bar&baz=456&$fallback_url=https%3A%2F%2Fbranch.io%2F
Looks like a configuration issue. Have you added your Link Domain on the config.xml file? You can find your Link Domain on the Link Settings page.
<!-- sample config.xml -->
<widget id="com.eneff.branch.cordovatestbed"
version="0.0.1" xmlns="http://www.w3.org/ns/widgets"
xmlns:cdv="http://cordova.apache.org/ns/1.0">
<!-- Branch -->
<plugin name="branch-cordova-sdk" spec="^2.5.0" />
<branch-config>
<branch-key value="<YOUR LIVE KEY>" />
<uri-scheme value="<YOUR URI SCHEME>" />
<link-domain value="<YOUR LINK DOMAIN>" />
<ios-team-release value="<YOUR TEAM ID>" />
</branch-config>
Long links can only be generated using your Link Domain.
Something like branchcordova://a/key_live_kaFuWw8WvY7yn1d9yYiP8gokwqjV0Swt?foo=bar&baz=456&$fallback_url=https%3A%2F%2Fbranch.io%2F is incorrect.
Someting like https://example.app.link/fzmLEhobLD?foo=bar&baz=456&$fallback_url=https%3A%2F%2Fbranch.io%2F is correct.
You should use https://link.example.com if you have a custom link domain configured.
More info on Long Links- https://docs.branch.io/pages/links/integrate/#long-links
If we use the Android app link (URI scheme), then the app would be open directly. But, it would be detected as a non-branch link and we might not get any analytics data or branch.io related features.
The redirection of short and long URLs seems to depend on the app which is opening the link. Some apps like Hangout app do the redirect thing.
If we are to open a branch link from inside our app, we could do the following to somehow skip the redirection.
const longLink = https://bnc.lt/a/key_live_kaFuWw8WvY7yn1d9yYiP8gokwqjV0Swt?foo=bar&baz=456;
window.open(longLink, '_system');

Script for button "View Desktop Version"?

I want to make a link in footer of my mobile site version, pointing to desktop version of the site. But I have this script in desktop version:
<script type="text/javascript">
<!--
if (screen.width < 800) {
window.location = "mysite.com/m/page1.html";
}
//-->
</script>
If a make this link in mobile version:
View desktop version
the hypelink pointed to desktop site but desktop is redirecting back to mobile version and this is unended cycle of redirection.
How to make this:
- i have script in desktop version for redirect to mobile site
and
- if the mobile user want to view desktop version, clicking at the link "view desktop version" to go at desktop version without redirect back in mobile version?
Thanks

404 page not found trying to navigate between pages in my Firebase app

I am building a Firebase app which runs correctly on my local server. But when deploy it to the Firebase Hosting I can't navigate between pages. After deploy it goes to the index.html page normally without problem
The problem is that when i clik on a link a get a 404 page. this how i am writting my link
<a href="secondPage.html"/>go to the second page </a>
I have my index.html and secondPage.html in the same directory

Startup image not updating on installed ios webapp

I have my web app installed on my device, the app can be updated changing the cache.manifest, everything changes except the startup image, this image cannot be updated when the app its already installed?
I know that the new image works because when I "install" (add to home screen) a new instance of the webapp it has the updated image!
Tested only on iOS 6.1 / iPhone 5
Updated:
<link rel="apple-touch-startup-image" href="images/img_splash.jpg" />
<link rel="apple-touch-startup-image" href="images/img_splash.jpg" media="screen and (max-device-width: 320px)" />
To force the update, you will could change the startup image file name also.
Force Update Steps:
Place new startup image on web server with new name
Update the HTML5 page or javascript file to reference the new name
Update cache.manifest with new name
Profit...