【发布时间】:2017-01-25 01:48:37
【问题描述】:
我想使用 uid 作为键将当前用户位置推送到 Firebase 我如何从后台服务获取当前用户
public class TrackService extends Service ....{
...........
public void onLocationChanged(Location location) {
// TODO: insert the new location to the Firebase location childe
Log.i(TAG, location.toString());
Log.i(TAG, "onLocationChanged: " + location.toString());
DatabaseReference key= root.child("Location").child(?USERID?).push();
key.setValue(location);
}....
}
【问题讨论】:
标签: android firebase firebase-realtime-database firebase-authentication