Files
KC-APP/client/app/web/index.html
T
linusandClaude Sonnet 5 3f46088e9a chore(client): fill in Firebase web config (apiKey / appId)
Only the VAPID key (Web Push certificate) is still REPLACE_ME; the push
guard now keys off vapidKey so nothing prompts until it's set.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-10 11:54:47 +02:00

81 lines
3.0 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
The path provided below has to start and end with a slash "/" in order for
it to work correctly.
For more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
This is a placeholder for base href that will be replaced by the value of
the `--base-href` argument provided to `flutter build`.
-->
<base href="$FLUTTER_BASE_HREF">
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="Konfi-Castle App">
<!-- iOS meta tags & icons -->
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="KC-App">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>
<title>KC-App</title>
<link rel="manifest" href="manifest.json">
<!-- Firebase Cloud Messaging (web push). vapidKey still needs the Web Push
certificate key pair (Project settings > Cloud Messaging > Web config).
Until it's set kcGetPushToken() returns null and the app runs without
push. -->
<script src="https://www.gstatic.com/firebasejs/10.13.2/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/10.13.2/firebase-messaging-compat.js"></script>
<script>
window.KC_FIREBASE = {
apiKey: "AIzaSyDxBpdmW8lUHSuix--3AsWJScGQy9o3G_M",
authDomain: "konfi-castle-app.firebaseapp.com",
projectId: "konfi-castle-app",
storageBucket: "konfi-castle-app.firebasestorage.app",
messagingSenderId: "307226979593",
appId: "1:307226979593:web:66898b2c78b2d110ef77d8",
measurementId: "G-NK8K5VV40D",
vapidKey: "REPLACE_ME"
};
window.kcGetPushToken = async function () {
try {
var cfg = window.KC_FIREBASE;
if (!cfg.vapidKey || cfg.vapidKey === "REPLACE_ME" || !("Notification" in window)) return null;
if (!firebase.apps.length) firebase.initializeApp(cfg);
var permission = await Notification.requestPermission();
if (permission !== "granted") return null;
var registration = await navigator.serviceWorker.register("firebase-messaging-sw.js");
var messaging = firebase.messaging();
return await messaging.getToken({ vapidKey: cfg.vapidKey, serviceWorkerRegistration: registration });
} catch (e) {
console.warn("[push] init failed", e);
return null;
}
};
</script>
</head>
<body>
<!--
You can customize the "flutter_bootstrap.js" script.
This is useful to provide a custom configuration to the Flutter loader
or to give the user feedback during the initialization process.
For more details:
* https://docs.flutter.dev/platform-integration/web/initialization
-->
<script src="flutter_bootstrap.js" async></script>
</body>
</html>