2016-04-26 17 views
-1

Wenn ich einen Link von What's App mit UIActiviyViewController teilen, dann zeigt es eine leere TabelleView?WhatsApp Freigabe funktioniert nicht in UIActivityViewController iOS?

UIActivityViewController *ACVcontroller =[[UIActivityViewController alloc]initWithActivityItems:@[text,tinyURL,append] 
                         applicationActivities:nil]; 
[self presentViewController:ACVcontroller animated:YES completion:nil]; 
+0

Mit WhatsApp AFAIK können Sie entweder nur ein Bild oder einen Text teilen. – SeanLintern88

+0

Sir ich teile nur Text –

+0

"What's App" bedeutet etwas völlig anderes als "WhatsApp". – peterh

Antwort

0

NUtZeN whatsapp API: http://www.whatsapp.com/faq/en/iphone/23559013

für nur Text von Objective-C senden versuchen, diese

NSString * msg = @"YOUR MSG To Share"; 
NSString * urlWhats = [NSString stringWithFormat:@"whatsapp://send?text=%@",msg]; 
NSURL * whatsappURL = [NSURL URLWithString:[urlWhats stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; 
if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) { 
    [[UIApplication sharedApplication] openURL: whatsappURL]; 
} else { 
    // Cannot open whatsapp 
} 
+0

Wo schreibe ich diesen Code? –

+0

auf WhatsApp Sharing-Taste –

+0

Ich benutze die UIActivityViewController Sir –

Verwandte Themen