NEXMO 发送国际短信,遇到的问题

ps:

1.国内手机号发十条短信,只能收到一条(国外手机号正常)

2.中文乱码,用unicode转码发送

3.发送号码需添加国家编码(如中国86)

代码如下

public static void main(String[] args) {

		try {
			String NEXMO_API_KEY = "f591****";
			String NEXMO_API_SECRET = "ME7pPfBJLv******";
			String TO_NUMBER = "86177********";

			NexmoClient client = new NexmoClient.Builder().apiKey(NEXMO_API_KEY).apiSecret(NEXMO_API_SECRET).build();

					
			TextMessage message = new TextMessage("Acme Inc", TO_NUMBER, "A jinfei code is 4867 ,\u8c22\u8c22\u4f7f\u7528", true);

			SmsSubmissionResponse responses = client.getSmsClient().submitMessage(message);

			for (SmsSubmissionResponseMessage responseMessage : responses.getMessages()) {
			    System.out.println(responseMessage);
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NexmoClientException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}

 

你可能感兴趣的:(JAVA,Nexmo)