0

当我在 vk.com 墙上分享一个网站链接时,它会显示网站的标题和缩略图。如何使用 vk ios sdk 做到这一点?我试图在一条消息中分享一个链接,例如

VKRequest *request = [[VKApi wall] post:@{@"wall_id":@"0", @"message":@"http://somelink"}];
[request executeWithResultBlock:^(VKResponse *response) {
            NSLog(@"OK");
        }];
} errorBlock:^(NSError *error) {
    NSLog(@"Failed");
}];

但它不显示标题和缩略图

4

1 回答 1

2

网站链接应该是附件

VKRequest *request = [[VKApi wall] post:@{VK_API_ATTACHMENTS : @"http://somelink", @"wall_id":@"0",}];
[request executeWithResultBlock:^(VKResponse *response) {
        NSLog(@"OK");
} errorBlock:^(NSError *error) {
    NSLog(@"failed");
}];
于 2014-06-10T15:42:57.133 回答