5

I've developed an ionic 3 app. I am unable to open whatsapp from my app with a specific contact in ionic 3. i don't want to send or share any thing but only wants to open whatsapp in android & iOS from my app with a specific contact. Is there any way to open whatsapp? Till now i have implemented as below which is not working

window.open(`whatsapp:${+911234567890}`, '_system');

Any help much appreciate.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Priyank
  • 3,778
  • 3
  • 29
  • 48

2 Answers2

3

See it: http://phonegap-plugins.com/plugins/ranjitpandit/whatsapp-phonegap-plugin

cordova.plugins.Whatsapp.send("yourNumber", sucessoCallback, errorCallback);

0

I am Using this:

            String phone = "+8801510101010";

            PackageManager packageManager = MainActivity.this.getPackageManager();
            Intent i = new Intent(Intent.ACTION_VIEW);

            try {
                String url = "https://api.whatsapp.com/send?phone="+ phone;
                i.setPackage("com.whatsapp");
                i.setData(Uri.parse(url));
                if (i.resolveActivity(packageManager) != null) {
                    MainActivity.this.startActivity(i);
                }
            } catch (Exception e){
                e.printStackTrace();
            }