Skip to content
Remote configuration for iOS
Objective-C Ruby
Branch: master
Clone or download
mattt Merge pull request #27 from mattt/dependabot/bundler/Example/Server/r…

Bump rack-protection from 1.2.0 to 1.5.5 in /Example/Server
Latest commit dc2e13e Jul 10, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
AFNetworking @ 1d7f58b Update AFNetworking to 3.0 Oct 21, 2015
GroundControl.xcworkspace Adding project workspace Jan 26, 2013
GroundControl Update AFNetworking to 3.0 Oct 21, 2015
.gitmodules Initial Commit Aug 31, 2012
GroundControl.podspec Podspec for master Oct 21, 2015
LICENSE Initial Commit Aug 31, 2012 Merge branch 'master' of Aug 28, 2014


Remote configuration for iOS

Many developers don't realize that they are allowed to remotely control the behavior of their app (provided that the application isn't downloading any new code).

GroundControl gives you a dead-simple way to remotely configure your app, allowing you to add things like feature flags, impromptu A/B tests, or a simple "message of the day".

It's built on top of AFNetworking, and provides a single category on NSUserDefaults (just add #import "NSUserDefaults+GroundControl.h" to the top of any file you want to use it in).

This project is part of a series of open source libraries covering the mission-critical aspects of an iOS app's infrastructure. Be sure to check out its sister projects: SkyLab, CargoBay, houston, and Orbiter.

Client Code

NSURL *URL = [NSURL URLWithString:@""];
[[NSUserDefaults standardUserDefaults] registerDefaultsWithURL:URL];

...or if you need callbacks for success/failure, and prefer not to listen for a NSUserDefaultsDidChangeNotification:

NSURL *URL = [NSURL URLWithString:@""];
[[NSUserDefaults standardUserDefaults] registerDefaultsWithURL:URL
  success:^(NSDictionary *) {
    // ...
} failure:^(NSError *) {
    // ...

...or if you need to use an HTTP method other than GET, or need to set any special headers, specify an NSURLRequest:

NSURL *URL = [NSURL URLWithString:@""];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];
[[NSUserDefaults standardUserDefaults] registerDefaultsWithURLRequest:request
  success:^(NSURLRequest *, NSHTTPURLResponse *, NSDictionary *) {
    // ...
} failure:^(NSURLRequest *, NSHTTPURLResponse *, NSError *) {
    // ...

Server Code

GroundControl asynchronously downloads and reads a remote plist file. This could be a static file or generated dynamically, like in the following examples (see also the complete Sinatra application found in example/server):


require 'sinatra'
require 'plist'

get '/defaults.plist' do
  content_type 'application/x-plist'

    'Greeting' => "Hello, World",
    'Price' => 4.20,
    'FeatureXIsLaunched' => true


from django.http import HttpResponse
import plistlib

def property_list(request):
    plist = {
         'Greeting': "Hello, World",
         'Price': 4.20,
         'FeatureXIsLaunched': True,
         'Status': 1

    return HttpResponse(plistlib.writePlistToString(plist))


var plist = require('plist'),
    express = require('express')

var host = ""
var port = 8080

var app = express()

app.get("/", function(request, response) {
                'Greeting': "Hello, World",
                'Price': 4.20,
                'FeatureXIsLaunched': true,
                'Status': 1

app.listen(port, host)


Mattt Thompson


GroundControl is available under the MIT license. See the LICENSE file for more info.

You can’t perform that action at this time.