hbmartin / cordova-plugin-firebase-realtime-database

Cordova plugin for Google Firebase
13 stars 8 forks source link

Uncaught TypeError: Cannot read property 'ref' of undefined #9

Open vittorbraga opened 7 years ago

vittorbraga commented 7 years ago

After installing the plugin with "cordova plugin add cordova-plugin-firebase-realtime-database --save", I added classpath 'com.google.gms:google-services:3.0.0' in build.gradle and in the function ReceiveEvent I added var firebaseThings = window.FirebaseDatabasePlugin.ref('farmacias');

When I run cordova run browser I get the error Uncaught TypeError: Cannot read property 'ref' of undefined

How to solve this problem?

androsland commented 7 years ago

Looks like some of the functions mentioned in the readme, are not available in the window.FirebaseDatabasePlugin object. Should we have done something during installation that is missing from the readme?

ferrygun commented 7 years ago

You need to put that command under onDeviceReady() function

` Githubissues.

  • Githubissues is a development platform for aggregating issues.