-
-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: authStateChange doesn't fire on Log Out and open the app from App Killed use cases #56
Comments
Hi @Sampath-Lokuge, |
Hi @robingenz Yes, I have tested it on a Native device/Native app on Android. Steps:
Since |
You have to set up your listener in the constructor to ensure that the listener is ready before the first event is fired. |
I have done the same thing but outside the constructor. Because on App Killed use case there will not have any Service available until it has been instantiated. So that is why I have put it under the |
What do you mean by this exactly? I do not really understand your use case. |
Please see this: https://youtu.be/oTkLCESOxZc?t=37 This is the thing where I have done here too. |
Okay, but what does exiting the app have to do with the constructor/NgOnInit? That is independent of where you initialize the listener. |
Yes, that is the issue here too. If I kill the app then above listener no more? But as I mentioned on
The importance of this functionality is that we do not need to maintain/use any local storage plugin to store user details. i.e. I can handle all the routings, etc. within that Listner hence it has user details. |
Yes it does, the listener continues to work even after restarting (after quitting) the app. function whichAuth() {
let auth
if (Capacitor.isNativePlatform()) {
auth = initializeAuth(app, {
persistence: indexedDBLocalPersistence
})
} else {
auth = getAuth()
}
return auth
} (Source: https://harryherskowitz.com/2021/08/23/firebase-capacitor.html) Does that answer your question? |
I do not use Firebase JS SDK since this is a native-only app. So I'll provide you sample app to reproduce this soon. Thanks! |
It looks like there hasn't been a reply in 30 days, so I'm closing this issue. |
@robingenz Can you provide the persistence into your demo. To show how you would go by doing this. |
@JSponaugle Yes, please create a feature request in the demo app repo for tracking. |
@Sampath-Lokuge were you able to resolve this? I have the same issue where |
@braincomb Yes, I have used the
Please let me know if you'll need more details here. |
Hi,
I can see an issue with your demo app. The below method doesn't fire on
Log out
and open the app fromApp Kill
use cases. Any clue? Thanks!I have used it like so:
firebase-authentication.service.ts
app. componnet.ts
It works only when the
Login
use case. I have usedAngularFire
on many applications and below works on all the above use cases. So we would like to have the same behavior also on your plugin too. Please let me know your thoughts here.Ionic:
The text was updated successfully, but these errors were encountered: