Skip to content

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

@sandeepks1

Description

@sandeepks1

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);
                            }

                            });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions