2013-05-28 78 views

回答

2

你做任何的方法作爲tafh建議這是自定義的方法或者通過iOS應用程序開發人員我建議你去文檔交互控制器,初始化一個UIDocumentInteractionController。這些都可以幫助您管理交互。查看下面的鏈接瞭解更多信息。

(UIDocumentInteractionController *) setupControllerWithURL: (NSURL) fileURL 
     usingDelegate: (id <UIDocumentInteractionControllerDelegate>) interactionDelegate { 

    UIDocumentInteractionController *interactionController = 
     [UIDocumentInteractionController interactionControllerWithURL: fileURL]; 
    interactionController.delegate = interactionDelegate; 

    return interactionController; 
} 

Here

+0

@Neji感謝您的修改 – 2013-10-03 11:36:50

0

我不確定,但你應該試試this link

此外,我得到了WhatsApp的API在github檢查它可能對你有所幫助。

+0

感謝您的回覆 – SampathKumar

0

我不知道你的意思到底是什麼,但也許這是你在找什麼:http://www.whatsapp.com/faq/en/iphone/23559013

NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?text=Hello%2C%20World!"]; 
if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) { 
[[UIApplication sharedApplication] openURL: whatsappURL]; 
} 
+0

感謝您的回覆 – SampathKumar

1
notification = @"Your Daily Inspiration by the "; 
notification = [notification stringByAppendingString:@"\n"];  
notification = [notification stringByAppendingString:textview.text]; 
NSString *whats=notification; 
NSString *baseURL = [NSString stringWithFormat:@"whatsapp://send?text=%@",whats]; 
NSURL *url = [NSURL URLWithString:[baseURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; 

if ([[UIApplication sharedApplication] canOpenURL: url]) { 
    [[UIApplication sharedApplication] openURL: url]; 
} 
else 
{ 
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Sorry" 
                 message:@"You can't send a thought on Whatsapp" 
                 delegate:self 
               cancelButtonTitle:@"OK" 
               otherButtonTitles:nil]; 
    [alertView show]; 

} 

使用該代碼的IM發送的WhatsApp的,你應該看看下面的鏈接