【发布时间】:2017-05-11 11:06:43
【问题描述】:
我想使用以下函数检索当前用户 uid 设置为 yes 的对象,这似乎不起作用。
- (void)configureDatabase {
_ref = [[FIRDatabase database] reference];
FIRUser *user = [FIRAuth auth].currentUser;
_refHandle = [[[[_ref child:@"tasks"] queryOrderedByChild:@"appliedByUsers"] queryEqualToValue:@YES childKey:user.uid] observeEventType:FIRDataEventTypeChildAdded withBlock:^(FIRDataSnapshot *snapshot)
{
NSLog(@"snapshot: %@", snapshot);
[_tasks addObject:snapshot];
[self.tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:_tasks.count-1 inSection:0]] withRowAnimation: UITableViewRowAnimationAutomatic];
}]; }
tasks -Kj3BawmhKjqbZXZdicq applicationStatus: appliedByUsers bNDJtrn1Mmh51GXHTbMNR1MiTZt1: true hUI0W0TZxObazIFxSRm8t990UgM2: true price: source: taskName: type: . . .
如何检索当前 user.uid 为 true 的任务?
【问题讨论】:
标签: ios objective-c firebase firebase-authentication