orta/ARAnalytics — pull request #24 by confidenceJuice (2013-09-06 23:32:38+00:00)
Title: Hockey app update

Changes
- Add `identifyUserWithID:andEmailAddress:`
- Reimplement `initWithBetaIdentifier:liveIdentifier:`

Notes
- Quick Background
- `HockeySDK` is controlled by a `BITHockeyManager` singleton.
- This relies on delegate methods to return info such as userID.
- To make `HockeyAppProvider` self contained for `ARAnalytics` we set the delegate property of `BITHockeyManager` to the provider itself.
- To implement `identifyUserWithID:andEmailAddress:` method we need to ensure that the delegate methods to retrieve username and email `userNameForHockeyManager:componentManager:` and
`userEmailForHockeyManager:componentManager:` return values we set in `identifyUserWithID:andEmailAddress:`.

Simplest solution for this (IMHO), throw in a couple iVars ([first commit](836adb4)).

However:
- on `startManager`, `BITHockeyManager` calls startManager on `BITCrashManager` ([reference](https://github.com/bitstadium/HockeySDK-iOS/blob/develop/Classes/BITHockeyManager.m#L162)) straight away, which calls to the aforementioned delegate methods.
- Since this is done in the Provider's `initWith...` it means that it is called _before_ we can possibly set the `_username` and `_userEmail` iVars.

Hence, second commit [0be6129](https://github.com/confidenceJuice/ARAnalytics/commit/0be6129c1de3c1841926e3a6eb990b2f2bbae67e) Long story short, least hacky way I found around it was `performSelector:withObject:AfterDelay` on the configuring of `BITHockeyManager`... which they do themselves for the feedback and update managers ([reference](https://github.com/bitstadium/HockeySDK-iOS/blob/develop/Classes/BITHockeyManager.m#L175))

Suggestions more than welcome.