当我在 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");
}];
但它不显示标题和缩略图
最佳答案
网站链接应该是附件
VKRequest *request = [[VKApi wall] post:@{VK_API_ATTACHMENTS : @"http://somelink", @"wall_id":@"0",}];
[request executeWithResultBlock:^(VKResponse *response) {
NSLog(@"OK");
} errorBlock:^(NSError *error) {
NSLog(@"failed");
}];
关于ios - 如何使用 vk ios sdk 在 vk 上的墙上发布来自 ios 应用程序的链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24140273/