Virtual SMS
In order to allow FREE testing of our SMS capability we are exposing a 'flight' simulator to mimic the behaviour of our SMS capability. The simulator is known as easySMS and this is how it works. Instead of using the uri tel:4401231588115 as the mobile number to send a text to. You can use easysms:boarding and this will mock out a text message and allow you to test out your BT SDK application and perform all usual operations that the SMS capability offers without affecting your text allowance.
We've used a flight simulator analogy to mock the behaviour of an SMS lifecycle. Once an SMS is sent using the SDK it can have four different behaviours (states) of initial, sent, failed and delivered. These behaviours are now represented by our easySMS flight simulator mock mobile phones;
- easysms:boarding: This mocks the initial SMS state analogous to the initial stage of boarding a plane.
- easysms:enroute: This mocks the sent SMS state, the plane is en-route to its destination.
- easysms:arrived: This mocks the delivered SMS state, the plane has arrived at its destination.
- easysms:crashed: This mocks the failed SMS state - the plane has crashed!
- easysms:delayed: This mocks a timeout behaviour and ultimately a failed SMS state, as if the plane were delayed.
- easysms:terrorist: This mocks a disaster scenario of an invalid URI entry.
Usage example using SMS Messaging (Java)
sendResponse = sendMessage('easysms:arrived', 'me', 'This is a test message');
This will send the text to our mock phone and return you a messageId.
messageStatuses = getMessageDeliveryStatuses('messageId');
This will return you the status 'delivered' as this is the behaviour of the 'easysms:arrived' mobile.
Usage example using Inbound SMS (Java)
If you are signed up for Inbound SMS then you will either already own your own inbound number or be sharing a number and have one or more keywords assigned to your application. In order to test the receiving of inbound messages we can simulate inbound messages for you free of charge, just send us a message using the inbound SMS service.
NOTE: If you share a number the message text must start with your assigned keyword.
sendResponse = sendMessage('easysms:arrived', 'keyword This is a test message');
This time using the Inbound SMS API, and using a mock phone as above, this will send the message to the mock phone then also simulate a response to that message for you, hence you can now test retrieving inbound messages by
messages = getReceivedMessages(keyword);
This will return you the simulated inbound message. You can also clear these messages from store in the usual manner
clearReceivedMessages(messageId);
This now allows full testing for your application.
NOTE: If you own your own number and don't have a keyword, then you can retrive all your messages by not supplying
a keyword on the getReceivedMessages() call. Or you can simply enter in the first word of the message sent and it will
return just the one message.
