IOS Physical Device - History.replace after successful login is not working

I was able to solve this issue. Firstly, I watched Aaron Saunder’s video on youtube using ReactFire and I changed the way my app is routed:

const App: React.FC = () => {

  return (
    <IonApp>
      <AuthProvider sdk={auth}>
        <FirestoreProvider sdk={db}>
          <IonReactRouter>
            <IonRouterOutlet>
              <AuthWrapper fallback={<LoginRoot />}>
                <TabRoot />
              </AuthWrapper>
            </IonRouterOutlet>
          </IonReactRouter>
        </FirestoreProvider> 
      </AuthProvider>
    </IonApp>
  )
};


export const AuthWrapper = ({
  children,
  fallback,
}: React.PropsWithChildren<{ fallback: JSX.Element }>): JSX.Element => {
  const { status, data: signInCheckResult } = useSigninCheck();
  console.log(signInCheckResult);

  if (!children) {
    throw new Error("Children must be provided");
  }
  if (status === "loading") {
    return <IonLoading isOpen={status === "loading"} />;
  } else if (signInCheckResult.signedIn === true) {
    return children as JSX.Element;
  }

  return fallback;
}


export default App

when I did this, initially I got a stuck error on the IOS physical device, again I don’t know why.

So what I did was instead of syncing to Xcode and running the project through Xcode, I used the official Ionic Plugin and deployed onto my Iphone directing from there. For whatever reason, this seamed to sync better and clean up whatever bug that was persisting through running the app on Xcode.

I think some data just got permanently looped or something that prevented the app to ever get into a useable state from running through Xcode, but when deployed from the Ionic IOS plugin unto my physical phone it worked great!

1 Like