【问题标题】:Social Sharing in Cordova Application IOSCordova 应用程序 IOS 中的社交共享
【发布时间】:2018-06-15 07:51:06
【问题描述】:

我正在尝试使用此插件在微信和 WhatsApp 中分享图像:EddyVerbruggen/SocialSharing-PhoneGap-Plugin

window.plugins.socialsharing.shareVia('whatsapp','msg',null, 
      'images/hello.png' , null /* url */, function(e) {
   console.log('share' +e)
 }, function(errormsg){
   alert(errormsg)
 })

window.plugins.socialsharing.shareVia('com.tencent.mm','msg',null, 
      'images/hello.png' , null /* url */, function(e) {
   console.log('share' +e)
 }, function(errormsg){
   alert(errormsg)
 })

我的应用在 ios 中崩溃,但在 android 中运行正常。

通过使用另一种方法shareViaWhatsapp:

window.plugins.socialsharing.shareViaWhatsApp('Message via WhatsApp' 
  ,'images/hello.png', function() {
        console.log('share ok')
        }, function(errormsg){
           alert(errormsg)
        })

此方法在 android 中有效,但在 ios 中显示当我共享图像时要共享的所有应用程序,如果我只共享消息它在 ios 中正常工作。请指导我。

【问题讨论】:

    标签: android ios cordova cordova-plugins


    【解决方案1】:

    在我的情况下,我可以确认,通过 shareViaWhatsApp 与 WhatsApp 共享在 iO 上不起作用。 我能够共享图片的唯一方法是使用您提到的插件的共享表。 所以它是这样的:

    this.socialSharing.share(null, null, this.screen, null).then(() => {  
    console.log(' succ share test')
      this.shareWhatsApp()
    }).catch((e) => {
      console.log(' err share test')
      this.shareWhatsApp()
    });

    【讨论】:

    • 非常感谢,但您正确使用了默认共享表
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多