Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevinresol/react-native-sinch-verification
https://github.com/kevinresol/react-native-sinch-verification
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kevinresol/react-native-sinch-verification
- Owner: kevinresol
- License: mit
- Created: 2016-02-17T07:08:35.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-09T06:36:43.000Z (almost 9 years ago)
- Last Synced: 2024-04-23T09:31:31.257Z (8 months ago)
- Language: Objective-C
- Size: 3.19 MB
- Stars: 16
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-react-native - react-native-sinch-verification ★14 - Sinch verification for react native (Components / Integrations)
- awesome-react-native - react-native-sinch-verification ★14 - Sinch verification for react native (Components / Integrations)
- awesome-react-native - react-native-sinch-verification ★14 - Sinch verification for react native (Components / Integrations)
- awesome-react-native-ui - react-native-sinch-verification ★6 - Sinch verification for react native (Components / Integrations)
- awesome-react-native - react-native-sinch-verification ★14 - Sinch verification for react native (Components / Integrations)
README
## react-native-sinch-verification
Sinch Verification for react native. http://www.sinch.com
### Installation
#### IOS
1. `npm install react-native-sinch-verification`
2. In the XCode's "Project navigator", right click on project name folder ➜ `Add Files to <...>`
- Ensure `Copy items if needed` and `Create groups` are checked
3. Go to `node_modules` ➜ `react-native-sinch-verification` ➜ add `SinchVerificationIOS` folder
4. Add the dependency frameworks as described [here](https://www.sinch.com/docs/verification/ios#addthesinchverificationframework) (The `SinchVerication.framework` can be found in this package, under the `SinchVericationSDK` folder)#### Android
1. `npm install react-native-sinch-verification`
2. `rnpm link react-native-sinch-verification` - (run `npm install -g rnpm` if required)
3. require the permissions as specified [here](https://www.sinch.com/docs/verification/android/#permissions)### Usage
```javascript
var SinchVerification = require('react-native-sinch-verification');
var custom = "A custom string to be sent to your server backend, through Sinch's callback URL";// init with app key
SinchVerification.init('your-app-key');// sms verification
SinchVerification.sms('your-phone-number-without-country-code', custom, (err, res) => {
if (!err) {
// for android, verification is done, because the sms has been read automatically
// for ios, this means the sms has been sent out, you need to call verify with the received code
}
});// verify the received code (not needed on android)
SinchVerification.verify('the-received-code', (err, res) => {
if (!err) {
// done!
}
});// flash call verification (android only)
SinchVerification.flashCall('your-phone-number-without-country-code', custom, (err, res) => {
if (!err) {
// done!
}
});```