1

I have heard about URL-schemes but I cannot return back to my app after Whatsapp opens.

I referred this link http://www.whatsapp.com/faq/en/iphone/23559013

Here is code snippet which I copied into my app:

NSString * msg = @"YOUR MSG";
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 {
    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"WhatsApp installed." message:@"Your device has WhatsApp installed." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alert show];
}
Parthi
  • 51
  • 8
  • Not possible unless Whatsapp have given a mechanism for this in their application. Facebook SDK allows user to switch b/w Facebook app for verification and switches back. – ZeMoon Jul 15 '14 at 09:26
  • How about using the second method as provided on the webpage – ZeMoon Jul 15 '14 at 09:27

0 Answers0