How to import facebook contacts to iPhone - iphone

I'm new to iPhone development. I need to display facebook contacts to UITableView of my application. I'm not familiar with the webservice features of iPhone.

Check out Facebook Connect for iPhone (from Facebook) http://developers.facebook.com/blog/post/213/
The Facebook Connect framework provides a class simply called "Facebook" with a method for making FQL requests. FQL requests can be used to retrieve friends lists, and much more.
- (FBRequest*)requestWithMethodName:(NSString *)methodName // #"fql.query"
andParams:(NSMutableDictionary *)params
andHttpMethod:(NSString *)httpMethod // "POST"
andDelegate:(id <FBRequestDelegate>)delegate;
See FQL's documentation: http://developers.facebook.com/docs/reference/fql/

Related

how to get user's posts & updates from Google plus like facebook

I want to get all wall updates of user's google plus account like facebook.
I have seen official link for it which is
Google Plus Documentation for iOS
& I have downloaded sample from there which is here Google Plus SDK Sample
it works well for getting user's information like email id,profile name,user's friend list with images & for posting on google plus.
but I am not getting user's post & updates.
all I want is user's wall updates & user's friends updates from google plus like facebook does.
but from above link i have found nothing for getting wall updates.
I have searched google for this also & get nothing regarding above problem.
any help for above problem appreciated.
Thanks in advance
From a backend server you can easily perform this API call to read a user's public activities. You can see the REST API here:
https://developers.google.com/apis-explorer/#p/plus/v1/plus.activities.list
Combine this with a people.list and you can query for a user's friend activities on Google+.
On iOS, you probably don't want to make these API calls directly from a user's device. If you can, you should offload the work to a backend server to avoid overworking the mobile client. That said, you can perform an API query similar to listing people in circles:
GTLQueryPlus *query =
[GTLQueryPlus queryForActivitiesListWithUserId:#"me" collection:#"public"];
[[[GPPSignIn sharedInstance] plusService] executeQuery:query
completionHandler:^(GTLServiceTicket *ticket,
GTLPlusActivityFeed *actFeed,
NSError *error) {
}
If you put a breakpoint in the application on the function, the activities feed will be something like as follows:
(lldb) po actFeed
{
nextPageToken:"CAIQ44qZ58DgtwIgFCgB"
etag:""DOKFJGXi7L9ogpHc3dzouWOBEEg/UMVQXfw8ynZaTz31tpuZo473TsQ""
title:"Google+ List of Activities for Collection PUBLIC"
updated:"2013-07-16T04:04:34.697Z"
kind:"plus#activityFeed" items:[20]
}
The items array contains the actual activities that a user has publicly written on Google+.

facebook using quickblox sdk instead of facebook-ios-sdk

Is it possible to integrate facebook in my app using quickblox sdk instead of facebook-ios-sdk ?
Sure, you can.
Download latest version of QuickBlox iOS SDK
http://quickblox.com/developers/IOS (1.2.0)
Make query
[QBUsers logInWithSocialProvider:#"facebook" delegate:self];
Enter you login & pass into webform
Catch result
// QuickBlox queries delegate
-(void)completedWithResult:(Result *)result{
// success result
if(result.success){
// User Login
if([result isKindOfClass:QBUUserLogInResult.class]){
QBUUserLogInResult *res = (QBUUserLogInResult *)result;
// Here is your Facebook access token
NSString *fbAccessToken = res.socialProviderToken;
NSDate *fbAccessTokenEpiresAt = res.socialProviderTokenExpiresAt
// Make query to Facebook Graph API with your access token
// ...
}else{
NSLog(#"Errors=%#", result.errors);
}
}
Also, You can see at ChattAR https://github.com/QuickBlox/ChattAR-ios src - we made some queries to Facebook Graph API without Facebook-ios-sdk
p.s. could you use 'quickblox' tag in QuickBlox related questions, thx.
You don't have to use the facebook sdk, it's just better to do so because they made the sdk, it's stable, it works... why recreate the wheel but, by all means, if you only want to do something simple then go for it.

How to get face book contacts(email-id's) of friends for iphone

I am new to iphone, am trying to get the email-id's of friends from my face book account. I need to
save this contact info into my application and display in a UItableview . I am using graph api, using
this am able to get the friend's list,feeds metadata etc. But i want to fetch the contact info of all
my added friends. This is my code to fetch the friends list:
FbGraphResponse *fb_graph_response = [fbGraph doGraphGet:#"me/friends" withGetVars:nil];
NSLog(#"getMeFriendsButtonPressed: %#", fb_graph_response.htmlResponse);
The graph API me/friends will return you the list of friends which only has the friend's user ID and full name. As far as I know, it's not possible for you to retrieve your friends' email from an iPhone application.
And it looks like you're using the old library, try to download the latest FacebookConnect library from github. It's much simpler to use.

How do I like a Facebook AppID through IPhone Application?

I am developing a iPhone application in which I want to simply 'Like' my own Facebook AppID.
For Facebook integration I am using FBConnect and Graph API (https://github.com/facebook/facebook-ios-sdk/blob/master/README.mdown).
After researching, I found that I was supposed to use the following method, which I attempted to implement in the "DemoAppViewController.m" of the sample code when the 'publishStream' button was selected:
NSMutableDictionary *params = [NSMutableDictionary dictionary]; //Use an empty dictionary
[_facebook requestWithGraphPath:#"https://graph.facebook.com/163221793740496/likes"
andParams:(NSMutableDictionary *)params
andHttpMethod:#"POST"
andDelegate:(id <FBRequestDelegate>)self];
However, my FBRequest.m 'responseString' indicates: {"error":{"type":"GraphMethodException","message":"Unsupported post request."}}
What am I doing wrong and how can I make this work?
From what I understand, all I need to do is attach my accessToken to https://graph.facebook.com/163221793740496/likes. What exactly does that mean, and how is it accomplished?
Thanks in advance!
P.S. - In case there was any confusion, my post was in reference to having a user sign into Facebook with their account login via a fb like button in the application. After the user allowed the appropriate permissions, my app would 'like' the AppID with the user's account.
You can't programmatically like a page on Facebook. It would be enthusiastically abused.

iPhone: Beta Features of Facebook Connect

I have an iPhone app idea that will include viewing your news feed( stream ) in an iPhone app. There is a lot more to it than that, but I'm wondering why I can't find any apps on the app store that lets you view your stream in some way. Does anyone know why?
Does facebook frown on this? There is a API method stream.get that lets you do this but it's in beta. Is it a bad idea to use the beta methods in an app?
I'm just suprised that there is so many different twitter clients but there is just on facebook client and why hasn't created streams in an iPhone app besides the main facebook app?
I have implemented what you are talking about and my app is in the App Store, albeit only in a couple European stores currently. It was, however, reviewed and approved in the US App Store. I can't send a link for it currently as we are not yet announcing it in the US (until December), however, I assure you it can be done and is not too hard to implement.
I don't think Facebook frowns upon this so much as I think their API just hasn't matured enough yet. It's getting there, though. I think mostly what you see (or don't see in the App Store) is from a lack of vision for how to use Facebook for applications. The official Facebook app provides what users need but ideas like yours are going to grow as more and more people (developers/entrepreneurs) realize that Facebook is not just a social network, but an entire social networking platform they can leverage in a powerful way... Ok. I've said too much. Cool stuff is coming in December, though. ;-)
If you don't want to use the beta features, you can go for FQL to get what you want. Here is the code I used to implement pulling the last 20 friend status updates:
NSString* fql = [NSString stringWithFormat:
#"SELECT uid, pic_square, name, status FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = %lld) AND status.time > 0 ORDER BY status.time DESC LIMIT 20", fbSession.uid];
NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:#"query"];
last20FriendsStatusRequest = [FBRequest requestWithDelegate:self];
[last20FriendsStatusRequest call:#"facebook.fql.query" params:params];
And then the delegate callback looks like this:
- (void)request:(FBRequest*)request didLoad:(id)result
{
if (request == last20FriendsStatusRequest)
{
// Callback to my delegate here. result is an NSArray*
// of NSDictionaries* containing key-value pairs for the
// fields you requested in the query, e.g. uid, pic_square,
// name, and status. pic_square is the URL of the user's
// profile picture icon.
}
}
Let me know if you need any more info.
I guess people haven't found a use for it. Other developers may be afraid of the beta tag (yes Facebook, unlike Google, treats it as a beta tag -- it's subject to change and may break your app). It's up to your judgement if you think it's "safe" enough. We're currently developing a commercial iPhone application that uses stream.get.
On the desktop there are multiple apps that user Stream.get(), which could as well be done on iPhone