calgaryscientific/pureweb-ios-samples — pull request #12 by ccb (2014-04-10 19:59:27+00:00)
Title: PWEB-4196 fixes related to backgrounding & synchronizing settings (needs comments and feedback)

one of the issues that sherri and terry had with the new samples was a difficulty changing the username and url whenever the application was newly loaded. the workflow was essentially (a) install the app (b) background the app and change the settings and (c) return to the app.

since the app loaded the credentials from the settings bundle on startup, it was necessary to terminate and reload the app before those changes took effect. so the question became how to synchronize the changes to the settings bundle with the application which was already running but was currently backgrounded. this could produce a variety of edge cases, what if the app was running and loaded, what if the app was loaded but disconnected by a timeout, what if the app had login credentials from the screen already, etc.

the current behavior of DDx (the last of the old samples) is a little different. whenever the user backgrounds the app the session is shut down and you return to the login screen. in effect, you can't keep an active PW session running the background. given that, I thought the simplest thing to do was to terminate the app on suspension, this allows us to get the same behavior as DDx but without introducing any new state or edge cases.

i'd appreciate any comments or feedback or alternative ideas on this.