Facebook分享在应用名称中传递链接

时间:2013-05-23 11:30:24

标签: iphone ios facebook

我想在App Name中传递一个链接,例如,如果用户通过(App Name)单击文本然后导航某个特定的URL

如果有人可以帮助我的代码在这里:

    Facebook *fb = [[Facebook alloc] initWithAppId:FB_ID andDelegate:self];
    NSString *strUrl = [dicItemDetails valueForKey:@"imgurl"];
    if ([strUrl length] == 0) {
        strUrl = [[temp objectAtIndex:0] valueForKey:@"logourl"];
    }
    NSMutableDictionary *d = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
                              [dicItemDetails valueForKey:@"menuItemName"], @"name"
                              , strCaption,@"description"
                              , strUrl, @"picture"
                              , [[temp objectAtIndex:0] valueForKey:@"facebook"], @"link"
                              , nil];
    [fb dialog:@"feed" andParams:d andDelegate:self];

1 个答案:

答案 0 :(得分:1)

你可以在Facebook时间线上发布两条链接,如下面的方式: -

-(void)fbNewuserWallpost
{

        SBJSON *jsonWriter = [[SBJSON new] autorelease];
        NSArray* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:
                                                          @"AppName",@"name",self.FirstLinkString,@"link", nil], nil];
        NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];

        NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                       @"yourAppID",@"app_id",
                                       @"AppName", @"name",
                                       captonString, @"caption",
                                       @"yourDiscription", @"description",
                                       self.secondLinkString, @"link",
                                       @"ImageURL", @"picture",
                                       actionLinksStr, @"actions",
                                       nil];        





        [[AppDelegate facebook] requestWithGraphPath:@"me/feed" andParams:params andHttpMethod:@"POST" andDelegate:self];

}