Wie erhalte ich Benutzerinformationen vom Facebook SDK in iOS?

Wie bekomme ich den Benutzernamen, wenn die Benutzersitzung geöffnet ist? Wenn jemand die Lösung kennt, helfen Sie mir bitte. Danke im Voraus.

 - (IBAction)buttonClickHandler:(id)sender {
        // get the app delegate so that we can access the session property
        SLAppDelegate *appDelegate = [[UIApplication sharedApplication]delegate];

        // this button's job is to flip-flop the session from open to closed
        if (appDelegate.session.isOpen) {
            // if a user logs out explicitly, we delete any cached token information, and next
            // time they run the applicaiton they will be presented with log in UX again; most
            // users will simply close the app or switch away, without logging out; this will
            // cause the implicit cached-token login to occur on next launch of the application
   //hear i need to fetch user name ?


            [appDelegate.session closeAndClearTokenInformation];

        } else {
            if (appDelegate.session.state != FBSessionStateCreated) {
                // Create a new, logged out session.
                appDelegate.session = [[FBSession alloc] init];
            }

            // if the session isn't open, let's open it now and present the login UX to the user
            [appDelegate.session openWithCompletionHandler:^(FBSession *session,
                                                             FBSessionState status,
                                                            , NSError *error) {
                // and here we make sure to update our UX according to the new session state
                [self updateView];
            }];
        }
    }

Antworten auf die Frage(5)

Ihre Antwort auf die Frage