Skip to main content

How To Add Social Sharing For Your Ionic App

In this post I will show you how to add social sharing for your Ionic Framework version 1.x apps. It is pretty easy and we will be using the Cordova Social Sharing plugin for this. If you are looking to add Social Sharing for Ionic 2 Apps check out my newer post.

 See the Video Tutorial here:

 

Step 1)

We will first start by creating a new project in Ionic by running the following commands

The sidemenu template provides us an easy way to add the social sharing inside the side menu but you can use any other template and add social sharing any other way you want.

 

Step 2)

Now we will add the socical sharing pugin. You can read more about it on the git repo here. We will add the plugin by running the following command

 

Step 3)

Then we will need to modify the side menu according to our need, so we will add the following to our side menu

This will add a list item for us which when clicked will take us to the share template.

 

Step 4)

Now let us modify the app.js file so we can add a route and controller for the share template

Here we added a file share.html to the state and a shareController associated with it. We will create share.html file next.

 

Step 5)

So in the templates folder add a new file named share.html and put the following code in it.

Now that we have our template ready its time to take care of the controller which is shareCtrl

 

 

Got A Question?

Hit me up in the comments here or on the comments section on my YouTube Channel or on twitter @pointDeveloper

Consider Subscribing / Donating
Subscribe To Mailing List
Donate
If my site was helpful to you, then please consider donating via paypal:

Prantik Vaghela (pointdeveloper)

Hi my name is Prantik Vaghela. I have done my Bachelors and Masters in Computer Science and am a web developer and now a Tutor through my blog. :-)

%d bloggers like this: