is there a way to test a google fire base connection from the UNIX command line?
I am working on an executable jar file, which works great locally, but cannot write to fire base. So I would like to find a way to test the connection.
I can ping my fire base url from the server.
thank you,
If you want to see lots of details about the state of the SDK's connection to Firebase, turn on debug logging. You can do that with FirebaseDatabase.getInstance().setLogLevel(Level.DEBUG).
Thanks Doug, this was exactly what I needed. It also helped me pinpoint the issue. I was simply unaware of the logging method for firebase.
For others who might have issues implementing:
Import Statement: (eclipse gives you options in my case)
import com.google.firebase.database.Logger.Level;
Set Doug's Log Level:
FirebaseDatabase.getInstance(fbconn).setLogLevel(Level.DEBUG);
Proceed to try to make your connection: (fbconn is FirebaseApp that I set with my details for firebase)
FirebaseDatabase defaultDatabase = FirebaseDatabase.getInstance(fbconn);
String strCurrentTimestamp = new SimpleDateFormat("MM-dd-yyyy HH:mm:ss a").format(new Date());
DatabaseReference dataRef = defaultDatabase.getReference().child("Firebase-Connection-Verified");
dataRef.setValue(strCurrentTimestamp);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With