How to create firebase data change and got firebase value in web view??
I’m sorry but official language and the only one allowed is english, please translate the title and the post.
1 Like
i was edited
For working with Firebase in a webview:
See here:
and here:
what is code java script for data change and what code for get value…on that link not clear?
There is more to it than this but:
//initialise firebase
firebase.initializeApp(firebaseConfig);
var auth = firebase.auth();
var db = firebase.database();
All data is returned by Firebase
auth.onAuthStateChanged(function(user) {
if (user) {
// User is signed in.
getData();
} else {
// No user is signed in.
}
});
function getData() {
var dbRefObject = firebase.database().ref().child(ProjectBucket +"/"+ uid);
dbRefObject.on('value', snap => { window.AppInventor.setWebViewString(JSON.stringify(snap.val(), null, 3)); });
}
Ref: METRIC RAT AI2 - How to have Secure Rules on Firebase, and allow Auth Users to Read/Write
Is code snap value is for data change?