title: Is there a way to open "whatsapp://send/?text=abc" links from cordova hybrid app without using any cordova social sharing plugins?
body: <p>I made an hybrid app from my existing angular project using cordova. I am trying to add social sharing buttons like WhatsApp, LinkedIn, etc. </p>
  
  <p>LinkedIn works fine because the share URL can be opened from InAppBrowser. </p>
  
  <p>When I am trying to open whatsapp with a custom URL scheme <code>whatsapp://send?text=abc</code>, I get this error <code>ERR_UNKNOWN_URL_SCHEME</code>. </p>
  
  <p>From related StackOverflow questions, I tried some solutions. None of them seems to work and I get the same error message. </p>
  
  <p>I tried adding these lines in <code>config.xml</code> to allow whatsapp url scheme</p>
  
  <pre><code>&lt;allow-intent href="whatsapp:*" /&gt;
  &lt;access origin="whatsapp:*" launch-external="yes" /&gt;
  &lt;preference name="AllowedSchemes" value="whatsapp" /&gt;
  </code></pre>
  
  <p>I tried to edit InAppBrowser.java file and modified <code>ShouldOverrideUrlLoading</code> method to open Intent Action View on visiting "whatsapp:". </p>
  
  <pre><code>@SuppressWarnings("deprecation")
  @Override
  public boolean shouldOverrideUrlLoading(WebView webView, String url) {
      if (url.startsWith("geo:") || url.startsWith(WebView.SCHEME_MAILTO) || url.startsWith("market:") || url.startsWith("intent:") || url.startsWith("whatsapp:")) {
          try {
                      Intent intent = new Intent(Intent.ACTION_VIEW);
                      intent.setData(Uri.parse(url));
                      cordova.getActivity().startActivity(intent);
                      return true;
          } catch (android.content.ActivityNotFoundException e) {
                      LOG.e(LOG_TAG, "Error with " + url + ": " + e.toString());
          }
      }
  }
  </code></pre>
  
  <p>I am using 
  Angular 7,
  cordova-android 8.1.0,
  cordova-plugin-inappbrowser 2.0.2</p>
  
  <p>To reproduce the above problem, </p>
  
  <p>In html:</p>
  
  <pre><code>&lt;button (click)="sendViaWhatsapp()"&gt;Send on WhatsApp&lt;/button&gt;
  </code></pre>
  
  <p>In JS:</p>
  
  <pre><code>sendViaWhatsapp() {
      window.open("whatsapp://send/?text=abc", "_system");
  }
  </code></pre>
  
  <p>Is it possible to achieve this without using any cordova social share plugins?</p>
  
  <p>My guess is, it is an issue with Cordova WebView and the url is being opened with InAppBrowser. I am not able to find any leads on this. </p>
  
  <p>Am I doing it right or Is there something that I am missing?</p>