How to trigger share options in Angularjs with Ionic?

Asked

Viewed 747 times

1

Good night

I have a mobile app, I have seen in some apps that when I click to share that appears the options of apps installed as facebook on the phone to share would like to know how I can trigger these options to share for example on social networks like facebook.

1 answer

2

Use ngCordova with the plugin Social Sharing

For this just install ngCordova with Bower and add the plugin

bower install ngCordova
cordova plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git

Add the script to your index.html

<script src="lib/ngCordova/dist/ng-cordova.js"></script>
<script src="cordova.js"></script>

And add dependency to your app.js

angular.module('myApp', ['ionic', 'ngCordova'])

In the controller use the $cordovaSocialSharing service. Documentation of how to use is on the project’s github: https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin

  • I can use this plugin to share a file I create in Ionic app?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.