Answer the question
In order to leave comments, you need to log in
Correct WhatsApp Share setup for iOS and Android?
I'm setting up a "Share" button on a website, the catch is that Android and iOS have different URL schemes.
For Android :
<a href="whatsapp://send?text=Hello%20World!">Hello, world!</a>
NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?text=Hello%2C%20World!"];
if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) {
[[UIApplication sharedApplication] openURL: whatsappURL];
}
<?php
$iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
$Android = stripos($_SERVER['HTTP_USER_AGENT'],"Android");
if( $iPod || $iPhone || $iPad ) {
// не знаю как тут правильно записать
} else if( $Android ) {
echo '<a href="whatsapp://send?text=Hello%20World!">Hello, world!</a>';
}
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question