本文整理汇总了Java中cn.bmob.v3.BmobSMS类的典型用法代码示例。如果您正苦于以下问题:Java BmobSMS类的具体用法?Java BmobSMS怎么用?Java BmobSMS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BmobSMS类属于cn.bmob.v3包,在下文中一共展示了BmobSMS类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: userLoginByPhone
import cn.bmob.v3.BmobSMS; //导入依赖的package包/类
@Override public void userLoginByPhone(final String phone) {
if (!KyPattern.checkPhoneNumber(phone)) {
toastUtil.show("请输入正确的手机号码");
return;
}
final Intent intent = new Intent(this, RequestSMSCodeActivity.class);
intent.putExtra("phone", phone);
BmobSMS.requestSMSCode(phone, "生活服务超市模板", new QueryListener<Integer>() {
@Override public void done(Integer smsId, BmobException ex) {
if (ex != null) {
toastUtil.show("出现未知错误,请重启该应用");
KLog.d(ex.getErrorCode() + ":" + ex.getMessage());
return;
}
startActivityForResult(intent, KySet.USER_REQUEST_PHONE_SIGNUP_OR_LOGIN);
}
});
}
示例2: requestCode
import cn.bmob.v3.BmobSMS; //导入依赖的package包/类
public void requestCode() {
String number = _emailText.getText().toString();
if (!TextUtils.isEmpty(number)) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String sendTime = format.format(new Date());
BmobSMS.requestSMSCode(number, "注册模板", new QueryListener<Integer>() {
@Override
public void done(Integer smsId, BmobException ex) {
if (ex == null) {//验证码发送成功
toast("验证码发送成功,短信id:" + smsId);//用于查询本次短信发送详情
} else {
toast("errorCode = " + ex.getErrorCode() + ",errorMsg = " + ex.getLocalizedMessage());
}
}
});
} else {
toast("请输入手机号码");
}
}
示例3: verifySmsCode
import cn.bmob.v3.BmobSMS; //导入依赖的package包/类
private void verifySmsCode() {
String number = _emailText.getText().toString();
String code = _passwordText.getText().toString();
if (!TextUtils.isEmpty(number) && !TextUtils.isEmpty(code)) {
BmobSMS.verifySmsCode(number, code, new UpdateListener() {
@Override
public void done(BmobException ex) {
if (ex == null) {//短信验证码已验证成功
toast("验证通过");
} else {
toast("验证失败:code =" + ex.getErrorCode() + ",msg = " + ex.getLocalizedMessage());
}
}
});
} else {
toast("请输入手机号和验证码");
}
}
示例4: requestCode
import cn.bmob.v3.BmobSMS; //导入依赖的package包/类
private void requestCode() {
phone = etPhone.getText().toString();
if (TextUtils.isEmpty(phone)) {
etPhone.setError("手机号码不能为空");
return;
}
if (!isPhoneNum(phone)) {
etPhone.setError("手机号码格式不正确");
return;
}
MyCounter counter = new MyCounter(60000, 1000);
counter.start();
BmobSMS.requestSMSCode(phone, "辰言", new QueryListener<Integer>() {
@Override
public void done(Integer integer, BmobException e) {
if (e == null) {
showToast("验证码发送成功!");
} else {
if (e.getErrorCode() == 10010) {
showToast("您请求验证码过去频繁,请于1小时候重试");
} else {
showToast("验证码发送失败" + e.getErrorCode() + e.getMessage());
}
}
}
});
}
示例5: requestVerify
import cn.bmob.v3.BmobSMS; //导入依赖的package包/类
public void requestVerify(Context context, String num, String template){
BmobSMS.requestSMSCode(context, num, template, new RequestSMSCodeListener() {
@Override
public void done(Integer integer, BmobException e) {
if (e == null) {
Log.i(TAG, integer.toString());
ExUtils.Toast("发送成功");
} else {
ExUtils.Toast("发送失败");
}
}
});
}
示例6: verify
import cn.bmob.v3.BmobSMS; //导入依赖的package包/类
public void verify(Context context, String num, String smsCode){
BmobSMS.verifySmsCode(context, num, smsCode, new VerifySMSCodeListener() {
@Override
public void done(BmobException e) {
if (e == null) {
mIVerifyListener.onVerifySuccess();
ExUtils.Toast("验证成功");
} else {
ExUtils.Toast("验证失败,请核实验证码或退出重试");
}
}
});
}
示例7: processClick
import cn.bmob.v3.BmobSMS; //导入依赖的package包/类
@Override
public void processClick(View v) {
switch (v.getId()) {
case R.id.btn_getSmsCode:
telNumString = mEdtNum.getText().toString();
isTel = verifyTel(telNumString);
if (!TextUtils.isEmpty(telNumString) && isTel) {
loadSMS();
BmobSMS.requestSMSCode(telNumString, BmobConfig.SMSTEMPLATE, new QueryListener<Integer>() {
@Override
public void done(Integer smsCode, BmobException e) {
if (e == null) {
ToastUtils.showToast(RegisterOrResetActivity.this, "验证码发送完毕");
} else {
ToastUtils.showToast(RegisterOrResetActivity.this, "验证码发送失败:"+e.getMessage());
}
}
});
} else {
ToastUtils.showToast(this, "请正确输入手机号");
}
break;
case R.id.btn:
telNumString = mEdtNum.getText().toString();
smsCodeString = mEdtSmsCode.getText().toString();
passwordString = mEdtPassword.getText().toString();
rePassWordString = mEdtRePassword.getText().toString();
isTel = verifyTel(telNumString); //判断是否为正确的手机号
isTruePassword = verifyTwoPassword(passwordString, rePassWordString);//进行两次输入的密码校验
if (sign == 0) {
registerUser();
} else if (sign == 1) {
resetPassword();
}
break;
}
}