我正在尝试获取报告天气接收器是否收到短信?我可以发送短信,但 Twilio 没有回拨我指定的 URL 以下是我的代码片段:-
// Create a rest client
TwilioRestClient client = new TwilioRestClient(com.main.Constants.ACCOUNT_SID, com.main.Constants.AUTH_TOKEN);
// Get the main account (The one we used to authenticate the client
Account mainAccount = client.getAccount();
// Get all accounts including sub accounts
AccountList accountList = client.getAccounts();
// Send an sms
SmsFactory smsFactory = mainAccount.getSmsFactory();
Map<String, String> smsParams = new HashMap<String, String>();
smsParams.put("To", number); // Replace with a valid phone
// number in your account
smsParams.put("From", com.main.Constants.FROM); // Replace with a valid
smsParams.put("StatusCallback", com.main.Constants.CALLBACKURL);
smsParams.put("Body", "Token : " + token);
sms = smsFactory.create(smsParams);