简体   繁体   English

在ionic 3中使用socialSharing插件时我的应用程序崩溃

[英]my app crash when use socialSharing plugin in ionic 3

i use ionic 3 and SocialSharing plugin it works well when using : 我使用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'));


    }

but app crash and close in use : 但应用程序崩溃并关闭了使用状态:

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'));

} }

ionic info : 离子信息:

$ ionic info $离子信息

cli packages: (C:\\Users\\abdo\\AppData\\Roaming\\npm\\node_modules) @ionic/cli-utils : 1.19.1 ionic (Ionic CLI) : 3.19.1 global packages: cordova (Cordova CLI) : 7.1.0 local packages: @ionic/app-scripts : 3.1.8 Cordova Platforms : android 6.3.0 Ionic Framework : ionic-angular 3.9.2 System: Node : v8.9.3 npm : 5.5.1 OS : Windows 7 cli软件包:(C:\\ Users \\ abdo \\ AppData \\ Roaming \\ npm \\ node_modules)@ ionic / cli-utils:1.19.1 ionic(Ionic CLI):3.19.1全局软件包:cordova(Cordova CLI):7.1.0本地软件包:@ ionic / app-scripts:3.1.8 Cordova平台:android 6.3.0 Ionic Framework:ionic-angular 3.9.2系统:节点:v8.9.3 npm:5.5.1 OS:Windows 7

Please help me 请帮我

the country key must be there. 国家/地区密钥必须在此处。 00 will not work, it must be + sign followed by the country key then the number ie +310433885282. 00将不起作用,它必须是+号,然后是国家/地区代码,再加上数字,即+310433885282。 00310433885282 won't work. 00310433885282无法正常工作。 Note that on Android you can only send a 'text' and 'url' directly to someone, so files are ignored. 请注意,在Android上,您只能直接向某人发送“文本”和“ URL”,因此文件将被忽略。

By phone number (since 5.3.0) 通过电话号码(从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>

By abid (iOS) or phone number (Android) 按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>

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

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