From 0fe2bb94021db442f3e3192f1febf61a0e06a36f Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 10 Mar 2022 21:19:01 -0500 Subject: [PATCH] Update version-7-upgrade.md adding caveat after suffering with ios after upgrade to 7. android and web work, but ios needs this. NOTE: not sure if this is the right/best place to do this, but it's the closest I've come so far. --- docs/version-7-upgrade.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/version-7-upgrade.md b/docs/version-7-upgrade.md index 8651f50ac..8bfc39041 100644 --- a/docs/version-7-upgrade.md +++ b/docs/version-7-upgrade.md @@ -296,3 +296,31 @@ export class Foo { } } ``` +### Changes to Auth +on ios native, provideAuth() needs to initializeAuth() first: +``` +import { + getAuth, + indexedDBLocalPersistence, + initializeAuth, + provideAuth, +} from '@angular/fire/auth'; + +@NgModule({ + declarations: [AppComponent], + entryComponents: [], + imports: [ + ... + provideAuth(() => { + if (Capacitor.isNativePlatform()) { + return initializeAuth(getApp(), { + persistence: indexedDBLocalPersistence, + }); + } else { + return getAuth(); + } + }), + ] +}) + +```