social sharing plugin for phonegap.

  • 1
  • Question
  • Updated 4 years ago
  • Answered
I am developing app using jQuery Mobile and Phonegap.
i need to share image on Facebbok,Twitter and Whatsapp.
I am using
https://github.com/EddyVerbruggen/Soc...
this plugin.
i add
<script src="js/cordova.js"></script>
<script type="text/javascript" src="js/SocialSharing.js"></script>

in my head.

My HTML Page:

<center><button onclick="window.plugins.socialsharing.share('Type your Message','image/folder1/my1.jpg',null,function() {console.log('share ok')}, function(errormsg){alert(errormsg)})">Share</button></center>

<center><button onclick="window.plugins.socialsharing.shareViaFacebook('This is an image', 'image/folder1/my1.jpg', null, function() {console.log('share ok')}, function(errormsg){alert(errormsg)})">Facebook</button></center>

<center><button onclick="window.plugins.socialsharing.shareViaTwitter('Message and link via Twitter','image/folder1/my1.jpg', null,function() {console.log('share ok')}, function(errormsg){alert(errormsg)})">Twitter</button></center>

<center><button onclick="window.plugins.socialsharing.shareViaWhatsApp('Message via WhatsApp',image/folder1/my1.jpg, null, function() {console.log('share ok')}, function(errormsg){alert(errormsg)})"> WhatsApp</button></center>

my config.xml

<gap:plugin name="nl.x-services.plugins.socialsharing" />

<!-- for Android -->
<feature name="SocialSharing">
<param name="android-package" value="nl.xservices.plugins.SocialSharing" />
</feature>


Androidmainfest.xml

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />


then i Copy SocialSharing.java to platforms/android/src/nl/xservices/plugins

but whenever i click on share button nothing is happened
any suggestion.
Photo of Rohit

Rohit

  • 22 Posts
  • 0 Reply Likes
  • frustrated

Posted 6 years ago

  • 1
Photo of John Weidner

John Weidner, Champion

  • 435 Posts
  • 80 Reply Likes
I'd suggest using "adb logcat" to see what is happening with your app.

This forum is specific to "PhoneGap Build" and you are apparently using PhoneGap CLI. You might be better off posting your question at https://groups.google.com/forum/#!for... I used this plugin with PhoneGap Build and it worked fine. The installation steps were very easy.
Photo of Rohit

Rohit

  • 22 Posts
  • 0 Reply Likes
@John Weidner give me your email id so i can send my code to you..
or else give the steps to install this plugin.
Photo of John Weidner

John Weidner, Champion

  • 435 Posts
  • 80 Reply Likes
I don't have experience using the PhoneGap CLI. I use PhoneGap Build. To install the plugin with PhoneGap Build, all you do is add the line below to your config.xml file.

<gap:plugin name="nl.x-services.plugins.socialsharing" />
Photo of Rohit

Rohit

  • 22 Posts
  • 0 Reply Likes
i have already this line in my config.xml
see my post
Photo of John Weidner

John Weidner, Champion

  • 435 Posts
  • 80 Reply Likes
And if you were using PhoneGap Build instead of PhoneGap CLI, that would be all you need.
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Those steps are nicely described in the plugin's docs:
https://github.com/EddyVerbruggen/Soc...
Photo of Osaru Agbonaye

Osaru Agbonaye

  • 1 Post
  • 0 Reply Likes
I am having the same problem. any help
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Have both of you really coded

<script src="js/cordova.js"></script>

as stated in the first post?
Photo of Vikash Mishra

Vikash Mishra

  • 2 Posts
  • 0 Reply Likes
i am having exactly same problem any one have solution ?