/nationbuilder-ios

An iOS client to the NationBuilder API

Primary LanguageObjective-CMIT LicenseMIT

NationBuilder iOS SDK

CI Status Version License Platform

Usage

To try out the sample app (NB Sample), follow these steps.

  1. Make sure you clone this repo and download Xcode. You'll eventually need to run and build the NBClientExample project. Before that you need to install some dependencies:
~> sudo gem install -N cocoapods
nationbuilder-ios> pod install
  1. Open NBClient.workspace. Make sure to delete the configuration file at ./NBClientExample/NBClientExample/NationBuilder-Info-Local.plist. Build and run using the NBClientExample scheme.

  2. Using the NationBuilder Control Panel, go to Settings > Apps > Install new app install. Install the NBClientExample app for your nation.

  3. Open the previously built NB Sample app in the iOS Simulator.

  4. In the app, click the signin button on the top left. Provide your nation's slug. In Safari, sign into your account on your nation and authorize the app.

Refer to the documentation section and the implementation checklist on how to use the SDK to build your app. Note that the sample app intends to be a modest example of using the NBClient library. It intends to use modern iOS conventions, no external dependencies, and stock UIKit classes.

Features

Authentication & Authorization:

Via Safari, sign into your nation and authorize the application.

authentication gif

Account Management & Persistence:

Sign into multiple nations or different accounts on the same nation. Accounts get stored and persist across app uses.

accounts gif

Methods for API Endpoints:

Use the client to fetch and manipulate data via the NationBuilder API, to save you time to focus on building the rest of your app.

people crud gif

Installation

NBClient is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'NBClient', '~> 1.0.0'

Requirements

The SDK requires iOS 7 and above. All included UI components (the accounts component, the sample app) are universal, supporting both iPhone and iPad.

Documentation

Detailed guides and code samples are at NationBuilder iOS developer documentation. Or, if you prefer reading on Github or want to contribute edits, the guides are also available on Github.

Testing

# Install dependencies:
~> gem install -N xcpretty

# Run unit tests against recorded production data:
nationbuilder-ios> rake test

License

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

Credits

The NBClient/UI component uses the Stroke 7 Icon Font Set by Pixeden.

Next: Installing ➔