1

I want to share iTunes URL of application on whatsapp via app. I am using below code:

NSString * urlWhats = [NSString stringWithFormat:@"whatsapp://send?text=Hi, I am using test app. You can also download it from here %@",strUrl];
    NSURL * whatsappURL = [NSURL URLWithString:[urlWhats stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
    if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) {
        [[UIApplication sharedApplication] openURL: whatsappURL];
    } else {
        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"WhatsApp not installed." message:@"Your device has WhatsApp installed." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
        [alert show];
    }

But, I can't share it as it contains https url. I have tried various solutions which I found on stackoverflow.

Is there any way to do that ?

--Updated: I got the solution by converting the iTunes url to tinyURL. Thanks for the help.

-Thanks in advance.

Aakil Ladhani
  • 984
  • 9
  • 32

0 Answers0