简体   繁体   English

Parse.com无法从Parse获取正确的用户名

[英]Parse.com can't get correct username from Parse

I am trying to implement Facebook auth with Parse SDK as described in officialy manual. 我正在尝试使用正式手册中所述的Parse SDK来实现Facebook身份验证。 But instead of real name I am getting some token when calling [PFUser currentUser] 但是当我打电话给[PFUser currentUser]时,我得到的不是真实姓名

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:YES];

    if ([PFUser currentUser] && [PFFacebookUtils isLinkedWithUser:[PFUser currentUser]]) {
        NSLog(@"USER == %@ == IS ALREADY LINKED WITH FACEBOOK", [PFUser currentUser]);
    }
}

NSLOG shows me this: USER == Op2Qz1RxiwR1zflsSzCVR538A == IS ALREADY LINKED WITH FACEBOOK NSLOG向我显示了此信息: USER == Op2Qz1RxiwR1zflsSzCVR538A == IS ALREADY LINKED WITH FACEBOOK

What could be the issue? 可能是什么问题?

In your code you are telling it to log the entire user object. 在您的代码中,您要告诉它记录整个用户对象。 This will probably log something like a unique I'd or something. 这可能会记录类似唯一身份之类的内容。

If you want the name then you should use... 如果要使用名称,则应使用...

[PFUser currentUser].userName

Or some other property. 或其他一些财产。

It doesnt know which part of the user to log unless you actually tell it which part you want to log. 它不知道要记录用户的哪一部分,除非您实际告诉它要记录的那一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM