D/LoggingInterceptor: Request: curl -X POST
-H Accept: application/json
-H Content-Type: application/json
-H User-Agent: LeanCloud SDK v5.0.12
-H X-LC-Id: {your_app_id}
-H X-LC-Prod: 1
-H X-LC-Session: {your_session}
-H X-LC-Key: {your_app_key}
https://aslbdvyx.api.lncld.net/1.1/requestSmsCode
2019-04-09 21:24:15.908 7299-7319/xxxx.xxx.wgmms D/LoggingInterceptor: Response: 400
server: nginx
date: Tue, 09 Apr 2019 13:24:19 GMT
content-type: application/json;charset=utf-8
cache-control: no-cache,no-store
pragma: no-cache
x-request-id: b689dc4c4ec0fd04100378355a5a0d83
x-request-path: lb_218_221, m_6ae3032_8ce70a2c_24522
{"code":1,"error":"smsType is not support"}
App ID:aSLbDVYx2zSGaB0IMxsOA8os-gzGzoHsz
java-sdk-all
private void sendSMS(String phoneNum,String order){
if (phoneNum==null || phoneNum.length()<11){
return;//没有号码不发送
}
AVSMSOption option = new AVSMSOption();
option.setTemplateName("Order_Notice");
option.setSignatureName("wgmms_sms");
Map parameters = new HashMap();
parameters.put("order_id", order); // 使用实际的值来替换模板中的变量
parameters.put("this_time", DateUtil.getStandardTime(new Date()));
option.setEnvMap(parameters);
AVSMS.requestSMSCodeInBackground(phoneNum,option).subscribe(new Observer<AVNull>() {
@Override
public void onSubscribe(Disposable d) { }
@Override
public void onNext(AVNull avNull) { }
@Override
public void onError(Throwable e) { }
@Override
public void onComplete() { }
});
}