js in sms - js.everywhere(2013)

25
JS in SMS Alexandre Morgaut & Greg McCarvell JS.everywhere(2013) - Treasure Island, SF

Upload: alexandre-morgaut

Post on 08-May-2015

2.990 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: JS in SMS - JS.everywhere(2013)

JS in SMSAlexandre Morgaut & Greg McCarvellJS.everywhere(2013) - Treasure Island, SF

Page 2: JS in SMS - JS.everywhere(2013)

AgendaWhy care about SMS?

Links and Forms

HTML5

Apache Cordova

The Cloud / The Server

Page 3: JS in SMS - JS.everywhere(2013)

Why care about SMS?

Page 4: JS in SMS - JS.everywhere(2013)

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)

Foreign Countries

Data Roaming is very expensive

SMS are usually affordable

SMS are usually supported everywhere

Page 6: JS in SMS - JS.everywhere(2013)

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)

SMS in Links (and Forms?)

Page 8: JS in SMS - JS.everywhere(2013)

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)

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)

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)

iOS

sms:+33123456789,+33678901234;body=Hello%20World

Page 12: JS in SMS - JS.everywhere(2013)

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)

alternative schemes

“smsto:”

Page 14: JS in SMS - JS.everywhere(2013)

SMS in HTML5

Page 15: JS in SMS - JS.everywhere(2013)

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)

“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)

“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)

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)

Apache Cordova

Page 20: JS in SMS - JS.everywhere(2013)

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)

The Cloud / The Server

Page 22: JS in SMS - JS.everywhere(2013)

Cloud Communication

Twilio

Nexmo

Tropo

...

Page 23: JS in SMS - JS.everywhere(2013)

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)

wakanda-twilio

Demo

https://github.com/AMorgaut/wakanda-twilio