I'm a newbie in firebase.
How do I get through this below rule?
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if false;
}
}
}
I've tried to change the rule to below,
{
"rules":
{
".read": true,
".write": true,
}
}
but there's an error of
mismatched input '{' expecting {'function', 'service', 'syntax'}
Below is the db structure.
Currently, this is my code (which keeps returning Permission-denied):
// [START initialize_database_ref]
mDatabase = FirebaseDatabase.getInstance().reference
// [END initialize_database_ref]
val result = HashMap<String, Any> ()
result.put("timestamp", getCurrentTime())
result.put("user_id", USER_ID)
result.put("x_position", -1)
result.put("y_position", -1)
mDatabase!!.ref.child("raw data").child("Z9QD79lDzP7MpD6feWeJ").setValue(result).addOnFailureListener(object : OnFailureListener {
override fun onFailure(@NonNull e: Exception) {
Log.d("firebase", e.localizedMessage)
}
})
Any help would be appreciated! Thanks :)