2014-06-10 24 views
0

當我在vk.com牆上共享指向網站的鏈接時,它顯示網站的標題和縮略圖。如何使用vk ios sdk來做到這一點?我想分享喜歡如何使用vk發佈從vos牆上的ios應用程序的鏈接ios sdk

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

消息中的鏈接,但它並不顯示標題和縮略圖

回答

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"); 
}]; 
相關問題