No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 5e8a123 Mar 9, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
SinchVerificationIOS Make init() sync by storing application key in js Mar 5, 2016
SinchVerificationSDK/SinchVerification.framework Initial commit Feb 17, 2016
android bugfix Mar 9, 2016
.gitignore Initial commit Feb 17, 2016
LICENSE.md Initial commit Feb 17, 2016
README.md Make init() sync by storing application key in js Mar 5, 2016
index.js bugfix Mar 9, 2016
package.json bugfix Mar 9, 2016

README.md

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
  1. Go to node_modulesreact-native-sinch-verification ➜ add SinchVerificationIOS folder
  2. Add the dependency frameworks as described here (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

Usage

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!
  }
});