2012-08-11 2 views
0

Comment intégrer facebook dans une application iOS?Intégration Facebook dans une application iOS

Je l'ai essayé une fois mais je n'ai pas compris comment générer une clé à partir d'un compte développeur.

S'il est possible, alors s'il vous plaît me fournir un document qui décrit en détail tout

Merci à l'avance.

+0

Que voulez-vous .... Comment générer une clé d'application sur le compte développeur fb ou comment implémenter FBGraph dans votre application? – TheTiger

Répondre

0

Vous pouvez intégrer facebook en utilisant la méthode FBGraph. Ici, vous devez d'abord importer les frameworks JSON et FBGraph. Après cela, écrivez le code suivant: -

NSString *client_id = @"130902823636657"; 
self.fbGraph =[[FbGraph alloc] initWithFbClientID:client_id]; 

[fbGraph authenticateUserWithCallbackObject:self andSelector:@selector(fbGraphCallback:) andExtendedPermissions:@"user_photos,user_videos,publish_stream,offline_access,user_checkins,friends_checkins"]; 




- (void)fbGraphCallback:(id)sender 
{ 
if ((fbGraph.accessToken==nil)||([fbGraph.accessToken length]==0)) { 

    [fbGraph authenticateUserWithCallbackObject:self andSelector:@selector(fbGraphCallback:) andExtendedPermissions:@"user_photos,user_videos,publish_stream,offline_access,user_checkins,friends_checkins"];   }  
else 
{ 
    NSMutableDictionary *Variables=[[NSMutableDictionary alloc] initWithCapacity:2]; 
    FbGraphFile *graph_File=[[FbGraphFile alloc] initWithImage:imageCollage.image]; 
    [Variables setObject:graph_File forKey:@"file"]; 
    [Variables setObject:@"" forKey:@"message"]; 
Questions connexes