Skip to content

mitaketw/sms-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sms-java

Build Status Maven Central

Mitake SMS library for Java

PLEASE UPDATE TO 0.4.0+

Dependency

Maven

<dependency>
  <groupId>tw.com.mitake</groupId>
  <artifactId>lib-sms</artifactId>
  <version>0.7.0</version>
</dependency>

Gradle

compile 'tw.com.mitake:lib-sms:0.7.0'

How to use

AT FIRST

MitakeSms.init("username", "password");

Send a sms

MitakeSmsSendResult result = MitakeSms.send("0912345678", "this is a sample message");

Send multi-body sms

List<SendOptions> optsList = new ArrayList<SendOptions>();

SendOptions opts = new SendOptions().addDestination("0912345678").setMessage("this is a sample message");

optsList.add(opts);

opts = new SendOptions().addDestination("0987654321").setMessage("Hello World");

optsList.add(opts);

MitakeSmsSendResult result = MitakeSms.send(optsList);

Query account point

MitakeSmsQueryAccountPointResult result = MitakeSms.queryAccountPoint();

Query message status (support multiple messages)

MitakeSmsQueryMessageStatusResult result = MitakeSms.queryMessageStatus("messageid1", "messageid2");

// or

MitakeSmsQueryMessageStatusResult result = MitakeSms.queryMessageStatus(List<String> messageIds);