App rejected because of code inside #if DEBUG conditions

My app was rejected twice. The first time I left code calling into private APIs (namely LSApplicationWorkspace) in a production build, so this rejection seems legitimate. However, the second time the app was rejected, all uses of private APIs were inside #if DEBUG conditions.

I believe code inside #if DEBUGs does not make it into the build, given that the DEBUG flag isn’t specified for the configuration.

Taking into consideration the fact it took nearly three weeks—during which my app was “in review,” without any updates or requests from the reviewers—and two inquiries into the status (including an expedited review request) to have the new build reviewed, I’m not even sure it was actually reviewed—the experience was so frustrating I wouldn’t be surprised if the build got rejected “just because.”

So, I’ve got a few questions:

  • Am I correct in that #if DEBUGged code cannot end up in a production build (i.e. a build whose configuration doesn’t include the DEBUG flag)?
  • Is it possible the App Store review team had access to more symbols than actually exist in the build?
  • How could my app get rejected because of code that’s not in the build?
  • Is it worth spending time on engaging in a conversation with the review team to figure out what’s going on?

Do you test your production build configuration?

(If you don't test your production build configuration - why don't you test your production build configuration ???!!!)

Anyway, put something inside the #if DEBUG that will cause it to not compile (example: !"£$%^&*), and try to build for production.

Is it worth spending time on engaging in a conversation with the review team to figure out what’s going on?

It's probably more productive to talk to Developer Technical Support.

Edited to add: I've just googled what LSApplicationWorkspace might be used for, and I think you need to be very cautious going forward. It seems that it can perhaps be used to enumerate all the apps on the device! That's a nasty bit of user privacy violation, and has no doubt raised a "red flag" against you and the app. Why on earth was it there in the first place?

App rejected because of code inside #if DEBUG conditions
 
 
Q