NationBuilder iOS SDK
To try out the sample app (NB Sample), follow these steps.
- 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
NBClient.workspace. Make sure to delete the configuration file at
./NBClientExample/NBClientExample/NationBuilder-Info-Local.plist. Build and run using the
Using the NationBuilder Control Panel, go to
Install new app install. Install the
NBClientExampleapp for your nation.
Open the previously built
NB Sampleapp in the iOS Simulator.
In the app, click the signin button on the top left. Provide your nation's slug. In an in-app Safari window (
SFSafariViewController), 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.
Swift support is now available. It has only been tested on Xcode 6.3+. There are a couple additional things to do for using Swift with the SDK, and they are listed in the code sample.
Authentication & Authorization:
Via an in-app Safari window (
SFSafariViewController), sign into your nation
and authorize the application.
Account Management & Persistence:
Sign into multiple nations or different accounts on the same nation. Accounts
get stored and persist across app uses. Note the authentication happens via an
in-app Safari window (
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.
NBClient is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'NBClient', '~> 1.3.0'
The SDK requires iOS 9 and above. All included UI components (the accounts component, the sample app) are universal, supporting both iPhone and iPad.
You can pass the arguments in
brew install xctool)
to run manually. The simpler alternative is to run tests in Xcode for the
NBClient is available under the MIT license. See the LICENSE file for more info.
The NBClient/UI component uses the Stroke 7 Icon Font Set by Pixeden.