Reputation: 11
Here is the code. I took it from http://www.whatsapp.com/faq/en/iphone/23559013 It goes into if condition. But do nothing. This code worked for iphone 5. And in case of iphone 5s nothing happened. It is not opening Whatsapp URL.
NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?text=Hello%2C%20World!"];
if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) {
[[UIApplication sharedApplication] openURL: whatsappURL];
}
Upvotes: 1
Views: 427
Reputation: 105
Maybe is not your case but I think my answer will help someone else.
I had the same issue on iOS 11 and the problem was that some customUrls are not supported anymore from UIApplication.shared.canOpenURL()
.
You have to use UIApplication.shared.openUrl()
.
I hope this can be helpful
Upvotes: 0
Reputation: 230
In Plist add
<key>LSApplicationQueriesSchemes</key>
<array>
<string>whatsapp</string>
</array>
Upvotes: 1