Opening whatsapp:// URL with one of the following parameters, will open whatapp and perform a custom action like sharing of text:-
1- Add whatsapp in LSApplicationQueriesSchemes to your info.plist
2- Message will be diplayed as My, message.
3- if [UIApplication sharedApplication]canOpenURL:whatsappURL] found true then it will open the whatsapp on your iPhone and show the text in Chat textView as My, Message and if you want to remove the "," (Comma) from message then use only "%20".
NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?text=My%2C%20Message!"];
if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) {
[[UIApplication sharedApplication] openURL: whatsappURL];
}else{
[self showAlert:@"No whatsApp installed on your device"];
}
This will open the whats app.
0 Comment(s)