0

如何将 Facebook 集成到 iOS 应用程序中?

我试过一次,但我不明白如何从开发者帐户生成密钥

如果可能的话,请向我提供一份详细描述所有内容的文件

提前致谢。

4

1 回答 1

0

您可以使用 FBGraph 方法集成 facebook。在这里,您必须首先导入 JSON 和 FBGraph 框架。之后编写以下代码:-

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"];
于 2012-08-11T06:40:43.270 回答