0

我想知道用这个登录FB后如何用字符串@“123456789”在我自己的墙上发帖

facebook = [[Facebook alloc] initWithAppId:kAppId andDelegate:self];

    // Check and retrieve authorization information
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    if ([defaults objectForKey:@"FBAccessTokenKey"] && [defaults objectForKey:@"FBExpirationDateKey"]) {
        facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"];
        facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"];
    }

    // Initialize user permissions
    userPermissions = [[NSMutableDictionary alloc] initWithCapacity:1];

    if (![facebook isSessionValid]) {
        NSArray *permissions = [[NSArray alloc] initWithObjects:
                                @"publish_stream", 
                                nil];
        [facebook authorize:permissions];
        //[permissions release];
    }
4

2 回答 2

4

使用以下代码喂养

  NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   [NSString stringWithFormat:@"YOUR MESSAGE"],
                                   @"message", nil];
    [facebook requestWithGraphPath:@"me/feed" andParams:params andHttpMethod: @"POST" andDelegate:self];
于 2012-05-30T09:17:00.767 回答
1

您始终可以创建自己的请求并将其发布到 facebook,如以下请求:您指定您想要的内容:类型、链接、图片、来源、消息、名称、标题、描述,并且您必须提供 access_token,如果您正在使用facebook api,您可以轻松获得。

https://graph.facebook.com/me/feed?type=&link=&picture=&source=&message=&name=jwt&caption=inmyworld&description=&access_token=

于 2012-05-30T09:59:53.890 回答