发送和阅读通过本地SMS应用程序cordova发送的短信内容 [英] Send and Read the SMS content sent via native SMS app cordova
问题描述
我正在建立一个离子/ cordova应用程式。从我的应用程序,用户可以点击一个电话号码,以发送短信。当点击该号码时,本地短信应用程序将打开,然后用户可以键入他/她自己的短信并发送短信。有什么办法,从我的应用程序我可以得到短信内容?
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?
提前感谢。
推荐答案
由于您正在使用ionic / cordova,需要一个短信插件来完成这样的工作。
As you are using ionic/cordova, a SMS plugin is required to do such work.
除了jsmobile短信插件外,还有一个有更多API的插件:
http://plugins.cordova.io/#/package/com.rjfun.cordova.sms
Besides jsmobile SMS plugin, there is another one with more APIs: http://plugins.cordova.io/#/package/com.rjfun.cordova.sms
如描述中所述:
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);
活动
'onSMSArrive'
您可以通过以下方式获取SMS内容: / p>
You can get the SMS content in either of the following ways:
- 实施UI,获取用户输入,并调用插件的API发送短信。
或者,
- 让默认短信应用程序发送邮件阅读发件箱中的短信。
BTW,插件仅适用于Android。
BTW, the plugin works for Android only, FYI.
这篇关于发送和阅读通过本地SMS应用程序cordova发送的短信内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!