Managing Urban Airship Configuration

Pre-flight Checklist

It has been awhile since I’ve used Urban Airship. The last time was before their SimpleGeo acquistiation. However, I’ve been following their progress over the years and admired the hardwork and features that are offered. I’m in the final development stages for EPB’s iOS app and need to incorporate push notifications. UAS was the clear choice.

When I was going through their getting started tutorials there was one aspect that bothered me. There’s an assumption, really a requirement, that you put your applications key/master credentials into a file called AirshipConfig.plist. I didn’t pay too much attention to this when I was using their example, but when it came time to incorporate the library in the app I didn’t like the setup.

Reworking the Flight Plan

I decided that it made better since to break out the sampled AirshipConfig.plist into a Debug and Release versions. I ended up modifying their checkConfig.sh script to look at the current Xcode configuration and copy the appropriate plist as AirshipConfig.plist and add it as Build Phase for the project: `“$SRCROOT/Scripts/checkUASConfig.sh”

Now the appriopate settings are provide to the library without having to keep everything in one config that has to have runtime checks and extract the necessary values.

Final Approach

I keep my plist in a Configurations directory at the toplevel of the $SRCROOT

https://gist.github.com/kwylez/5007475