I'm signing users into my app with a custom token using their WordPress ID.
Auth.auth().signIn(withCustomToken: customToken ?? "") { (user, error) in
// ...
}
That works ok but I need to update the rules which will keep users from writing to the database. This is counterproductive because I want to track the products they view etc...
I want to sign the user anonymously when the app opens.
Auth.auth().signInAnonymously() { (authResult, error) in
// ...
}
I need to link the anonymous user to the WordPress user. Unfortunately, according to the documentation https://firebase.google.com/docs/auth/ios/account-linking the user needs to be linked with a credential but the credentials provided are GoogleAuthProvider, FacebookAuthProvider and EmailAuthProvider and several others but no Custom Provider.
Is it possible to create a credential out of the custom token?