Unsupported URL error clicking a Whatsapp scheme with an URL in a iOS WKWebView
<p>I'm using iOS 9.3.3 and clicking a Whatsapp link in a website displayed in a WKWebView.</p>

<p>Whenever I try to send a message to the whatsapp url scheme with a URL that includes the http:// or https:// part of the link as part of the message I get an "Unsupported URL" error.</p>

<pre><code> [self.webView1 loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"whatsapp://send?text=this%20is%20a%20test%20http://https://www.usa-brands.net/collections/new-arrivals/products/dacey-cap-sleeve-drop-waist-wool-sweater-dress"]]];
</code></pre>

<p>When I take out the http:// or https:// it works but now I don't get a Rich Preview (<a href="https://www.macstories.net/ios/whatsapp-adds-rich-previews-for-web-links/" rel="nofollow">https://www.macstories.net/ios/whatsapp-adds-rich-previews-for-web-links/</a>).</p>

<p>I've tried encoding the url but this doesn't work either. When I remove all other potential problems it comes down to the protocol in the url link.</p>

<p>The full error message is:</p>

<p>Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={_WKRecoveryAttempterErrorKey=, NSErrorFailingURLStringKey=whatsapp://send?text=Check%20this%20out%20'Dacey'%20Cap%20Sleeve%20Drop%20Waist%20Wool%20Sweater%20Dress,%20348.00%20USD:%20https://www.usa-brands.net/products/dacey-cap-sleeve-drop-waist-wool-sweater-dress, NSErrorFailingURLKey=whatsapp://send?text=Check%20this%20out%20'Dacey'%20Cap%20Sleeve%20Drop%20Waist%20Wool%20Sweater%20Dress,%20348.00%20USD:%20https://www.usa-brands.net/products/dacey-cap-sleeve-drop-waist-wool-sweater-dress, NSUnderlyingError=0x137dd1380 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "unsupported URL" UserInfo={NSErrorFailingURLStringKey=whatsapp://send?text=Check%20this%20out%20'Dacey'%20Cap%20Sleeve%20Drop%20Waist%20Wool%20Sweater%20Dress,%20348.00%20USD:%20https://www.usa-brands.net/products/dacey-cap-sleeve-drop-waist-wool-sweater-dress, NSLocalizedDescription=unsupported URL, NSErrorFailingURLKey=whatsapp://send?text=Check%20this%20out%20'Dacey'%20Cap%20Sleeve%20Drop%20Waist%20Wool%20Sweater%20Dress,%20348.00%20USD:%20https://www.usa-brands.net/products/dacey-cap-sleeve-drop-waist-wool-sweater-dress}}, NSLocalizedDescription=unsupported URL}</p>

<p>Does anyone have any idea why this doesn't work. It works for Android.</p>