The official ToggleHQ Appcelerator Titanium Plugin
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

ToggleHQ Appcelerator Titanium Plugin


The ToggleHQ Appcelerator Titanium Plugin requires iOS 8.0+


To install it, simply add the following line to your app.js file:


Create your application by visiting and either registering or logging into an existing account. Once you're in head to App Settings > API Access and grab your Mobile OAuth Credentials. You'll use those to install ToggleHQ.

// app.js


  client_id: "your-mobile-oauth-client-id",
  secret: "your-mobile-oauth-secret"

Basic Usage

Using these implementation methods are the quickest and fastest way to get ToggleHQ installed and running in your app.

On Login/Signup Assign This Device to a User

THQ.assignDeviceToUser("user_identifier", successCallback, failureCallback);

On Logout Assign This Device to a User

THQ.unassignDevice(successCallback, failureCallback);

Display Preferences Popup

  image: "path/to/image.png",  // Optional
  header: "Example Header",  // Optional
  subHeader: "Here's some more information.", // Optional
  color: "#00ff00" // Optional

Open Preferences Page

var win = THQ.createPreferencesWindow({
  title: "Preferences", // Optional
  barColor: "#00ff00", // Optional
  tintColor: "#fff" // Optional
}), {animated: true});

Additional Usage

While above displays the simplest methods for using ToggleHQ, you are also able to use more advanced methods to create a more customized solution.

Enable a preference for the current user or device

THQ.enablePreference("category_key", "preference_key", successCallback, failureCallback);

Disable a preference for the current user or device

THQ.disablePreference("category_key", "preference_key", successCallback, failureCallback);

Get all preferences for the current user or device

THQ.getPreferences(successCallback, failureCallback);
  // Success
  // response: An array of categories and preferences
}, function(response){
  // Failure
  // response: A JSON object with a failure message


The ToggleHQ Appcelerator Titanium plugin is available under the MIT license. See the LICENSE file for more info.