Latest 0.1.1
Homepage https://github.com/lewis-smith/MajorTom
License MIT
Platforms ios 8.0
Frameworks Foundation
Authors

Version
License
Platform

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).

MajorTom 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 inpsired by GroundControl, and provides a single category on NSUserDefaults.

Client Code

UserDefaults().registerDefaultsWithURL(url: URL(string:"https://theprogressapp.com/wtw/defaults.plist")!)```

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

UserDefaults().registerDefaultsWithURL(url: URL(string:"https://theprogressapp.com/wtw/defaults.plist")!, success: { (response, dictionary) in
    print(response.debugDescription)
    print(dictionary.debugDescription)
}) { (response) in
    print(response.debugDescription)
}

Server Code

MajorTom asynchronously downloads and reads a remote plist file. This could be a static file or generated dynamically, like in the following examples:

Ruby

require 'sinatra'
require 'plist'

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

  {
    'Greeting' => "Hello, World",
    'Price' => 4.20,
    'FeatureXIsLaunched' => true
  }.to_plist
end

Python

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))

Node.js

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

var host = "127.0.0.1"
var port = 8080

var app = express()

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

app.listen(port, host)

Static File

Or, simply create a plist file in Xcode and upload it to your webserver :)

Contact

Lewis Smith

License

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

Apps

World Time Widget

Latest podspec

{
    "name": "MajorTom",
    "version": "0.1.1",
    "summary": "Easily pull remote config from your server",
    "description": "If you want to be able to remotely change certain settings, this pod is for you. Inspired by Ground Control, but with zero dependencies.",
    "homepage": "https://github.com/lewis-smith/MajorTom",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Lewis Smith": "[email protected]"
    },
    "source": {
        "git": "https://github.com/lewis-smith/MajorTom.git",
        "tag": "0.1.1"
    },
    "social_media_url": "https://twitter.com/itinerantDev",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "MajorTom/Classes/**/*",
    "frameworks": "Foundation",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This