js in sms - js.everywhere(2013)
TRANSCRIPT
![Page 1: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/1.jpg)
JS in SMSAlexandre Morgaut & Greg McCarvellJS.everywhere(2013) - Treasure Island, SF
![Page 2: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/2.jpg)
AgendaWhy care about SMS?
Links and Forms
HTML5
Apache Cordova
The Cloud / The Server
![Page 3: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/3.jpg)
Why care about SMS?
![Page 4: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/4.jpg)
Dead Zones
Many Dead Zones: subway, rural communities...
Wifi / 4G / 3G / Edge / GPRS are not always available
SMS are available almost everywhere
![Page 5: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/5.jpg)
Foreign Countries
Data Roaming is very expensive
SMS are usually affordable
SMS are usually supported everywhere
![Page 6: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/6.jpg)
User Friendly
Phones create notifications for SMS
Notifications are often not as detailed for mails
No mail account to configure
![Page 7: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/7.jpg)
SMS in Links (and Forms?)
![Page 8: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/8.jpg)
RFC 5724
URI Scheme for Global System for Mobile Communications (GSM)Short Message Service (SMS)
sms:+33123456789,+33678901234?body=Hello%20World
http://tools.ietf.org/html/rfc5724
![Page 9: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/9.jpg)
HTML Form
<form method="GET" action="http://example.com/">
<label for="body">Write your Message</label>
<textarea name="body">Hello</textarea>
<input type="submit" value="Send">
<form>
http://example.com/?body=Hello
![Page 10: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/10.jpg)
HTML Form
<form method="GET" action="sms:+12345678901">
<label for="body">Write your Message</label>
<textarea name="body"></textarea>
<input type="submit" value="Send">
<form>Don’t work :-(
sms:+12345678901?body=Hello
![Page 11: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/11.jpg)
iOS
sms:+33123456789,+33678901234;body=Hello%20World
![Page 12: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/12.jpg)
Link<a href="sms:+15552345678">Phone only</a>
<a href="sms:?body=Hello, world">Body only</a>
<a href="sms:;body=Hello, world">;body only</a>
<a href="sms:+15552345678?body=Hello World">Phone and ?body</a>
<a href="sms:+15552345678;body=Hello World">Phone and ;body</a>
<a href="sms://+15552345678">Phone only (sms://)</a>
<a href="sms://+15552345678?body=Hello, World">Phone and body (sms://)</a>
http://bradorego.com/test/sms.html
![Page 13: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/13.jpg)
alternative schemes
“smsto:”
![Page 14: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/14.jpg)
SMS in HTML5
![Page 15: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/15.jpg)
Mozilla WebSMS
// There are several ways to retrieve a valid phone number var message = "Hi!";var number = "1234";
navigator.mozMobileMessage.send(number, message);
https://developer.mozilla.org/en-US/docs/WebAPI/WebSMS
![Page 16: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/16.jpg)
“The Messaging API”
navigator.device.sendMessage( "sms:+460000000001?body=Welcome%20%to%Atlantis", null, successCB, errorCB );
navigator.device.sendMessage( "mms:+460000000001?body=Welcome%20%to%Atlantis", [image1, image2], successCB, errorCB );
http://www.w3.org/TR/messaging-api/
Device APIs W3C Working Group
![Page 17: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/17.jpg)
“Messaging API”
navigator.messaging.sms.send( '+1234567890', 'How are you?').done( function(message) { window.console.log( 'Message with identifier ' + message.messageID + ' sent at ' + message.timestamp ); }, function(error) { window.console.error('Error: ' + error); } )
http://www.w3.org/TR/messaging/
System Application W3C Working Group
![Page 18: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/18.jpg)
Contacts
Device APIs
Pick Contact Intent
System Application
Contact Manager API
http://www.w3.org/TR/contacts-manager-api/http://www.w3.org/TR/contacts-api/
![Page 19: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/19.jpg)
Apache Cordova
![Page 20: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/20.jpg)
Cordova Plugins
https://github.com/phonegap/phonegap-plugins
iOS
PhoneGap SMSComposer
Androïd
SMS inbox_sent access
SMSPlugin
SMSSendPlugin
ContactView
![Page 21: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/21.jpg)
The Cloud / The Server
![Page 22: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/22.jpg)
Cloud Communication
Twilio
Nexmo
Tropo
...
![Page 23: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/23.jpg)
Cloud CommunicationTwilio
SMS, MMS, Voice
REST API
twilio.js
node.js SSJS connector
wakanda SMS connector
https://www.twilio.com
![Page 24: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/24.jpg)
wakanda-twilio
Demo
https://github.com/AMorgaut/wakanda-twilio
![Page 25: JS in SMS - JS.everywhere(2013)](https://reader034.vdocuments.net/reader034/viewer/2022042607/554bafe3b4c905ae618b5820/html5/thumbnails/25.jpg)
Thank You!
https://github.com/amorgaut
http://www.twilio.com/
http://www.wakanda.org/
https://github.com/mccarvell