适用于Android的Nexmo验证SDK

时间:2017-01-19 16:36:52

标签: android sms nexmo sms-verification

我使用Nexmo Verify SDK验证用户的电话号码。我能够将引脚连接到给定的电话号码,但是当我输入正确的密码并调用checkPinCode方法时,我会收到INVALID_CREDENTIALS错误。这是实施。

//This is how i collected the phone number 
final String phone = phoneNumber.getText().toString();
verifyClient.getVerifiedUser("LK",phone );
//This is how i collected the pin number
final String pin = pinNumberEditText.getText().toString();
verifyClient.checkPinCode(pin);
verifyClient.addVerifyListener(new VerifyClientListener() {
        @Override
        public void onVerifyInProgress(VerifyClient verifyClient, UserObject user) {
            Toast.makeText(MainActivity.this, "Verifying", Toast.LENGTH_LONG).show();
        }

        @Override
        public void onUserVerified(VerifyClient verifyClient, UserObject user) {
            Toast.makeText(MainActivity.this, "Successfully Verified", Toast.LENGTH_LONG).show();
        }

        @Override
        public void onError(VerifyClient verifyClient, com.nexmo.sdk.verify.event.VerifyError errorCode, UserObject user) {
            Toast.makeText(MainActivity.this, "Error"+errorCode+user.getPhoneNumber(), Toast.LENGTH_LONG).show();
        }

        @Override
        public void onException(IOException exception) {
            Toast.makeText(MainActivity.this, "Exception", Toast.LENGTH_LONG).show();
        }
    });

非常感谢。 提前致谢

0 个答案:

没有答案