diff --git a/web/capacitor.config.ts b/web/capacitor.config.ts index 5be47345..acffcccc 100644 --- a/web/capacitor.config.ts +++ b/web/capacitor.config.ts @@ -5,10 +5,10 @@ const config: CapacitorConfig = { appName: 'Manifold Markets', webDir: 'out', bundledWebRuntime: false, - // TODO: Do we need this? - // server: { - // allowNavigation: ['oneword-cf74a.firebaseapp.com', 'accounts.google.com'], - // }, + server: { + // Allow these sites to be loaded from the webview + allowNavigation: ['mantic-markets.firebaseapp.com', 'accounts.google.com'], + }, plugins: { CapacitorFirebaseAuth: { providers: ['google.com'], diff --git a/web/lib/firebase/users.ts b/web/lib/firebase/users.ts index e9fcbb93..3be5c2d6 100644 --- a/web/lib/firebase/users.ts +++ b/web/lib/firebase/users.ts @@ -31,6 +31,8 @@ import { feed } from 'common/feed' import { CATEGORY_LIST } from 'common/categories' import { safeLocalStorage } from '../util/local' import { filterDefined } from 'common/util/array' +import { cfaSignIn } from 'capacitor-firebase-auth' +import { Capacitor } from '@capacitor/core' export type { User } @@ -126,8 +128,16 @@ export function listenForLogin(onUser: (user: User | null) => void) { } export async function firebaseLogin() { - const provider = new GoogleAuthProvider() - return signInWithPopup(auth, provider) + if (Capacitor.getPlatform() === 'android') { + // Seems broken, because we're on firebase v9 instead of v8... + console.log('firebaseLogin: android') + cfaSignIn('google.com').subscribe((u) => { + console.log('firebaseLogin:', u) + }) + } else { + const provider = new GoogleAuthProvider() + return signInWithPopup(auth, provider) + } } export async function firebaseLogout() { diff --git a/web/package.json b/web/package.json index c5d926b0..4de10b82 100644 --- a/web/package.json +++ b/web/package.json @@ -10,7 +10,7 @@ "dev:emulate": "cross-env NEXT_PUBLIC_FIREBASE_EMULATE=TRUE yarn devdev", "ts": "tsc --noEmit --incremental --preserveWatchOutput --pretty", "build": "next build", - "export": "next export", + "export": "next build && next export", "start": "next start", "lint": "next lint", "format": "npx prettier --write .",