我已經使用上了WhatsApp共享圖像下面的代碼,但我無法設置使用下面的代碼的標題文字。如何在iphone上分享whatsapp上的圖片+文字說明(URL)?
我已經試過的UIDocumentInteractionController
註釋財產,但在WhatsApp的開發形式沒有任何鍵被註解指定。
我知道我們可以通過UIImageGraphicContext
做到這一點,但我需要共享URL作爲標題
if ([[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"whatsapp://app"]])
{
NSString * savePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/whatsAppTmp.wai"];
[UIImageJPEGRepresentation([UIImage imageNamed:@"Convenor- image-SURANA1.png"], 1.0) writeToFile:savePath atomically:YES];
_documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:savePath]];
_documentInteractionController.annotation = [NSDictionary dictionaryWithObject:@"wwww.google.com" forKey:@"whatsappCaption"];
_documentInteractionController.UTI = @"net.whatsapp.image";
_documentInteractionController.delegate = self;
[_documentInteractionController presentOpenInMenuFromRect:CGRectMake(0, 0, 0, 0) inView:self.view animated: YES];
} else {
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Alert." message:@"Por favor, instale Whatsapp." delegate:nil cancelButtonTitle:@"Está bem" otherButtonTitles:nil];
[alert show];
}
我沒有看到[iOS開發人員專用的WhatsApp FAQ]任何明顯的(http://www.whatsapp.com/faq/en/iphone/23559013)。您可能需要[通過[email protected]發送電子郵件給他們的產品支持](http://www.whatsapp.com/contact/)。 – 2014-11-23 12:54:45
謝謝,我已經郵寄支持,但無法得到他們的回覆。最後我做到我有共同文字圖片URL,這樣圖片將可在該圖像的URL路徑 – Bhavik 2014-11-26 19:20:17