Twilio SMS Messaging — Axway Titanium Cross-Platform Library

Adam Armstrong
Jul 26, 2017 · 2 min read

I have integrated Twilio SMS Messaging for various clients over the past few years and decided it was time to wrap this up into my own library to ease portability.

For this library — I took a very simplistic approach. Just added SMS Messaging and no SDK’s or additional libraries; just a basic common.js module.


Setup Twilio Account and API Key

  1. Create a free Twilio Account at https://www.twilio.com/

Make note of your API Secret. After you complete the setup the API Key can no longer be retrieved.


Download Library

Copy the /lib/ti.twilio.js file into your Axway Titanium Project under /app/lib/

https://github.com/adamtarmstrong/ti.twilio


Add Module and Initialize

  • AccountSID, APISID, & APISecret = All {strings} from your Twilio Account

NOTE: FROM_PhoneNumber passed in must match the API Key Environment (more details in github repo)

var twilioClient = require('ti.twilio');
twilioClient.init('AccountSID', 'APISID', 'APISecret', 'FROM_PhoneNumber', timeout);

Send SMS Message

  • Message = {string} message to send to user
twilioClient.sendSMS(Message, TO_PhoneNumber, successCallback, failureCallback);

That’s it!


This is just a basic SMS Message and I plan to expand the methods over time. Code contributions are greatly appreciated!

Adam T Armstrong

Mobile Developer and IT Manager

Adam Armstrong

Written by

Web Designer, Mobile App Developer, IT Manager & Fitness Guru

Adam T Armstrong

Mobile Developer and IT Manager

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade