Ionic 我的应用程序崩溃时使用socialSharing插件在离子3

e0bqpujr  于 2023-03-27  发布在  Ionic
关注(0)|答案(2)|浏览(147)

我使用离子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全局包: cordova ( cordova CLI):7.1.0本地包:@离子/应用程序脚本:3.1.8 Cordova平台:android 6.3.0 Ionic Framework:离子角3.9.2系统:节点:v8.9.3 npm:操作系统:Windows 7

请帮帮我

qqrboqgw

qqrboqgw1#

国家密钥必须在那里。00将不起作用,它必须是+符号,然后是国家密钥,然后是数字,即+310433885282。00310433885282将不起作用。请注意,在Android上,您只能直接向某人发送'text'和'url',因此文件将被忽略。

通过电话号码(自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>
kqlmhetl

kqlmhetl2#

请使用

cordova-plugin-x-socialsharing-android12

插件,你得到的解决方案

相关问题