blitz-research/monkey — pull request #56 by sygem (2014-05-11 11:11:47+00:00)
Title: Added an AppDelegate class, similar to the ActivityDelegate class found ...

...in the Android target. This makes it much easier for Module authors to hook into the application lifecycle, enabling deeper integration with the iOS platform.

A bit of history behind this change - I needed to hook into the "applicationDidBecomeActive" method for my Facebook plugin. Initially I added a category to BBMonkeyAppDelegate, overriding that method but keeping the call to "game->ResumeGame()". However, I am now writing a module for local notifications, and that also needs to put some code in "applicationDidBecomeActive". Using a category again would mean that I can't use both modules together, so a solution akin to that found in the Android target seems the most appropriate.

FWIW, I have already used this approach in my Chartboost module to start the session each time the user switches to the app, and that has been used in two submitted apps so far.