cordova-plugin-sms-retriever
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -40,3 +40,3 @@ // For an introduction to the Blank template, see the following documentation: | ||
document.getElementById('status').innerHTML = 'App hash for incoming SMS: ' + hash; | ||
document.getElementById('txtSample').innerHTML = '<#> ABC123 is your verification code for ExampleApp. ' + hash; | ||
document.getElementById('txtMessage').innerHTML = '<#> ABC123 is your verification code for ExampleApp. ' + hash; | ||
}, function(err) { | ||
@@ -43,0 +43,0 @@ document.getElementById('status').innerHTML = 'Plugin error: ' + err; |
{ | ||
"name": "cordova-plugin-sms-retriever", | ||
"version": "1.0.3", | ||
"description": "Cordova plugin to retrieve SMS in Android using the SMS Retriever API.", | ||
"version": "1.0.4", | ||
"description": "Cordova plugin to retrieve SMS in Android", | ||
"cordova": { | ||
@@ -6,0 +6,0 @@ "id": "cordova-plugin-sms-retriever", |
@@ -80,6 +80,6 @@ | License | Platform | Contribute | | ||
- Be no longer than 140 bytes | ||
- Begin with the prefix <#> | ||
- Contain a one-time code that the client sends back to your server to complete the verification flow | ||
- End with an 11-character hash string that identifies your app | ||
Be no longer than 140 bytes | ||
Begin with the prefix <#> | ||
Contain a one-time code that the client sends back to your server to complete the verification flow | ||
End with an 11-character hash string that identifies your app | ||
@@ -104,5 +104,5 @@ Otherwise, the contents of the verification message can be whatever you choose. It is helpful to create a message from which you can easily extract the one-time code later on. For example, a valid verification message might look like the following: | ||
![ScreenShot](demo/images/Screenshot1.png) | ||
![ScreenShot](demo/www/images/Screenshot1.png) | ||
![ScreenShot](demo/images/Screenshot2.png) | ||
![ScreenShot](demo/www/images/Screenshot2.png) | ||
@@ -142,5 +142,5 @@ ## About this Plugin | ||
[![Donate](demo/images/PayPal-Donate-Button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=G33QACCVKYD7U) | ||
[![Donate](demo/www/images/PayPal-Donate-Button.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=G33QACCVKYD7U) | ||
For support, you may post in the **GitHub Issues** section. Before reporting that *X does not work*, please compare the plugin behavior across different devices and emulators in order to locate the exact source of the problem. | ||
For support, you may post in the **Issues** section. Be aware that I don't have much time for dealing with Java and the Android APIs, so before you start complaining that *X does not work*, make sure to compare the plugin behavior across different devices and emulators in order to locate the exact source of the problem. | ||
@@ -147,0 +147,0 @@ ## How to post Issues |
@@ -1,11 +0,34 @@ | ||
var smsExport = {}; | ||
cordova.define("cordova-plugin-sms-retriever.SMSRetriever", function(require, exports, module) { | ||
var smsRetriever = {}; | ||
smsExport.startWatch = function(successCallback, failureCallback) { | ||
cordova.exec( successCallback, failureCallback, 'SMSRetriever', 'startWatch', [] ); | ||
/* Start the SMS Retriever API and listen for incoming SMS + trigger onSMSArrive event when valid SMS arrives */ | ||
smsRetriever.startWatch = function(successCallback, failureCallback) { | ||
cordova.exec( onSuccessCallback, failureCallback, 'SMSRetriever', 'startWatch', [] ); | ||
function onSuccessCallback(msg) { | ||
var action = msg.substr(0, 3); | ||
if (action === '<#>') { | ||
// This is an incoming SMS event | ||
smsRetriever.fireOnSmsArrive(msg); | ||
successCallback("SMS arrived; Watching stopped"); | ||
} else { | ||
// This is the result of the regular startWatch method | ||
successCallback(msg); | ||
} | ||
} | ||
}; | ||
smsExport.stopWatch = function(successCallback, failureCallback) { | ||
cordova.exec( successCallback, failureCallback, 'SMSRetriever', 'stopWatch', [] ); | ||
/* Get the SMS Retriever API app's hash string */ | ||
smsRetriever.getHashString = function(successCallback, failureCallback) { | ||
cordova.exec( successCallback, failureCallback, 'SMSRetriever', 'getHashString', [] ); | ||
}; | ||
module.exports = smsExport; | ||
/* Event to retrieve the incoming validation SMS content */ | ||
smsRetriever.fireOnSmsArrive = function (message) { | ||
cordova.fireDocumentEvent('onSMSArrive', { | ||
'message': message | ||
}); | ||
}; | ||
module.exports = smsRetriever; | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
222708
408
14