---
title: "SMS Service with Firefox OS"
description: "Building an SMS booking service using Firefox OS APIs. Practical notes and code examples on SMS Service with Firefox OS by."
url: "https://h3manth.com/scribe/sms-service-with-firefox-os/"
canonical_url: "https://h3manth.com/scribe/sms-service-with-firefox-os/"
markdown_url: "https://h3manth.com/scribe/blog/sms-service-with-firefox-os.md"
publishDate: "2015-02-21T00:00:00.000Z"
author: "Hemanth HM"
category: "web"
tags: ["javascript","firefoxos"]
word_count: 90
reading_time_minutes: 1
x_markdown_tokens: 265
content_signal: "ai-train=yes, search=yes, ai-input=yes"
---

# SMS Service with Firefox OS

> Building an SMS booking service using Firefox OS APIs. Practical notes and code examples on SMS Service with Firefox OS by.

A course booking SMS service with Firefox OS:

1. Customer sends: `<name> <course_name> <course_time> <tickets>`
2. System replies: `Thank you <name>! Your booking (<tickets> tickets) for <course_name> at <course_time> is confirmed.`

## Implementation

```javascript
navigator.mozMobileMessage.onreceived = (sms) => {
  let cust = sms.message.sender,
      [name, courseName, courseTime, tcktCnt] = sms.message.body.split(' '),
      msg = `Thank you ${name}! Your booking (${tcktCnt} tickets) for ${courseName} at ${courseTime} is confirmed.`;
  
  navigator.mozMobileMessage.send(cust, msg);
};
```

This was built at a hackathon - the easiest way to test is running the official SMS app in debug mode.
