简体   繁体   中英

Ionic Capacitor (or Cordova) - share image to facebook

I have built an app using Ionic/Angular with Capacitor (but can also use Cordova plugins as it's only for mobile). I am trying to add a feature to share an image on facebook. I tried using the SocialSharing plugin but it doesn't work at all (it raises an error with a list of package names that can be used for sharing, and 'com.facebook.katana' is not amongst them).

I then tried the cordova-plugin-facebook-connect plugin, and I can only share a URL using the showDialog() with a "share" method. Images are not accepted.

I also tried the Capacitor Share plugin, but there is no way to just show facebook as the social network to use...

What I want to achieve is either to present the user with a dialog to share an image to Facebook only with (if possible) a pre-populated text to go along with it, or present the normal "share via" dialog but to be able to establish whether the user chose facebook as the medium and successfully shared the image.

Any help? Many thanks !

I'm the maintainer of cordova-plugin-facebook-connect.

It's not possible today to share photos with the plugin, but that will be added in the next major release:

https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect/issues/54

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM