Open MicahStevens opened 5 years ago
note that creating the collection object works fine, this error appears on both 'add' and 'get' functions.
var c = window.db.collection('contacts');
c.get('A').then(console.log); // record 'A' exists on firebase.
I have this working using the javascript API, but having issues with the web ui for auth, so wanted to use your nice firebaseui plugin which works great!
Thanks for any help.
Taking your first example, is the code structured exactly like that? Are you sure the promise has been satisfied before it gets to the add line?
For testing purposes could you try this?
Firestore.initialise(options).then(function(db) { window.db = db; window.db.collection('test').add({ "test": "value" }).then(console.log).catch(console.error); })
The promise seems to return resolved right away - but I'll try that, it's good to be sure of that obviously.
I appreciate your help! I'll try it first thing in the morning and close this out and kick myself it that's all it was.
Hi , I am also facing the same issue. I created a sample project using the procedure given in the plugin page. After some debugging I found that "firestorePlugin.getDatabase()" returns null on "DocSetHandler.java" . I will try to debug more and share that info soon.
var options = { "datePrefix": 'DATE:', "fieldValueDelete": "DELETE", "fieldValueServerTimestamp" : "__SERVERTIMESTAMP", "persist": true, "config" : {} };
For Android/IoS applications , "config" key should not be present in the "options" JSON. If it is present code assumes it to be a web applications and works accordingly . After removing this key , app works fine.
I believe the example may be wrong. Try this:
window.db.get().collection('test').add({ "test": "value" }).then(console.log).catch(console.error);
In add, as per comment above, "config" : {} needs to be comment out. Then it works both for Android and browser platform (iOS to be tested)
Expected Behavior
Adding a record should work.
Actual Behavior
Throws error:
Steps to Reproduce the Problem
Using in chromium debug window attached to cordova webview instance on a phone. I've installed the plugins without issue.
Specifications