1

I've noticed WhatsApp has recently(?) enabled sharing location service and since we can open WhatsApp to send pictures/videos I thought maybe now there's a way to also send location?

I haven't really found anything on that matter yet but maybe someone can tell me if it's available now!

xyres
  • 20,487
  • 3
  • 56
  • 85
durazno
  • 559
  • 2
  • 7
  • 25

1 Answers1

3

You can share a location with WhatsApp through the custom URL scheme. Take a look at the following example.

NSString *geoMessage = @"geo:23.1097,-82.4094";
NSString *whatsappURLString = [NSString stringWithFormat:@"whatsapp://send?text=%@", geoMessage];
NSURL *whatsappURL = [NSURL URLWithString:whatsappURLString];

if ([[UIApplication sharedApplication] canOpenURL:whatsappURL]) {
    [[UIApplication sharedApplication] openURL:whatsappURL];
} else {
    // WhatsApp not installed
}

For more info, see WhatsApp's FAQ page about the custom URL scheme: http://www.whatsapp.com/faq/en/iphone/23559013

Update:

I think from newer version of WhatsApp it is not possible.

Hitesh Surani
  • 12,733
  • 6
  • 54
  • 65