SMSLib allows you to define groups of recipients, all grouped under a common name and use that name as the recipient of a message. SMSLib will expand the message and will send it to all recipients of the group.
In order to use groups, you have to:
In order to define a group, you use the Service.createGroup()
method, i.e.
Service.getInstance().createGroup("MyParents");
This command will create and register the group "MyParents". However, this is an empty group and you must assign destinations. You will use the Service.addToGroup()
method:
Service.getInstance().addToGroup("MyParents", "301122334455")
Service.getInstance().addToGroup("MyParents", "301223344556")
Now you have a group with contains two numbers. If you try to send a message via SMSLib with a recipient of "MyParents", SMSLib will actually send two messages to both of the above mentioned group numbers.
Note that:
SMSLib currently provides a couple of basic group management methods, all located under the main Service class. Have a look at the createGroup()
, removeGroup()
, addToGroup()
and removeFromGroup()
methods for further information.