fix(pwa): guarantee mobile install banner visibility, capture early beforeinstallprompt in head, and provide install guide modal
This commit is contained in:
1 parent
4d4b8c860d
commit
704d3b9eca
2 files changed
+62
-18
No files matched your search
@@ -42,6 +42,23 @@ export default function RootLayout({
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
window.__everclone_install_prompt = null;
|
||||
window.addEventListener('beforeinstallprompt', function(e) {
|
||||
e.preventDefault();
|
||||
window.__everclone_install_prompt = e;
|
||||
window.dispatchEvent(new CustomEvent('everclone:installable', { detail: true }));
|
||||
console.log('[Everclone PWA] Early beforeinstallprompt captured!');
|
||||
});
|
||||
window.addEventListener('appinstalled', function() {
|
||||
window.__everclone_install_prompt = null;
|
||||
window.dispatchEvent(new CustomEvent('everclone:installable', { detail: false }));
|
||||
});
|
||||
`,
|
||||
}}
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<PwaRegister />
|
||||
|
||||
Reference in new issue
Block a user