简体   繁体   English

离子电容器(或 Cordova) - 将图像共享给 facebook

[英]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).我已经使用带有电容器的 Ionic/Angular 构建了一个应用程序(但也可以使用 Cordova 插件,因为它仅适用于移动设备)。 I am trying to add a feature to share an image on facebook.我正在尝试添加一个功能以在 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).我尝试使用 SocialSharing 插件,但它根本不起作用(它会引发可用于共享的 package 名称列表的错误,并且“com.facebook.katana”不在其中)。

I then tried the cordova-plugin-facebook-connect plugin, and I can only share a URL using the showDialog() with a "share" method.然后我尝试了 cordova-plugin-facebook-connect 插件,我只能使用带有“共享”方法的 showDialog() 共享 URL。 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...我还尝试了 Capacitor Share 插件,但无法仅将 facebook 显示为要使用的社交网络...

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.我想要实现的是向用户展示一个对话框,以将图像共享给 Facebook,仅使用(如果可能)预先填充的文本到 go 以及它,或者呈现正常的“共享通过”对话框,但能够确定用户是否选择了facebook作为媒体并成功分享了镜像。

Any help?有什么帮助吗? Many thanks !非常感谢 !

I'm the maintainer of cordova-plugin-facebook-connect.我是 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 https://github.com/cordova-plugin-facebook-connect/cordova-plugin-facebook-connect/issues/54

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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