/titanium-bluetooth

📡 Native iOS / Android Bluetooth support for the Axway Titanium SDK

Primary LanguageObjective-COtherNOASSERTION

Bluetooth in Appcelerator Titanium

License Support

Summary

Ti.Bluetooth is an open source project to support Bluetooth / BLE in Appcelerator Titanium.

Requirements

  • Titanium SDK 7+ for Android
  • Titanium SDK 8+ for iOS
  • iOS 10.0+ / Android 4.0.0+
  • Xcode 11+

Download + Setup

Download

Setup

Unpack the module and place it inside the modules/ folder of your project. Edit the modules section of your tiapp.xml file to include this module:

<modules>
    <module>ti.bluetooth</module>
</modules>

Add the following to your plist (only neccessary for iOS):

<plist>
    <dict>
        <key>UIBackgroundModes</key>
        <array>
            <string>bluetooth-central</string>
            <string>bluetooth-peripheral</string>
        </array>
        <key>NSBluetoothPeripheralUsageDescription</key>
        <string>Can we connect to Bluetooth devices?</string>
        <!-- since iOS 13 -->
        <key>NSBluetoothAlwaysUsageDescription</key>
        <string>Bluetooth device communication.</string>
    </dict>
</plist>

Features

  • Create central managers, peripheral managers, descriptors, beacons, characteristics, centrals, services and requests
  • Start / Stop peripheral scanning
  • Send data between devices
  • Receive state events

Documentation

An API documentation can be found in the documentation folder.

Example

Please check example/app.js for an example. Use the documentation to see which API-features are available for each platform.

Authors

License

Apache 2.0

Contributing

Code contributions are greatly appreciated, please submit a new pull request!