Cognalys:错误551& 550(ANDROID)

时间:2015-03-13 07:33:51

标签: android verification confirmation

获得551&的错误550在此,

这是我的代码:

findViewById(R.id.verifybutton).setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                if (!TextUtils.isEmpty(phoneNumbTv.getText().toString())) {
                    verify();
                }
                else {
                    Toast.makeText(getApplicationContext(), "Please enter your phone number to verify", 3500).show();
                }

            }
        });

private void verify() {
        timerLayout.setVisibility(View.VISIBLE);
        countDownTimer = new CountDownTimer(60000, 1000) {

            @Override
            public void onTick(long millisUntilFinished) {
                timertv.setText("" + millisUntilFinished / 1000);
            }

            @Override
            public void onFinish() {
                timerLayout.setVisibility(View.GONE);
            }

        };
        countDownTimer.start();

        Cognalys.verifyMobileNumber(MainActivity.this, "TOKEN", "ID", phoneNumbTv.getText().toString(), new VerificationListner() {

            @Override
            public void onVerificationStarted() {
                // TODO Auto-generated method stub

            }

            @Override
            public void onVerificationSuccess() {
                countDownTimer.cancel();
                timerLayout.setVisibility(View.GONE);
                Log.d("", "SUCCESS");
                showAlert("Your number has been verified\n\nThanks!!", true);

            }

            @Override
            public void onVerificationFailed(ArrayList<String> errorList) {
                countDownTimer.cancel();
                timerLayout.setVisibility(View.GONE);
                for (String error : errorList) {
                    Log.d("abx", "error............:" + error);
                }
                showAlert("Something went wrong.\n please try again", false);
            }
        });

    }

    private void showAlert(String message, boolean status) {
        final Dialog dialog = new Dialog(MainActivity.this);
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        dialog.setContentView(R.layout.dialog);

        ImageView mImageView = (ImageView) dialog.findViewById(R.id.verify_im);
        TextView messageTv = (TextView) dialog.findViewById(R.id.messagetv);
        if (status) {
            mImageView.setImageResource(R.drawable.blue_tick);
        }
        else {
            mImageView.setImageResource(R.drawable.wrong);
        }

        messageTv.setText(message);
        dialog.show();
    }

注意:在Cognalys网站中注册的应用包名称。

抱歉,我无法添加&#34; Cognalys 标记&#34;因为我没有1500的声誉

由于

0 个答案:

没有答案