arnesson / cordova-plugin-firebase

Cordova plugin for Google Firebase
http://arnesson.github.io/cordova-plugin-firebase
MIT License
1k stars 1.55k forks source link

How to create an event in cordova which should trigger when a child in firebase realtime db changes #1161

Open sandeepks1 opened 2 years ago

sandeepks1 commented 2 years ago

Could you please help me to fix the below code, I need an event that should trigger when any child changes, Similar code works perfectly on the web app but when I am trying with Cordova android am getting an error Uncaught TypeError: firebaseThings.on is not a function plugin I am using :https://www.npmjs.com/package/cordova-plugin-firebase

                                var firebaseThings = window.FirebaseDatabasePlugin.ref(value); 
                            firebaseThings.on('child_changed', (snapshot) => {
                            console.log('user was changed !!') ;
                            if(snapshot.key=="offersdp")
                            {
                            alert(snapshot.value);
                            }

                            });