0

I don't want to include hockey sdk in my app store version. As a result, I create two target and for app store target, I don't include hockey sdk. In my app delegate, I write like this.

#ifdef DEBUG
#import <HockeySDK/HockeySDK.h>
#elif RELEASE
#import <HockeySDK/HockeySDK.h>
#elif DEVHOCKEY
#import <HockeySDK/HockeySDK.h>
#endif
if (ENV == ENV_DEV || ENV == ENV_PROD_WITH_DEV_HOCKEY || ENV == ENV_PROD) {
    [[BITHockeyManager sharedHockeyManager] configureWithIdentifier:HOCKEY_KEY];
    [[BITHockeyManager sharedHockeyManager] startManager];
    [[BITHockeyManager sharedHockeyManager].authenticator authenticateInstallation];
    [[BITHockeyManager sharedHockeyManager].feedbackManager setFeedbackObservationMode:BITFeedbackObservationModeThreeFingerTap];
}
else if (ENV == ENV_APPSTORE) {

}

Problem is that when I run or archive for app store target, it say "Use of undeclared identifier BITHockeyManager". How shall I do to exclude hockey sdk and their code only for app store version?

Khant Thu Linn
  • 5,905
  • 7
  • 52
  • 120
  • Any specific reasons you don't want to use crash reporting in the App Store build? – Kerni Apr 11 '16 at 11:52
  • I think for crash reporting, user will see prompt and ask whether they want to send. I don't want to show that prompt and currently, I am already using flurry. I use hockey to distribute for internal testers. – Khant Thu Linn Apr 12 '16 at 07:26
  • 2
    You can disable the prompt, see the documentation: http://support.hockeyapp.net/kb/app-management-2/how-to-auto-submit-crash-reports I suggest you try out the crash reporting feature and compare it to see which is better :) – Kerni Apr 12 '16 at 09:43

1 Answers1

2

It is not correct to exclude a lib in this way. In order to get the Complier work for your code, you need to always import HockeySDK/HockeySDK.h.

I have two suggestions to meet your requirements:

Solotion 1: Build two separate apps, one for pre-release test which can distributed via HockeyApp; the other for Apple Store Release without importing HockeyApp.

Solution 2: Keep one build with HockeyApp integrated. The HockeyApp SDK should check for the existence of a provisioning profile in the App bundle to detect the AppStore environment and then automatically disables all beta only features of HockeyApp. (i.e. "In-App-Updates" in the iOS SDK (for Beta & Enterprise only) are automatically disabled when running in an App Store build by default. You can refer here for more information.

Fangfang Wu - MSFT
  • 1,062
  • 6
  • 7