as the title, I use OnDisconnect
to make presence feture. I did a test :
I read this post : Firebase: when onDisconnect event fire?
是什么@Frank说:“所以在这种情况下,您只需要多一点耐心即可。”但是我已经等了一个小时,它仍然没有启动。
那么我们应该等多久呢?至少我们怎么知道它会发射还是不发射?
这是我的代码:
if (getMyUID()!=null){
ROOT_REF.child(CHILD_USERS)
.child("userid")
.child("active").setValue(Calendar.getInstance().getTimeInMillis()+"");
ROOT_REF.child(CHILD_USERS)
.child("userid")
.child("active").onDisconnect()
.setValue(Calendar.getInstance().getTimeInMillis()+"");
}