use of net.iGap.observers.interfaces.OnUserVerification in project iGap-Android by KianIranian-STDG.
the class RegisterRepository method userVerify.
public void userVerify(@NotNull String verificationCode, RepositoryCallbackWithError<ErrorWithWaitTime> callback) {
try {
ProtoUserVerify.UserVerify.Builder userVerify = ProtoUserVerify.UserVerify.newBuilder();
userVerify.setCode(Integer.parseInt(verificationCode.replaceAll("[^0-9]", "").replaceAll("[\u0000-\u001f]", "")));
if (userName != null)
userVerify.setUsername(userName);
RequestWrapper requestWrapper = new RequestWrapper(101, userVerify, new OnUserVerification() {
@Override
public void onUserVerify(String tokenR, boolean newUserR) {
newUser = newUserR;
token = tokenR;
userLogin(token);
}
@Override
public void onUserVerifyError(int majorCode, int minorCode, int time) {
callback.onError(new ErrorWithWaitTime(majorCode, minorCode, time));
}
});
RequestQueue.sendRequest(requestWrapper);
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
Aggregations