Implementing a Social Sharing in Ionic using cordova plugins

I'm trying to implement social sharing in ionic. I followed this tutorial https://blog.nraboy.com/2014/10/implement-social-media-sharing-ionicframework/

I'm getting the error as

TypeError: Cannot read property 'socialsharing' of undefined

at Object.share (ng-cordova.min.js:9)
at Scope.$scope.shareAnyWhere (shareController.js:10)
at $parseFunctionCall (ionic.bundle.js:21037)
at ionic.bundle.js:53344
at Scope.$get.Scope.$eval (ionic.bundle.js:23093)
at Scope.$get.Scope.$apply (ionic.bundle.js:23192)
at HTMLButtonElement.<anonymous> (ionic.bundle.js:53343)
at HTMLButtonElement.eventHandler (ionic.bundle.js:11706)
at triggerMouseEvent (ionic.bundle.js:2863)
at tapClick (ionic.bundle.js:2852)

I have install the plugins which was mentioned in the tutorial.

First make sure you include ng-cordova before cordova.js. Then take a look at the working example here, try that.

Secondly, Make sure you are doing your tests on a real device or on an emulator, Social sharing plugin is intended for native sharing functionality on the OS you are targeting, it is not intended and it will not work on the browser. If you are on a browser then that is why!

You can use the Ionic CLI to run your tests.