How to open Whatsapp on users device in ionic

This is how i have written my code…

<a href="whatsapp://send?text=Hello World">
    <ion-icon name="logo-whatsapp" id="whatsapp" padding></ion-icon>
</a>

Anybody help please…

Do you want to allow your user to share something/text via whatsapp?

If so, have a look at the social sharing plugin, it’s his purpose

I have gone to the page and as i was installing the ionic native plugin this is what i got…

C:\Users\Liz Ndirangu\ALVO\PROJECTS\MOBILE\LEARNIONIC\myApp>npm install --save @
ionic-native/social-sharing
C:\Users\Liz Ndirangu\ALVO\PROJECTS\MOBILE\LEARNIONIC\myApp
`-- @ionic-native/social-sharing@4.1.0

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\ch
okidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"
})
npm WARN Invalid name: "Soko360 App beta"
npm WARN ajv-keywords@2.1.0 requires a peer of ajv@>=5.0.0 but none was installe
d.
npm WARN myApp No description
npm WARN myApp No repository field.
npm WARN myApp No README data
npm WARN myApp No license field.

C:\Users\Liz Ndirangu\ALVO\PROJECTS\MOBILE\LEARNIONIC\myApp>

So what should i do

euh it’s ok no? I don’t see any errors just warnings? or I’m missing something?

so has the npm install --save @ionic-native/social-sharing worked??

when I run the same I command I get:

npm WARN ajv-keywords@2.1.0 requires a peer of ajv@>=5.0.0 but none was installed.

+ @ionic-native/social-sharing@4.1.0
added 1 package in 8.282s

but I’m not under windows, don’t know if that could be a difference.

could you check if you’ve got data in:

 ls -ltr node_modules/@ionic-native/social-sharing

in my case I get

total 96
-rw-r--r--  1 me  staff   7923 21 jul 07:18 index.metadata.json
-rw-r--r--  1 me  staff  10934 21 jul 07:18 index.js.map
-rw-r--r--  1 me  staff  11898 21 jul 07:18 index.js
-rw-r--r--  1 me  staff   5641 21 jul 07:18 index.d.ts
-rw-r--r--  1 me  staff    825 21 jul 07:19 README.md
-rw-r--r--  1 me  staff   1532 15 aoû 21:38 package.json

thanx a lot i found the file

C:\Users\Liz Ndirangu\ALVO\PROJECTS\MOBILE\LEARNIONIC\myApp\node_modules\@ionic-
native\social-sharing>dir
 Volume in drive C is Windows
 Volume Serial Number is 90E1-E4F6

 Directory of C:\Users\Liz Ndirangu\ALVO\PROJECTS\MOBILE\LEARNIONIC\myApp\node_m
odules\@ionic-native\social-sharing

08/15/2017  10:35 PM    <DIR>          .
08/15/2017  10:35 PM    <DIR>          ..
08/15/2017  10:35 PM             5,641 index.d.ts
08/15/2017  10:35 PM            11,898 index.js
08/15/2017  10:35 PM            10,934 index.js.map
08/15/2017  10:35 PM             7,923 index.metadata.json
08/15/2017  10:35 PM             2,643 package.json
08/15/2017  10:35 PM               825 README.md
               6 File(s)         39,864 bytes
               2 Dir(s)   3,821,162,496 bytes free

C:\Users\Liz Ndirangu\ALVO\PROJECTS\MOBILE\LEARNIONIC\myApp\node_modules\@ionic-
native\social-sharing>
1 Like

cool good news, have fun :wink: