-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Troubles with Basic Example #13
Comments
Any suggestion? A small working example would work.... I'm not sure if it's a problem with the plugin or maybe something is missing in my setup. Maybe I need to load in index.html the firebase and firestore javascript libraries? |
Sorry - pretty swamped at the moment! Have had a look at a working app and I think you need to try this: db.get().collection("users").add({
first: "Alan",
middle: "Mathison",
last: "Turing",
born: 1912
}) ie add the get() Are you running this in the browser or on a device? Do let me know how you get on and I will update the docs. |
Thanks a lot |
Yes, it works! Two things: 1- I had to modify the index.html header like this to allow calls to google js lib:
2- The call needs the get:
|
Same code on Android gives error:
|
Ok, worked also in Android (no chance at the moment to test iOS) following the suggestion in So the readme could be update to include the head tag as my above comment:
And code would become (I've put alert in place of console.log just for easiness with App messages):
Note that I've commented out (removed) config{}: with this the code works both in browser and app. Thanks if someone could test on iOS. Also, I have a question: once removed the browser option (and the apiKey) is it correct that only the specific app can read the data, or anyone with the json file can create an app that use my Goole Firebase quota? Thanks |
I tried all the suggestions and it did not work, does anyone have any idea to try to make it work? I have this error: |
I will try and test this. I am going to be working on the plugin soon. As for the access to the data, this will work in association with firebase authentication and you can add rules to firestore to ensure only authenticated users can access the data. Note this is authentication and not authorization which is something you would need to implement once you are happy the authenticated user is who they say they are. |
@luigi37 @gabrielpotumati I intersects with this problem, check #28 issue, we need remove empty "config" key from initialization object. |
Expected Behavior
I expect any of the console messages from the basic example
Actual Behavior
I get error
Uncaught (in promise) TypeError: db.collection is not a function
at lp.js: xxxx
at
Steps to Reproduce the Problem
Used this code.
Plugin version is 1.3.2
function onceLoaded() {
console.log('aaa');
}
var app = {
// Application Constructor
initialize: function() {
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
},
};
app.initialize();
Specifications
The text was updated successfully, but these errors were encountered: