Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS/Xcode: Concurrent builds for Debug, Ad Hoc, and Release *w/ In-App Purchases*

I've followed this tutorial to allow for my app to have builds for DEBUG, ADHOC testing (for my beta users), and RELEASE. Everything works great except for my in-app purchases.

My Bundle IDs after this setup are:

  • Debug: com.mycompany.myproduct.debug
  • Ad Hoc: com.mycompany.myproduct.adhoc
  • Release: com.mycompany.myproduct

(The RELEASE ID is the same as it was before this new setup.

Since this method changes the Bundle ID based on the build and since In-App Purchases are tied to a specific Bundle ID when I run my app as DEBUG or ADHOC my product identifiers come back as invalid when I call requestProductsWithCompletionHandler.

I have tried adding new In-App Purchase products prefaced with the new Bundle ID like so: com.mycompany.myproduct.debug.iapname, but since the In-App Purchases are tied to a single Bundle ID this doesn't work.

My question is this: In order to accomplish what I'm trying to accomplish, do I have to create 2 new apps in iTunes Connect for each of my new Bundle IDs and then add In-App Purchase products to each of those for each Build Configuration? Or, is there another way to accomplish what I'm trying to accomplish?

like image 922
tptcat Avatar asked Feb 06 '14 15:02

tptcat


People also ask

What is adhoc Xcode?

The ad hoc method allows you to distribute your app to Test Flight and other sources and enables "designated" devices to run the app, including devices that aren't specifically registered to your Apple Developer Program account to run the app. ( think public TestFlight testing)

What does Xcode build for testing do?

Description. The Step runs Xcode's xcodebuild command with the build-for-testing option. This builds your app and associated tests so that you can, for example, upload it to a third-party testing service to run your tests on a real device.

How do I run debug mode in Xcode?

When you run an application in Xcode, the debugger is automatically started and attached to the process of the application. Click the Run button in the top left or press Command + R. From the moment the application is up and running, we can start inspecting the process and, if necessary, debug it.

How do I build for release in Xcode?

To create a release build, you have to edit your current scheme (⌘<) and highlight "Run [name of application]. On the right, select "Build Configuration" and choose "Release". Build as usual.


1 Answers

The answer is yes, As store kit gets the in app purchases from the iTunes store the easiest way to do this is to add separate apps in iTunes connect and keep them up to date.

The other approach you could take could be to abstract store kit away from your app in your own class. Then you can check the bundleIdentifier property of [NSBundle mainBundle] and either ask for your products from the store if your bundleIdentifier is the one you expect, or return mock SKProducts that you create yourself if it is only for testing purposes.

I guess it depends on how committed you are to your testers but obviously your custom classes would be scalable to n bundle identifiers whereas dummy apps in iTunes connect isn't scalable at all

like image 95
jackslash Avatar answered Sep 16 '22 15:09

jackslash