
Tim Lytle Manager • over 8 years ago
Android Verify SDK
We've released a beta of our Verify SDK for Android, making it easy to verify a mobile device's phone number from the device itself.
You can grab the beta here: https://github.com/Nexmo/verify-android-sdk
Then post your API key (not the secret) in this thread, and I'll enable the SDK Beta on your account.
Comments are closed.
10 comments
Jorje Barrera • about 8 years ago
Hi Tim,
Here's my API key: c5bc0607
Tim Lytle Manager • about 8 years ago
Send via email.
Athul Jayaram • about 8 years ago
Here is my api key
15fad20d
please enable it asap
Tim Lytle Manager • about 8 years ago
@athuljayaram Sent via email.
Emma T • about 8 years ago
Hello Athul,
the hash that you are talking about seems to be the signature, which is supposed to change for each http request as it is computed based on the parameters.
What is the exact problem when calling checkPinCode? Can you please maybe copy a part of your code and the response you get in logcat? Your request does not seem to reach our endpoint.
Let's figure this out,
Emma
Athul Jayaram • about 8 years ago
try {
NexmoClient nexmoClient = new NexmoClient.NexmoClientBuilder()
.context(getActivity().getApplicationContext())
.applicationId("the key") //your application key
.sharedSecretKey("shared secret") //your application secret
.build();
final VerifyClient verifyClient2 = new VerifyClient(nexmoClient);
EditText phone = (EditText)rootView.findViewById(R.id.editText1);
String number = phone.getText().toString();
verifyClient2.getVerifiedUser("IN", number);
EditText code = (EditText)rootView.findViewById(R.id.editText2);
String pin = code.getText().toString();
verifyClient2.checkPinCode(pin);
------------
Error before even after entering the pin, it won't go to on UserVerified state
Now error is --getToken raw response-- Signature: . Content: {"result_code":14,"result_message":"invalid signature -- the signature supplied did not pass verification","timestamp":"1435661321"}
I have used the right api key and secret key... still it showing error
Emma T • about 8 years ago
Hello,
There seems to be a confusion between applicationId and API key. For instantiating a NexmoClient you need to set applicationId to "2eda009d-71ed-443e-9ac8-53340fa5534" that you received from us, and not the API key. The signature generation is based on the applicationId, therefore it did not pass the verification.
Also, please make sure you set the VerifyClientListener on the verifyClient instance, to get all the events.
Regards,
Emma
Emma T • about 8 years ago
Hello Athul, I can confirm there were no changes at our end.
In the process of calculating the signature , the device timestamp is used and in some of your situations that one is too old. Is there any chance you have changed the device timezone or device time?
I can also see you are using multiple VerifyClient objects in the same app, that is not necessary, as you need to set the VerifyClientListener on the same object that does a verify. You can for example create your VerifyClient in your Application class and just get it from there.
When exactly are you calling checkPinCode method? You need to call it only after you received an SMS/TTS with the code, and from your code snippet it looks like you are executing every call one after another.
Are you trying to call checkPinCode on a button press for instance, or after the code is entered in an EditText?
Cheers
Athul Jayaram • about 8 years ago
Yes the signature issue is fixed :)
there problem with checkPinCode. What i am trying to achieve is to submit pin from a pin textfield when a button is pressed.
How can I do this?
I feel so confused with checkPinCode stuff
Emma T • about 8 years ago
Hello,
We are glad you have sorted this out, can you recall what was the issue? It would be useful for other developers as well.
For the checkPinCode part you can simply set a ClickListener on your button, for example:
Button mSubmitPinButton = (Button) findViewById(R.id.yourButtonId);
EditText mConfirmationCodeEditText = (EditText) findViewById(R.id.yourEditTextId);
mSubmitPinButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// One the user has typed in their verification code and clicked submit then check it
mVerifyClient.checkPinCode(mConfirmationCodeEditText.getText().toString());
}
});
If you need more info about views and click events please read the Android documentation http://developer.android.com/guide/topics/ui/declaring-layout.html
Hope this helps
Emma