I want to publish an Open Graph fitness:runs action on Facebook and I want it to render with a map of my path. The path is defined by the path coordinates below. How do I do this? The method below publishes the action and I can see the text for the action in my Activity Log on Facebook and in my timeline. But I do not see a map when I hoover over any element of the posted action. What am I doing wrong?
- (void) fbPost:(NSString *)txt toList:(NSString *)listId { // post
[FBSession setActiveSession:[FacebookManager instance].facebook.session];
NSMutableDictionary<FBGraphObject> *action = [FBGraphObject graphObject];
action[#"course"] = #"http://samples.ogp.me/48586838281818";
action[#"privacy"] = privacyStr;
NSMutableArray *coords = [NSMutableArray arrayWithCapacity:59];
for (int i = 0; i < 59; i++)
{
NSMutableDictionary *coord = [[NSMutableDictionary alloc] initWithCapacity:3];
#define TIMESTAMP #"fitness:metrics:timestamp"
#define LATITUDE #"fitness:metrics:location:latitude"
#define LONGITUDE #"fitness:metrics:location:longitude"
[coord setValue:[NSString stringWithFormat:#"2013-04-01T12:%2d:00+0000", i] forKey:TIMESTAMP];
[coord setValue:[NSString stringWithFormat:#"%f", 37.442564 + i * 0.00001] forKey:LATITUDE];
[coord setValue:[NSString stringWithFormat:#"%f", -122.164879 + i * 0.000001] forKey:LONGITUDE];
[coords addObject:coord];
NSLog(#"coord=%# i=%d", coord, i);
}
action[#"path"] = [coords JSONString];
action[#"message"] = txt;
[FBRequestConnection startForPostWithGraphPath:#"me/fitness.runs"
graphObject:action
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
if (!error) // it's a post, save id
{
}
else
{
}
}];
}
NSMutableDictionary<FBGraphObject> *action = [FBGraphObject graphObject];
NSMutableDictionary<FBGraphObject> *course = [FBGraphObject openGraphObjectForPost];
course[#"og:title"] = #"My Workout";
course[#"og:type"] = #"fitness.course"; //very important
course[#"og:url"] = #"www.fitness.com"; // give a meaningful url here
course[#"fitness:duration:value"] = #"3000";
course[#"fitness:duration:units"] = #"s";
course[#"fitness:calories"] = #"100";
course[#"fitness:distance:value"] = 1.7;
course[#"fitness:distance:units"] = #"mi";
course[#"fitness:speed:value"] = #"2";
course[#"fitness:speed:units"] = #"m/s";
course[#"fitness:pace:value"] = #"0.5";
course[#"fitness:pace:units"] = #"s/m";
course[#"og:description"] = #"course_description";
NSMutableArray *locationDataPointsArray = [[NSMutableArray alloc] init];
locationDataPointsArray[0] = #{#"location:latitude": 12.91277, #"location:longitude": 77.56671};
locationDataPointsArray[1] = #{#"location:latitude": 12.91284, #"location:longitude": 77.56681};
locationDataPointsArray[2] = #{#"location:latitude": 12.91297, #"location:longitude": 77.56691};
course[#"fitness:metrics"] = locationDataPointsArray;
action[#"fb:explicitly_shared"] = #"true";
action[#"course"] = course;
NSString *path = #”me/fitness.runs”;
//for custom story: NSString *path = #”me/urNamespace:name of ur action”;
[FBRequestConnection startForPostWithGraphPath:path graphObject:action completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if (!error) {
NSLog(#"Posted fitness action, id: %#", [result objectForKey:#"id"]);
NSString *alertText = #"Workout successfully posted to Facebook :)";
NSString *alertTitle = #"Success";
[[[UIAlertView alloc] initWithTitle:alertTitle message:alertText delegate:nil cancelButtonTitle:#"OK!" otherButtonTitles:nil] show];
}
else {
NSLog(#"error in posting action %#", error.description);
}
}];
I don't really know how to answer you question however I read some documents the other day and they may be useful to you...
I would Recommend
That you take a read of this document and hopefully you will be able to understand how to integrate this in your app.
You may also want to take a read of this
& this
Happy coding :)
Related
I am attempting to download Facebook albums of photos from a user in my app. Unfortunately although I do have an access token, I am getting zero albums from the requests. I am not getting an error, just getting zero. Why? If you would like to see any more code or ask more questions, just ask. Note that I have authorized the current user's Facebook permissions when they signed up, and I've since quit the app and opened it many times (don't think this would be an issue, since I have an access token..?)
- (void)getAlbums:(OLFacebookAlbumRequestHandler)handler {
if ([FBSDKAccessToken currentAccessToken]) {
// connection is open, perform the request
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
NSString *graphPath = #"me/albums?limit=100&fields=id,name,count,cover_photo";
if (self.after) {
graphPath = [graphPath stringByAppendingFormat:#"&after=%#", self.after];
}
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] initWithGraphPath:graphPath parameters:nil];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
if (self.cancelled) {
return;
}
if (error) {
[OLFacebookAlbumRequest handleFacebookError:error completionHandler:handler];
return;
}
NSString *parsingErrorMessage = #"Failed to parse Facebook Response. Please check your internet connectivity and try again.";
NSError *parsingError = [NSError errorWithDomain:kOLErrorDomainFacebookImagePicker code:kOLErrorCodeFacebookImagePickerBadResponse userInfo:#{NSLocalizedDescriptionKey: parsingErrorMessage}];
id data = [result objectForKey:#"data"];
if (![data isKindOfClass:[NSArray class]]) {
handler(nil, parsingError, nil);
return;
}
NSMutableArray *albums = [[NSMutableArray alloc] init];
for (id album in data) {
if (![album isKindOfClass:[NSDictionary class]]) {
continue;
}
id albumId = [album objectForKey:#"id"];
id photoCount = [album objectForKey:#"count"];
id name = [album objectForKey:#"name"];
if (!([albumId isKindOfClass:[NSString class]] && [photoCount isKindOfClass:[NSNumber class]]
&& [name isKindOfClass:[NSString class]])) {
continue;
}
OLFacebookAlbum *album = [[OLFacebookAlbum alloc] init];
album.albumId = albumId;
album.photoCount = [photoCount unsignedIntegerValue];
album.name = name;
album.coverPhotoURL = [NSURL URLWithString:[NSString stringWithFormat:#"https://graph.facebook.com/%#/picture?type=small&access_token=%#", album.albumId, [FBSDKAccessToken currentAccessToken].tokenString]];
[albums addObject:album];
}
// get next page cursor
OLFacebookAlbumRequest *nextPageRequest = nil;
id paging = [result objectForKey:#"paging"];
if ([paging isKindOfClass:[NSDictionary class]]) {
id cursors = [paging objectForKey:#"cursors"];
id next = [paging objectForKey:#"next"]; // next will be non nil if a next page exists
if (next && [cursors isKindOfClass:[NSDictionary class]]) {
id after = [cursors objectForKey:#"after"];
if ([after isKindOfClass:[NSString class]]) {
nextPageRequest = [[OLFacebookAlbumRequest alloc] init];
nextPageRequest.after = after;
}
}
}
handler(albums, nil, nextPageRequest);
}];
}
else {
NSString *message = #"No Facebook user authentication found.";
handler(nil, [NSError errorWithDomain:kOLErrorDomainFacebookImagePicker code:kOLErrorCodeFacebookImagePickerNoOpenSession userInfo:#{NSLocalizedDescriptionKey: message}], nil);
}
}
//Code for fetching albums...
- (void)loadNextAlbumPage {
self.inProgressRequest = self.albumRequestForNextPage;
self.albumRequestForNextPage = nil;
[self.inProgressRequest getAlbums:^(NSArray/*<OLFacebookAlbum>*/ *albums, NSError *error, OLFacebookAlbumRequest *nextPageRequest) {
self.inProgressRequest = nil;
self.loadingIndicator.hidden = YES;
self.albumRequestForNextPage = nextPageRequest;
if (error) {
if (self.parentViewController.isBeingPresented) {
self.loadingIndicator.hidden = NO;
self.getAlbumError = error; // delay notification so that delegate can dismiss view controller safely if desired.
} else {
[self.delegate albumViewController:self didFailWithError:error];
}
return;
}
NSMutableArray *paths = [[NSMutableArray alloc] init];
for (NSUInteger i = 0; i < albums.count; ++i) {
[paths addObject:[NSIndexPath indexPathForRow:self.albums.count + i inSection:0]];
}
[self.albums addObjectsFromArray:albums];
if (self.albums.count == albums.count) {
// first insert request
[self.tableView reloadData];
} else {
[self.tableView insertRowsAtIndexPaths:paths withRowAnimation:UITableViewRowAnimationFade];
}
if (nextPageRequest) {
self.tableView.tableFooterView = self.loadingFooter;
} else {
self.tableView.tableFooterView = nil;
}
}];
}
//And when they signed up:
[[[FBSDKGraphRequest alloc] initWithGraphPath:#"me" parameters:#{ #"fields" : #"id,first_name,photos,picture.width(400).height(400)"}]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if (!error) { //etc etc the method continues.
FB authentication will give you a unique access_token for a particular set of permissions. To access user photos, you need to request the user_photos permission. Use the FBSDKLoginButton to request permissions.
loginButton.readPermissions = #[#"public_profile", #"email", #"user_photos"];
Once you have an access token with the required permissions, persist that locally (on the device) to reuse in future. If the access code is still valid, you won't need to request it again. If it becomes invalid (in case the user explicitly revoked permissions to your app), send them back to the login screen.
i am working with QBSimpleChat SDK . i wand to send simple group message . please help. here is my code . see what i am missing. thanks in advance.
QBChatMessage *inviteMessage = [QBChatMessage message];
NSMutableDictionary *customParams = [NSMutableDictionary new];
//customParams[#"xmpp_room_jid"] = roomJID;
customParams[#"name"] = name;
customParams[#"_id"] = senderId1;
customParams[#"save_to_history"] = #YES;
//customParams[#"type"] = 2;
inviteMessage.senderID = senderId;
inviteMessage.dateSent = [NSDate date];
inviteMessage.senderNick = #"me";
inviteMessage.text = text;
customParams[#"occupants_ids"] = [occupides componentsJoinedByString:#","];
NSString *afterSpace= [occupides componentsJoinedByString:#" "];
NSUInteger num = [oneer integerValue];
NSTimeInterval timestamp = (unsigned long)[[NSDate date] timeIntervalSince1970];
customParams[#"date_sent"] = #(timestamp);
// send notification
//
inviteMessage.recipientID = num;
//}
inviteMessage.customParameters = customParams;
[QBRequest createMessage:inviteMessage successBlock:^(QBResponse *response, QBChatMessage *createdMessage) {
NSLog(#"success: %#", createdMessage);
} errorBlock:^(QBResponse *response) {
NSLog(#"ERROR: %#", response.error);
}];
[self.chatSectionManager addMessage:inviteMessage];
[self finishSendingMessageAnimated:YES];
NSLog(#"message for group is = %#",inviteMessage);
You can send messages using the method of QBChatDialog instance :
- (void)sendMessage:(QB_NONNULL QBChatMessage *)message completionBlock:(QB_NULLABLE_S QBChatCompletionBlock)completion;
For more further explanation please follow our guide.
Hi i'm successfully loged in google plus. Now i'm trying to fetch friends details like emails, image, name.But getting error.
Please any one could help me, where i'm making mistake -
I tried this code -
- (void)finishedWithAuth: (GTMOAuth2Authentication *)auth
error: (NSError *) error {
self.plusService.authorizer = auth;
NSLog(#"%#",[NSString stringWithFormat:#"Email---> %#\n\n",[GPPSignIn sharedInstance].authentication.userEmail]);
NSLog(#"Received error %# and auth object ---> %#\n\n",error, auth);
// 1. Create a |GTLServicePlus| instance to send a request to Google+.
GTLServicePlus* plusService = [[GTLServicePlus alloc] init] ;
plusService.retryEnabled = YES;
// 2. Set a valid |GTMOAuth2Authentication| object as the authori zer.
[plusService setAuthorizer:[GPPSignIn sharedInstance].authentication];
// 3. Use the "v1" version of the Google+ API.*
plusService.apiVersion = #"v1";
GTLQueryPlus *query = [GTLQueryPlus queryForPeopleListWithUserId:#"me" collection:kGTLPlusCollectionVisible];
[plusService executeQuery:query
completionHandler:^(GTLServiceTicket *ticket,
GTLPlusPeopleFeed *person,
NSError *error) {
if (error)
{
GTMLoggerError(#"Error: %#", error);
}
else {
NSArray *peopleList = person.items;
NSLog(#"--People_List--->%#",peopleList);
}}];
}
Getting Error -
[lvl=3] __41-[ViewController finishedWithAuth:error:]_block_invoke() Error: Error Domain=com.google.GTLJSONRPCErrorDomain Code=401 "The operation couldn’t be completed. (Invalid Credentials)" UserInfo=0x7b0a1d10 {error=Invalid Credentials, GTLStructuredError=GTLErrorObject 0x7b089360: {message:"Invalid Credentials" code:401 data:[1]}, NSLocalizedFailureReason=(Invalid Credentials)}
for Fetching Friends Details you can use Google Contacts api
in that use
#import "GDataFeedContact.h"
#import "GDataContacts.h"
class file
then use this code to get data
-(void)getGoogleContacts
{
GDataServiceGoogleContact *service = [self contactService];
GDataServiceTicket *ticket;
BOOL shouldShowDeleted = TRUE;
const int kBuncha = 2000;
NSURL *feedURL = [GDataServiceGoogleContact contactFeedURLForUserID:kGDataServiceDefaultUser];
GDataQueryContact *query = [GDataQueryContact contactQueryWithFeedURL:feedURL];
[query setShouldShowDeleted:shouldShowDeleted];
[query setMaxResults:kBuncha];
ticket = [service fetchFeedWithQuery:query
delegate:self
didFinishSelector:#selector(contactsFetchTicket:finishedWithFeed:error:)];
[self setContactFetchTicket:ticket];
}
- (void)setContactFetchTicket:(GDataServiceTicket *)ticket
{
mContactFetchTicket = ticket;
}
- (GDataServiceGoogleContact *)contactService
{
static GDataServiceGoogleContact* service = nil;
if (!service) {
service = [[GDataServiceGoogleContact alloc] init];
[service setShouldCacheResponseData:YES];
[service setServiceShouldFollowNextLinks:YES];
}
//pass the useremail and password.here
NSString *username = #"youremai#gmail";
NSString *password = #"yourpassword";
[service setUserCredentialsWithUsername:username
password:password];
return service;
}
- (void)contactsFetchTicket:(GDataServiceTicket *)ticket
finishedWithFeed:(GDataFeedContact *)feed
error:(NSError *)error {
if (error) {
NSDictionary *userInfo = [error userInfo];
NSLog(#"Contacts Fetch error :%#", [userInfo objectForKey:#"Error"]);
if ([[userInfo objectForKey:#"Error"] isEqual:#"BadAuthentication"]) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:#"Error!"
message:#"Authentication Failed"
delegate:self
cancelButtonTitle:#"Ok"
otherButtonTitles:nil, nil];
[alertView show];
} else {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:#"Error!"
message:#"Failed to get Contacts."
delegate:self
cancelButtonTitle:#"Ok"
otherButtonTitles:nil, nil];
[alertView show];
}
} else {
NSArray *contacts = [feed entries];
NSLog(#"Contacts Count: %d ", [contacts count]);
[googleContacts removeAllObjects];
for (int i = 0; i < [contacts count]; i++) {
GDataEntryContact *contact = [contacts objectAtIndex:i];
// Name
NSString *ContactName = [[[contact name] fullName] contentStringValue];
NSLog(#"Name : %#", ContactName);
// Email
GDataEmail *email = [[contact emailAddresses] objectAtIndex:0];
NSString *ContactEmail = #"";
if (email && [email address]) {
ContactEmail = [email address];
NSLog(#"EmailID : %#", ContactEmail);
}
// Phone
GDataPhoneNumber *phone = [[contact phoneNumbers] objectAtIndex:0];
NSString *ContactPhone = #"";
if (phone && [phone contentStringValue]) {
ContactPhone = [phone contentStringValue];
NSLog(#"Phone : %#", ContactPhone);
}
// Address
GDataStructuredPostalAddress *postalAddress = [[contact structuredPostalAddresses] objectAtIndex:0];
NSString *address = #"";
if (postalAddress) {
NSLog(#"formattedAddress : %#", [postalAddress formattedAddress]);
address = [postalAddress formattedAddress];
}
// Birthday
NSString *dob = #"";
if ([contact birthday]) {
dob = [contact birthday];
NSLog(#"dob : %#", dob);
}
if (!ContactName || !(ContactEmail || ContactPhone) ) {
NSLog(#"Empty Contact Fields. Not Adding.");
}
else
{
if (!ContactEmail ) {
ContactEmail = #"";
}
if (!ContactPhone ) {
ContactPhone = #"";
}
NSArray *keys = [[NSArray alloc] initWithObjects:#"name", #"emailId", #"phoneNumber", #"address", #"dob", nil];
NSArray *objs = [[NSArray alloc] initWithObjects:ContactName, ContactEmail, ContactPhone, address, dob, nil];
NSDictionary *dict = [[NSDictionary alloc] initWithObjects:objs forKeys:keys];
[googleContacts addObject:dict];
}
}
NSSortDescriptor *descriptor =
[[NSSortDescriptor alloc] initWithKey:#"name" ascending:YES selector:#selector(localizedCaseInsensitiveCompare:)];
[googleContacts sortUsingDescriptors:[NSArray arrayWithObjects:descriptor, nil]];
get the more info refer this http://dipinkrishna.com/blog/2013/07/ios-google-contacts/4/
I'm using a code which I will post after this to return the closest places based on what the user types in a UITextField using a natural language query. I store all the places in an array and that pass that array to the next scene (a UITableViewController) in prepareForSegue. Than I use the array to load all the places. On the simulator, it shows all the default locations that Apple has which makes sense. But then, I test it out on a real iPhone and despite enabling location services for the app, I still get default locations. I tried again and again but I could not get actual results. It worked once a few weeks ago, but since then it has stopped. Any ideas? Here is the code:
- (void) performSearch {
NSLog(_searchLabel.text);
MKLocalSearchRequest *request =
[[MKLocalSearchRequest alloc] init];
request.naturalLanguageQuery = _searchLabel.text;
_foundPlaces = [[NSMutableArray alloc] init];
_foundPlacesD = [[NSMutableArray alloc]init];
//NSLog(_place);
MKLocalSearch *search =
[[MKLocalSearch alloc]initWithRequest:request];
[search startWithCompletionHandler:^(MKLocalSearchResponse
*response, NSError *error) {
if (response.mapItems.count == 0)
NSLog(#"No Matches");
else{
for (MKMapItem *item in response.mapItems)
{
NSString *n = item.name;
[_foundPlaces addObject:n];
NSLog(n);
MKDirectionsRequest *dr = [MKDirectionsRequest new];
MKMapItem *source = [MKMapItem mapItemForCurrentLocation];
[dr setSource:source];
[dr setDestination:item];
MKDirections *directions = [[MKDirections alloc]initWithRequest:dr];
[directions calculateDirectionsWithCompletionHandler:^(MKDirectionsResponse *mresponse, NSError *error) {
if(mresponse.routes.count == 0){
NSLog(#"No routes");
}
else{
for(MKRoute *route in mresponse.routes){
CLLocationDistance d = route.distance/1000;
NSString *dText = [NSString stringWithFormat:#"%g kilometers", d];
[_foundPlacesD addObject:dText];
NSLog(dText);
}
}
}];
}
[self performSegueWithIdentifier:#"locationResults" sender:self];
}
}];
}
I believe I fixed it. The error was that the segue was being performed outside the completion, when it should be performed inside.
I have a button, I want to connect to facebook as I click it, I want all the friends in my facebook.
I can access facebook and I get Facebook Token and saving it in Database.
I am connecting to facebook using following code in CONTROLLER A, but in CONTROLLER B, I want to fetch friend list.
- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
user:(id<FBGraphUser>)user {
NSString *fbAccessToken = [FBSession activeSession].accessTokenData.accessToken;
NSLog(#"Token is %#", fbAccessToken);
DataManager *dataManager = [[DataManager alloc] init];
/*flag is for identification, that from which account user has logged in, either facebook or
from account which he made using this app.
flag = facebook //if user is signed in using his facebook account
flag = myuser //if user is signed in using his own app account
*/
[dataManager saveloginData:fbAccessToken username:#"NO DATA" password:#"NO DATA" flag:#"facebook"];
// NSLog(#"Veer Suthar %#",user);
status = YES;
[self loginWithFacebookDirectly];
// here we use helper properties of FBGraphUser to dot-through to first_name and
// id properties of the json response from the server; alternatively we could use
// NSDictionary methods such as objectForKey to get values from the my json object
self.labelFirstName.text = [NSString stringWithFormat:#" %#", user.first_name];
// setting the profileID property of the FBProfilePictureView instance
// causes the control to fetch and display the profile picture for the user
self.profilePic.profileID = user.id;
NSLog(#"USER IS %#", user);
// self.loggedInUser = user;
}
Try this:
- (void)userFriendList {
NSString *query =#"SELECT name, pic_square FROM user WHERE uid in (SELECT uid2 FROM friend where uid1 = me())";
// Set up the query parameter
NSDictionary *queryParam =
[NSDictionary dictionaryWithObjectsAndKeys:query, #"q", nil];
// Make the API request that uses FQL
[FBRequestConnection startWithGraphPath:#"/fql"
parameters:queryParam
HTTPMethod:#"GET"
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
if (error) {
NSLog(#"Error: %#", [error localizedDescription]);
} else {
NSLog(#"Result: %#", result);
// show result
self.friendList = (NSArray *) [result objectForKey:#"data"];
}
}];
}
Here in the above self.friendList is a NSMutableArray
This is how I fetch Friend List in an Array and then placed in UITableView
Try like this....
// To fetch friends list
-(void)addList:(FBSession *)session
{
NSString* fql = [NSString stringWithFormat: #\"select uid from user where uid == %lld\", session.uid];
NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:#\"query\"];
sessionView = session;
[[FBRequest requestWithDelegate:self] call:#\"facebook.friends.get\" params:params];
}
- (void)request:(FBRequest*)request didLoad:(id)result
{
if(myList==nil)
{
NSArray* users = result;
myList =[[NSArray alloc] initWithArray: users];
for(NSInteger i=0;i<[users count];i++) {
NSDictionary* user = [users objectAtIndex:i];
NSString* uid = [user objectForKey:#\"uid\"];
NSString* fql = [NSString stringWithFormat: #\"select name from user where uid == %#\", uid];
NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:#\"query\"];
[[FBRequest requestWithDelegate:self] call:#\"facebook.fql.query\" params:params];
}
}
else
{
NSArray* users = result;
NSDictionary* user = [users objectAtIndex:0];
NSString* name = [user objectForKey:#\"name\"];
txtView.text=[NSString localizedStringWithFormat:#\"%#%#,\n\",txtView.text,name];
}
}
//To list the online friends
- (void)session:(FBSession*)session didLogin:(FBUID)uid {
NSString *fql = [NSString localizedStringWithFormat:#\"SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=%lld) AND 'active' IN online_presence\",uid];
myList=nil;
NSDictionary *params =[NSDictionary dictionaryWithObject:fql forKey:#\"query\"];
[[FBRequest requestWithDelegate:self] call:#\"facebook.fql.query\" params:params];
}
- (void)request:(FBRequest*)request didLoad:(id)result {
if(myList==nil) {
NSArray* users = result;
myList =users;
for(int i=0;i<[users count];i++) {
NSDictionary* user = [users objectAtIndex:i];
NSString* name = [user objectForKey:#\"uid\"];
NSDictionary* params = [NSDictionary dictionaryWithObjectsAndKeys:name,#\"uids\",#\"name\",#\"fields\",nil];
[[FBRequest requestWithDelegate:self] call:#\"facebook.users.getInfo\" params:params];
}
}
else {
NSArray* users = result;
NSDictionary* user = [users objectAtIndex:0];
NSString* name = [user objectForKey:#\"name\"];
NSLog(name);
}
}
Hope it will helps you..