1

我想在应用程序名称中传递一个链接,例如,如果用户通过(应用程序名称)单击文本,那么它会导航一些特定的 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];
4

1 回答 1

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];

}
于 2013-05-23T11:44:16.307 回答