cordova-plugin-sms-retriever
Advanced tools
Comparing version 2.0.1 to 3.0.0
{ | ||
"name": "cordova-plugin-sms-retriever", | ||
"version": "2.0.1", | ||
"version": "3.0.0", | ||
"description": "Cordova plugin to retrieve SMS in Android using the SMS Retriever API.", | ||
@@ -5,0 +5,0 @@ "cordova": { |
@@ -1,2 +0,2 @@ | ||
![License](https://img.shields.io/badge/license-MIT-orange.svg) ![Platform](https://img.shields.io/badge/platform-android-green.svg) [![Donate](https://img.shields.io/badge/donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=G33QACCVKYD7U) | ||
![npm](https://img.shields.io/npm/dt/cordova-plugin-sms-retriever) ![npm](https://img.shields.io/npm/v/cordova-plugin-sms-retriever) ![GitHub package.json version](https://img.shields.io/github/package-json/v/andreszs/cordova-plugin-sms-retriever?color=FF6D00&label=master&logo=github) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/andreszs/cordova-plugin-sms-retriever) ![GitHub top language](https://img.shields.io/github/languages/top/andreszs/cordova-plugin-sms-retriever) ![GitHub](https://img.shields.io/github/license/andreszs/cordova-plugin-sms-retriever) ![GitHub last commit](https://img.shields.io/github/last-commit/andreszs/cordova-plugin-sms-retriever) | ||
@@ -21,7 +21,46 @@ # cordova-plugin-sms-retriever | ||
## Ionic | ||
### Dev version: | ||
```bash | ||
npm i awesome-cordova-plugins-sms-retriever-api | ||
``` | ||
### Prod version: https://github.com/danielsogl/awesome-cordova-plugins/pull/4528 | ||
```bash | ||
npm i @awesome-cordova-plugins/sms-retriever-api | ||
``` | ||
## Ionic Demo | ||
https://github.com/MaximBelov/cordova-plugin-sms-retriever-lab | ||
# Methods | ||
## getPhoneNumber | ||
Opens a dialog to select your mobile numbers saved in phone and [returns selected phone number](https://developers.google.com/identity/sms-retriever/request#1_obtain_the_users_phone_number). | ||
```javascript | ||
var onSuccess = function (strSuccess) { | ||
console.log(strSuccess); | ||
}; | ||
var onFail = function (strError) { | ||
console.log(strError); | ||
}; | ||
cordova.plugins.SMSRetriever.getPhoneNumber(onSuccess, onFail); | ||
``` | ||
## startWatch | ||
Start listening for a single incoming [verification SMS](https://developers.google.com/identity/sms-retriever/verify#1_construct_a_verification_message "verification SMS") for 5 minutes. | ||
```javascript | ||
cordova.plugins.SMSRetriever.startWatch(successCallback, errorCallback); | ||
``` | ||
:warning: Method moved from **window** to **cordova.plugins** object in version 2.0.0 | ||
@@ -52,2 +91,21 @@ | ||
## stopWatch | ||
Stops listening for a single incoming verification SMS | ||
### Return values | ||
- **SMS_RETRIEVER_DONE** | ||
### Example | ||
```javascript | ||
var onSuccess = function (strSuccess) { | ||
console.log(strSuccess); | ||
}; | ||
var onFail = function (strError) { | ||
console.log(strError); | ||
}; | ||
cordova.plugins.SMSRetriever.stopWatch(onSuccess, onFail); | ||
``` | ||
## getHashString | ||
@@ -57,4 +115,10 @@ | ||
```javascript | ||
cordova.plugins.SMSRetriever.getHashString(successCallback, errorCallback); | ||
``` | ||
:warning: Method moved from **window** to **cordova.plugins** object in version 2.0.0 | ||
### Remarks | ||
@@ -119,3 +183,3 @@ | ||
- Starting from **plugin 2.0.0**, the <#> prefix is no longer required by the plugin. | ||
- Starting from an unknown **Play Services** version, the <#> is no longer required. | ||
- Starting from an unknown **Play Services** version, the <#> is no longer required in the received SMS. | ||
@@ -130,5 +194,6 @@ 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: | ||
You can download the [SMS Retriever plugin demo app](https://www.andreszsogon.com/cordova-sms-retriever-plugin-demo-app/) from the Play Store; its source code is provided in the **demo** folder. | ||
- [Compiled APK and reference](https://www.andreszsogon.com/cordova-sms-retriever-plugin-demo-app/) including testing procedure instructions | ||
- [Source code for www folder](https://github.com/andreszs/cordova-plugin-demos) | ||
[![](https://github.com/andreszs/cordova-plugin-demos/blob/main/com.andreszs.smsretriever.demo/screenshots/sms_retriever_demo_3.png?raw=true)](https://www.andreszsogon.com/cordova-sms-retriever-plugin-demo-app/) [![](https://github.com/andreszs/cordova-plugin-demos/blob/main/com.andreszs.smsretriever.demo/screenshots/sms_retriever_demo_4.png?raw=true)](https://www.andreszsogon.com/cordova-sms-retriever-plugin-demo-app/) | ||
<img src="https://github.com/andreszs/cordova-plugin-demos/blob/main/com.andreszs.smsretriever.demo/screenshots/sms_retriever_demo_2.png?raw=true" width="240" /> <img src="https://github.com/andreszs/cordova-plugin-demos/blob/main/com.andreszs.smsretriever.demo/screenshots/sms_retriever_demo_3.png?raw=true" width="240" /> <img src="https://github.com/andreszs/cordova-plugin-demos/blob/main/com.andreszs.smsretriever.demo/screenshots/sms_retriever_demo_4.png?raw=true" width="240" /> | ||
@@ -163,2 +228,7 @@ # FAQ | ||
### 3.0.0 | ||
- Added method stopWatch | ||
- Added method getPhoneNumber | ||
### 2.0.1 | ||
@@ -165,0 +235,0 @@ |
@@ -17,7 +17,13 @@ var exec = require('cordova/exec'); | ||
}, | ||
stopWatch: function (successCallback, failureCallback) { | ||
exec(successCallback, failureCallback, 'SMSRetriever', 'stopWatch', []); | ||
}, | ||
getHashString: function (successCallback, failureCallback) { | ||
exec(successCallback, failureCallback, 'SMSRetriever', 'getHashString', []); | ||
} | ||
}, | ||
getPhoneNumber: function (successCallback, failureCallback) { | ||
exec(successCallback, failureCallback, 'SMSRetriever', 'getPhoneNumber', []); | ||
}, | ||
}; | ||
module.exports = smsRetriever; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
33601
10
391
238
0