Skip to content
A module for appcelerator that allows two iOS devices to communicate bidirectionally over bluetooth.
Objective-C Python C JavaScript
Latest commit e74e3a8 Jan 14, 2011 @smontgomerie No commit message
Failed to load latest commit information.


Appcelerator Bluetooth Module

A module for appcelerator that allows two iOS devices to communicate bidirectionally over bluetooth.


First download the code: git clone cd Appcelerator-iPhone-Bluetooth-Module

Then build the code. ./

If you get an error, it's likely that the Titanium SDK is wrong. Modify the “titanium.xconfig” file:

TITANIUM_SDK_VERSION = 1.4.0 (or whatever version of the mobile SDK you're using).

This directory should be present: TITANIUM_SDK = ${HOME}/Library/Application Support/Titanium/mobilesdk/osx/$(TITANIUM_SDK_VERSION)

If not, modify it to the installation of your Titanium Mobile SDK.

Next, install the calendar into your app. cp ~/Library/Application\ Support/Titanium/

Finally, in your app's tiapp.xml file: <modules>

	  <module version="xxx">com.smontgomerie.bluetooth</module>

Make sure to change the “xxx” to the version of the module that's been compiled.

You'll need to at least touch your iPhone app before including it (assuming you're building with Xcode, not Titanium).

Basic Usage

First, we'll need to add the Framework in Xcode. Select Frame-works in your project folder, right click “Add -> Existing Frameworks” and select the menu item. *Add GameKit.framework*

Next, we'll want to require this module in our Appcelerator Javascript code:

var bluetooth = require(“com.smontgomerie.bluetooth”);“module is => ” + bluetooth);

Next, some example code to start connecting:

// Create a button called connectBtn

connectBtn.addEventListener(“click”, function() { bluetooth.startPicker(); });

Do something useful when another user connects:

bluetooth.addEventListener(“didConnect”, function(e) { var peerID = e.peerID; });

Now, send some data to our peer: // Create a button called “sendBtn” sendBtn.addEventListener(“click”, function() { bluetooth.send({ data: “Hi” }); });

And do something when we receive data:

bluetooth.addEventListener(“receive”, function(e) {;; });

That's pretty much it! Any edits/improvements are appreciated.


  • Support multiplayer

  • Support voice chat

  • Support more events, such as the client will disconnect

  • Right now the module connects where both clients can be servers. Allow the user to choose a server or client mode.

  • Allow a custom peer picker UI. Apple's Gamekit PeerPicker UI sucks.

Something went wrong with that request. Please try again.