A minimal functioning iOS starter app to copy and modify, that demonstrates log-in to an OBP server and a first API call using OBPKit. See OBPKit for full usage guidance, and HelloOBP-iOS for more example usage, and the API Explorer at the OBP server you are using.
-
Clone this repo
-
Break the link by running
git remote remove origin
(replace with your own remote). -
Get third party libraries
- If you are happy using Carthage (install), the project is ready, and you just need to run
carthage update --platform iOS --no-build --no-use-binaries
. - If you prefer to use CocoaPods (install), checkout the
use_cocoapods
branch of this repo, updatemaster
and complete the install as follows$ git checkout use_cocoapods $ git branch -f master use_cocoapods $ git checkout master $ pod install
- If you are happy using Carthage (install), the project is ready, and you just need to run
-
Replace the credentials in
AppDelegate.swift
with those you obtain from the Get API Key link at the OBP server you are using.- Rename. Decide on your app name, then in the project file change the project and target names from OBP-iOS-Starter to Your-App-Name and the bundle id from com.tesobe.OBP-iOS-Starter to your.reverse.domain.Your-App-Name
- Make a note of the default redirect URL you will need when registering your app as an API consumer. If you followed the previous step literally, it would be
x-your.reverse.domain.your-app-name://callback
, i.e. the scheme is the lowercased bundle id, prefixed withx-
— more on this at callback schemes. It's important to get this right, as it is verified as part of OAuth handshake; making a mistake here is a common cause of getting 401 unauthorised responses. - Register your app by following the Get API Key link at the OBP server you are using, and using the redirect URL from the previous step. Save the registration result page as a PDF and retain — you will need it if you want to change the redirect URL at some future point.
- In
AppDelegate.swift
update the key and secret to yours, and update the server URLs if necessary.
- Rename. Decide on your app name, then in the project file change the project and target names from OBP-iOS-Starter to Your-App-Name and the bundle id from com.tesobe.OBP-iOS-Starter to your.reverse.domain.Your-App-Name