Mobile/Fennec/Android/Switchboard: Difference between revisions

From MozillaWiki
< Mobile‎ | Fennec‎ | Android
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
[https://github.com/mozilla-services/switchboard-server Switchboard] is a service we use to segment users for A/B testing.
[https://github.com/mozilla-services/switchboard-server Switchboard] is a service we use to segment users for A/B testing. See the [https://github.com/mozilla-services/switchboard-experiments/blob/master/README.md switchboard-experiments README] for detailed documentation.
 
== Usage ==
To use Switchboard to expose a new feature to a portion of our users, use a code snippet like this:
 
  if (SwitchBoard.isInExperiment(this, "yourexperimentname")) {
    // Do something interesting.
  }
 
We also need to add the "yourexperimentname" name to the [https://github.com/mozilla-services/switchboard-experiments Switchboard server config].
 
== Testing Switchboard changes locally ==
 
To test your Switchboard changes locally, follow these steps. This assumes you have already forked and cloned the [https://github.com/mozilla-services/switchboard-experiments switchboard-experiments repo], and have made the local changes you want to test.
 
# git clone git@github.com:mozilla-services/switchboard-server.git (or your own fork)
# cd switchboard-server
# npm install
# EXPERIMENTS_FILE=path/to/your/experiments.json node index.js
# Get a URL for your local server (I used [https://localtunnel.me/ localtunnel])
# Update the Switchboard default server URLs in [http://hg.mozilla.org/mozilla-central/file/c0ba5835ca48/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java#l587 BrowserApp] to match your local server URL
# Rebuild and run Fennec
 
== Examples ==
* [http://hg.mozilla.org/mozilla-central/diff/3d97a673734c/mobile/android/base/firstrun/FirstrunPagerConfig.java#l24 First run panels experiment]

Revision as of 15:55, 3 February 2016

Switchboard is a service we use to segment users for A/B testing. See the switchboard-experiments README for detailed documentation.