2013-05-28 4 views
12

Für die iPhone Apps, ist es möglich, einen WhatsApp Link auf Produkte zu haben? Sobald Link, würde es eine Nachricht an meine Handynummer über WhatsApp senden. Bitte um Rat.WhatsApp Link auf Produkte?

Antwort

2

Sie tun es entweder des Verfahrens, wie tafh vorgeschlagen, die benutzerdefinierte Methode ist oder als iOS App-Entwickler Ich würde vorschlagen, Sie mit Dokument-Interaktion-Controller zu gehen, initialisieren Sie einen UIDocumentInteractionController. Diese beiden helfen Ihnen beim Verwalten von Interaktionen. Weitere Informationen finden Sie im folgenden Link.

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

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

    return interactionController; 
} 

Here

+0

@ Neji Vielen Dank für die Überarbeitung –

0

Ich bin mir nicht sicher, aber Sie sollten versuchen, this link.

Auch ich habe WhatsApp API um github überprüfen Sie es hilfreich für Sie sein kann.

+0

Vielen Dank für Ihre Antwort – SampathKumar

0

Ich bin nicht sicher genau das, was Sie meinen, aber vielleicht ist das, was Sie suchen: 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

Vielen Dank für Ihre Antwort – 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]; 

} 

diesen Code im verwendet folgende Zeichenfolge Senden auf whatsapp

0

Sie auf untenstehenden Link

http://handleopenurl.com/scheme/833

aussehen sollte es geben Ihnen alle offenen url Schema-Option für alle Apps und Sie können Registriere deine App auch.