【问题标题】:my app crash when use socialSharing plugin in ionic 3在 ionic 3 中使用 socialSharing 插件时我的应用程序崩溃
【发布时间】:2018-08-10 14:52:13
【问题描述】:

我使用 ionic 3 和 SocialSharing 插件,使用时效果很好:

socialSharing.shareViaWhatsApp

whats(){

    //this.socialSharing.shareViaWhatsApp("I needed a "+this.message,null,null)
this.socialSharing.shareViaWhatsApp("اI NEED "+this.message, null, null)
.then(() => console.log('ok'))
.catch(() => console.log('not ok'));


    }

但应用程序崩溃并在使用中关闭:

shareViaWhatsAppToReceiver

    whats(){
    //this.socialSharing.shareViaSMS("I needed a "+this.message,"+249922222343")
this.socialSharing.shareViaWhatsAppToReceiver("00249922222343", "I needed a "+this.message, null, null)
    .then(() => console.log('ok'))
.catch(() => console.log('not ok'));

}

离子信息:

$ 离子信息

cli 包:(C:\Users\abdo\AppData\Roaming\npm\node_modules) @ionic/cli-utils:1.19.1 离子(离子 CLI):3.19.1 全局包: 科尔多瓦(科尔多瓦 CLI):7.1.0 本地包: @ionic/app-scripts:3.1.8 Cordova 平台:安卓 6.3.0 离子框架:离子角 3.9.2 系统: 节点:v8.9.3 npm:5.5.1 操作系统:Windows 7

请帮帮我

【问题讨论】:

    标签: javascript angular cordova ionic-framework ionic3


    【解决方案1】:

    国家/地区键必须在那里。 00 不起作用,它必须是 + 号,后跟国家/地区键,然后是数字,即 +310433885282。 00310433885282 不起作用。请注意,在 Android 上,您只能将“文本”和“网址”直接发送给某人,因此文件会被忽略。

    通过电话号码(自 5.3.0 起)

    <button onclick="window.plugins.socialsharing.shareViaWhatsAppToPhone('+31611111111', 'Message via WhatsApp', null /* img */, null /* url */, function() {console.log('share ok')})">msg via WhatsApp to phone number +31611111111</button>
    

    通过 abid (iOS) 或电话号码 (Android)

    <button onclick="window.plugins.socialsharing.shareViaWhatsAppToReceiver('101', 'Message via WhatsApp', null /* img */, null /* url */, function() {console.log('share ok')})">msg via WhatsApp for Addressbook ID 101</button>
    

    【讨论】:

      猜你喜欢
      • 2018-10-29
      • 2018-04-05
      • 1970-01-01
      • 2017-12-06
      • 1970-01-01
      • 1970-01-01
      • 2018-04-03
      • 2014-03-15
      • 1970-01-01
      相关资源
      最近更新 更多