firebase - Database doesn't write even though no "Fault" is returned -


i'm trying firebase database component working ios project, , when code (included below) executes output "succeeded" message, database not modified. i've included "error" i'm receiving in xcode logs.

thank help!

public ienumerator getprofile() {    task < datasnapshot > task = firebasedatabase.defaultinstance.getreference("users/" + _currentuser.userid).getvalueasync();      while (!task.isfaulted && !task.iscanceled && !task.iscompleted)      yield    return null;      if (task.iscompleted) {      //set data      debug.log("has data");      datasnapshot snapshot = task.result;      if (snapshot.value == null) {        debug.log("no value");        task postnew = firebasedatabase.defaultinstance.rootreference.child("users").child(_currentuser.userid)          .setrawjsonvalueasync(jsonconvert.serializeobject(new user()));          while (!postnew.isfaulted && !postnew.iscanceled && !postnew.iscompleted)          yield        return null;          if (postnew.isfaulted) {          debug.log(postnew.exception.tostring());        } else          debug.log("suceeded");      }    } else {      debug.log(task.exception.tostring());      /*_root.child("users").child(_currentuser.userid)      	 .setrawjsonvalueasync(jsonconvert.serializeobject(new user()));*/    }  }

"error"

<error> [firebase/core][i-cor000003] default firebase app has not yet been configured. add `[firapp configure];` (`firebaseapp.configure()` in swift) application initialization. read more: ...

turns out json string sending had value "null" write silently failing. (had developer me find it).


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -