Native Apps für iOS und Android (Capacitor) mit Push über Firebase
Apps (mobile/): - Capacitor-8-Hülle, lädt die Web-App von APP_URL – Inhalte ohne App-Update - Android- und iOS-Projekt (Swift Package Manager) mit Firebase Messaging, nativer Sprachausgabe, Teilen, App, Statusleiste, Startbildschirm - `npm run sync` überträgt APP_ID, Name, Adresse und Farbe aus mobile/.env in beide Projekte und richtet ein: App-Links (Android intent-filter, iOS Associated Domains), Push (Entitlements, Background Mode, AppDelegate, Benachrichtigungssymbol/-farbe), Offline-Seite; idempotent, prüft Eingaben, warnt bei fehlenden Firebase-Dateien - `npm run assets` erzeugt Symbole und Startbildschirme aus Logo und Markenfarbe der Redaktion, dazu das Android-Benachrichtigungssymbol - Schritt-für-Schritt-Anleitung für den Mac (mobile/README.md) Server: - Versand an App-Geräte über FCM HTTP v1 (signiertes JWT, ohne firebase-admin), eingebunden in alle Benachrichtigungen; abgemeldete Geräte werden entfernt (nur bei UNREGISTERED, nicht bei anderen Fehlern) - Firebase-Dienstkonto in den Einstellungen hochladen (verschlüsselt), App-ID, Team-ID, SHA-256, Store-Links; /.well-known/apple-app-site- association und assetlinks.json; Smart-App-Banner, Store-Hinweis - Server erkennt die App am User-Agent (kein Aufblitzen von „Als App installieren“); Datenschutz-Vorlage um Firebase ergänzt Web-App in der App: Push über Firebase statt Web-Push, Vorlesen nativ, Teilen nativ, Zurück-Taste (schließt erst Dialoge), Antippen einer Benachrichtigung und App-Links öffnen die Seite (nur eigene Adressen). Getestet mit nachgebauter Capacitor-Brücke und nachgebautem Firebase-Dienst. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
02171e4cfe
commit
856559f830
152 changed files with 7537 additions and 32 deletions
22
mobile/env.mjs
Normal file
22
mobile/env.mjs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
/** Liest mobile/.env (ohne zusätzliche Abhängigkeit) */
|
||||
export function loadEnv() {
|
||||
const file = path.join(path.dirname(fileURLToPath(import.meta.url)), '.env');
|
||||
const env = {};
|
||||
if (fs.existsSync(file)) {
|
||||
for (const line of fs.readFileSync(file, 'utf8').split('\n')) {
|
||||
const m = line.match(/^\s*([A-Z_]+)\s*=\s*(.*?)\s*$/);
|
||||
if (m) env[m[1]] = m[2].replace(/^["']|["']$/g, '');
|
||||
}
|
||||
}
|
||||
const get = (k, d) => process.env[k] || env[k] || d;
|
||||
return {
|
||||
appUrl: get('APP_URL', 'https://app.example.org').replace(/\/+$/, ''),
|
||||
appId: get('APP_ID', 'org.example.werkstattapp'),
|
||||
appName: get('APP_NAME', 'Werkstatt-App'),
|
||||
brandColor: get('BRAND_COLOR', '#2e2672')
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue