You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
I am currently debugging duplicate services in an angular application. It seems as if they are caused by opening a push notification in a suspended android app. This seems to cause a partial reinitialization of the app and a new AppComponent as well as dependend services, which leads to problems with Routing and Navigation as well as state in the services.
Successfully installed on device with identifier 'FA81B1A02641'.
Restarting application on device FA81B1A02641...
Successfully synced application org.nativescript.pushdemo on device FA81B1A02641.
JS: HMR: Hot Module Replacement Enabled. Waiting for signal.
JS: construct firebaseService 1579085694744
JS: construct AppComponent
JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
JS: firebase init success
JS: got token1579085694744
JS: fIf-cdi5cQI:APA91bEgWIbxdoHo6JTaeiTZDWm0BvwdIIPf-9HLsowdhsPHfgF_f62t89ks0aS9NQs251PyRv-MXXNXDLXRKca7ZI1YvHyxhFSEg43OS2uH5by630wzbFcFH63BVqjdeqfMN9UCrzTE
Push Notification received - constructed again
JS: construct firebaseService 1579085748718
JS: construct AppComponent
JS: Angular is running in the development mode. Call enableProdMode() to enable the production mode.
JS: firebase init error: Firebase already initialized
JS: got message 1579085694744
Push notification is handled by old firebaseService - new service is not notified.
The text was updated successfully, but these errors were encountered:
I found a solution for the issue, but the problem is still present. It seems as if nativescript-firebase does not respect that the angular application is teared down and then bootstrapped again, but still tries to notifiy the old, teared down listener.
The way to resolve this is to attach a new listener when the application is bootstrapped again on resume, so the new nativescript-angular app will be notified. I updated my sample repository too.
What do you think, should we add this to the documentation?
I am currently debugging duplicate services in an angular application. It seems as if they are caused by opening a push notification in a suspended android app. This seems to cause a partial reinitialization of the app and a new AppComponent as well as dependend services, which leads to problems with Routing and Navigation as well as state in the services.
I reproduced this behaviour in a demo app: https://github.com/000panther/nativescript-push-error/
In the following logs you can see that
Push Notification received - constructed again
Push notification is handled by old firebaseService - new service is not notified.
The text was updated successfully, but these errors were encountered: