var firebase = require("firebase");
var config = {
databaseURL: "https://mehsimpletest.firebaseio.com",
serviceAccount: "./private.json",
databaseAuthVariableOverride: {
uid: "nodeAPI" // was hoping this write rule would work, doesn't "auth.uid === 'nodeAPI'"
}
};
var app = firebase.initializeApp(config);
var fbRoot = app.database();
var p1 = fbRoot.ref('hello/123456').set({
key: "1234",
responses: [1,2,3]
});
p1.then(function(){
console.log("success write")
},
function(err) {
console.log("error on write",err);
}
);
var p2 = fbRoot.ref("hello/123456").once("value", function(snap) {
console.log("success read", snap.val());
}, function(err) {
console.log("error", err);
});
Please try again. If the problem persists, please let us know using the "Send feedback" link below. Thanks!
Tracking Number: 2434437075226484796
Tracking Number: 753760520778695049
When I enabled logging:
p:0: from server: {"r":38,"b":{"s":"invalid_token","d":"Access denied."}}
Auth token revoked: invalid_token/Access denied.
But shouldn't the promise be fulfilled with an error ?
Anyway, I am still stuck; How do I contact support directly? I did submit a ticket (1 of my allotted 5) but haven't heard anything since last week.
thanks for helping
mike
var config = {
databaseURL: "https://mehsimpletest.firebaseio.com",
serviceAccount: "./node3API.json"
};
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/fd8cdbb5-92a9-4f53-89fd-901f5613b7da%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
databaseAuthVariableOverride: {
uid: "nodeAPI"
}
it succeeded.
So here's where we are:
1. Agree to Terms of Service first to avoid the 'server error'
2. When you create a service account, do NOT export the key; First attach owner roles to it via
"Service accounts->+PERMISSION" AND the "IAM" tab. I had to do it in both places; NOW export the key.
3. If all goes well (in terms of access/permissions), promises do resolve on writes.
If not, no promises get fulfilled -- even with an all access write rule.
I appreciate the persistent help. I think I can move on to HelloUniverse.
mike
Server Error
There's a problem at our end.
Please try again. If the problem persists, please let us know using the "Send feedback" link below. Thanks!
2a. DO NOT RENAME THE JSON's FILE NAME (This causes issues with your project being able to authenticate with firebases' services)
serviceAccount: path.resolve(__dirname, './projectname-1a2b3c4d5e6f.json')
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/5c5fde20-bc26-4f75-b1ca-6a6f5ec7385a%40googlegroups.com.