Firebase获取用户ID值。 (iOS目标C)

时间:2015-02-12 16:53:04

标签: firebase

我想知道如何从当前经过身份验证的用户获取user_id值,因此当我编写新记录时,我可以引用编写它的用户。

我的数据结构如下:

http://imgur.com/J52OmaZ

2 个答案:

答案 0 :(得分:0)

这最终成为我的解决方案,似乎工作正常。

A0SimpleKeychain *keychain = [[Application sharedInstance] store];

A0UserProfile *profile = [NSKeyedUnarchiver unarchiveObjectWithData:              [keychain dataForKey:@"profile"]];

NSLog(@"user: %@",profile.userId);

答案 1 :(得分:0)

If someone finds this post and is still looking for an answer:

[FIRAuth auth].currentUser.uid;
相关问题