![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
cordova-plugin-sms-receive
Advanced tools
Cordova plugin to get received SMS contents in Android platform.
Add the plugin from NPM:
cordova plugin add cordova-plugin-sms-receive
Start listening for incoming SMS messages. This will request SMS permission to the user if not yet granted.
:warning: Method moved from window to cordova.plugins object in version 2.0.0
cordova.plugins.SMSReceive.startWatch(function(strSuccess) {
console.log(strSuccess);
}, function(strError) {
console.warn(strError);
});
Stops listening for incoming SMS. Always invoke this method after you have received the required SMS to prevent memory leaks.
cordova.plugins.SMSReceive.stopWatch(function(strSuccess) {
console.log(strSuccess);
}, function(strError) {
console.warn(strError);
});
Triggered when a new SMS has arrived. You need call startWatch first.
:warning: JSON SMS payload moved from message.data to message object in version 2.0.0
document.addEventListener('onSMSArrive', function(message) {
console.log('address:' + message.address);
console.log('body:' + message.body);
console.log('date' + message.date)
});
You can download the compiled SMS Receive plugin demo app and inspect the source code in my plugin demos repository.
This plugin does not send SMS nor intercept incoming SMS: the intercepting feature has been removed in Android 5 or earlier for security concerns, so no plugin can do this anymore.
When the app is sent to the background, as long as Android has not unloaded it to recover memory, SMS watching will remain active and working correctly.
The startWatch method will cause the Android 6.0 and higher permission dialog to show up with this message:
Allow [AppName] to send and view SMS messages?
This message is not exactly accurate, because the plugin only requests permission for receiving SMS as follows:
<uses-permission android:name="android.permission.RECEIVE_SMS" />
This plugin has been successfully tested in devices and emulators ranging from Android 5.1 to Android 10.
If you find any bugs or want to improve the plugin, kindle subtmit a PR and it will be merged as soon as possible.
Even if you don't quite understand Java, you can investigate and locate issues with the plugin code by opening the SMSReceive.java file and browsing StackOverflow or the Android APIs documentation with the proper keywords.
FAQs
Cordova plugin to receive SMS in Android
The npm package cordova-plugin-sms-receive receives a total of 121 weekly downloads. As such, cordova-plugin-sms-receive popularity was classified as not popular.
We found that cordova-plugin-sms-receive demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.