You need to setup URL scheme for your app see image below

Now when you will share any url on whatsapp, the url should be like below
yourapp://anymessage
The above url will do the work for you..
If you want to test does it work or not.. Try call the app from any other app by using the follow code..
if([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"yourapp://"]]){
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"yourapp://yourmessage"]];
}
I hope it will help you..
Cheers..
Note: If you find anything better please update my answer..
Update
If you want the url you share to do all the stuffs for opening app or, web url, you might need some server script like below, I am showing for PHP
.
<?php $url="yourapp://".$_GET['message']; ?>
<html>
<head>
<title>Your App Title</title>
<script>
function redirect(){
var now = new Date().valueOf();
setTimeout(function () {
if (new Date().valueOf() - now > 100) return;
window.location = "YOUR WEB URL";
}, 25);
window.location="<?php echo $url; ?>";
}
</script>
</head>
<body onload="redirect()">
</html>
And your actual url should look like
http://yourserver.com/script?message=YOURMESSAGE