发送和阅读,通过原生短信应用科尔多瓦发送的短信内容 [英] Send and Read the SMS content sent via native SMS app cordova

查看:203
本文介绍了发送和阅读,通过原生短信应用科尔多瓦发送的短信内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要建离子/科尔多瓦应用程序。从我的应用程序,用户可以以发送短信点击一个电话号码。当这个数字点击,原生短信应用程序将打开,然后用户可以输入他/她自己的短信和发送短信。有什么办法,从我的应用程序,我可以得到短信内容吗?

在此先感谢。

解决方案

当你使用离子/科尔多瓦,短信插件需要做这样的工作。

此外jsmobile短信插件,还有另外一个具有多个API: http://plugins.cordova.io/#/package/com.rjfun .cordova.sms

正如在描述:

  sendSMS(地址(S),文本,successCallback,failureCallback);
listSMS(过滤器,successCallback,failureCallback);
deleteSMS(过滤器,successCallback,failureCallback);

startWatch(successCallback,failureCallback);
秒表(successCallback,failureCallback);

enableIntercept(ON_OFF,successCallback,failureCallback);
restoreSMS(msg_or_msgs,successCallback,failureCallback);
 

活动

 onSMSArrive
 

您可以得到短信内容中通过以下方式:

  1. 实现UI,让用户的输入,并调用插件的API发送短信。

或者

<醇开始=2>
  • 让默认SMS应用程序发送消息,然后读取从发件箱中的短信。
  • 顺便说一句,该插件适用于Android的唯一的,仅供参考。

    I'm building an ionic/cordova app. From my application, user can click on a phone number in order to send SMS. When click on that number, native SMS app will open and then user can type his/her own SMS and send the SMS. Is there any way, from my app I can get the SMS content?

    Thanks in advance.

    解决方案

    As you are using ionic/cordova, a SMS plugin is required to do such work.

    Besides jsmobile SMS plugin, there is another one with more APIs: http://plugins.cordova.io/#/package/com.rjfun.cordova.sms

    As mentioned in the description:

    sendSMS(address(s), text, successCallback, failureCallback);
    listSMS(filter, successCallback, failureCallback);
    deleteSMS(filter, successCallback, failureCallback);
    
    startWatch(successCallback, failureCallback);
    stopWatch(successCallback, failureCallback);
    
    enableIntercept(on_off, successCallback, failureCallback);
    restoreSMS(msg_or_msgs, successCallback, failureCallback);
    

    Events

    'onSMSArrive'
    

    You can get the SMS content in either of the following ways:

    1. implement the UI, get user's input, and call plugin's API to send the SMS.

    Or,

    1. let the default SMS app send the message, then read the SMS from the sent box.

    BTW, the plugin works for Android only, FYI.

    这篇关于发送和阅读,通过原生短信应用科尔多瓦发送的短信内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆