0

Using on-demand resources in conjuction with iOS in-app purchases is understandable when resources are included with the application. But how do I add additional in-app purchases after the application is on the store? I'm not referring to the process of creating a new in-app purchase in iTunesConnect.

I'm trying to understand if I create a target for a new in-app purchase on the original app and upload the target to the app store if that data will be available for use as an in-app purchase. The WWDC videos indicate there two ways to host in-app purchases: on-demand resources and hosted content. Is the process for uploading the same for both?

C. Outwin
  • 47
  • 1
  • 3

1 Answers1

0

There are several ways you could do this.

1) You could use the SKProductRequest to check for some programatically generated product identifiers (ex: com.company.app.inappItem1, ''2, ''3). The response will include the products you've actually defined in itunes connect. Usually though your app will have to do something with those purchases so you will need to know about all the available products ahead of time anyways. I guess you don't necessarily need to expose them all immediately.

2) You expose a web service somewhere (could just be a website that lists the product id's) that could tell your application what the currently available products ids are. Your application could then check with your backend for the list of product ids to use in the SKProductRequest.

In either case you need to keep in mind that you will probably update your app with new functionality at some time. Old versions of the app may not be able to handle your newer data assets, so you will need to handle this somehow.

You will need to resubmit your app to the store if your in app purchase requires new code to work. If it just a data asset they are buying (not executable code), however, the in app purchase can trigger a download to get that data.

Ron
  • 1,249
  • 9
  • 20
  • Sorry, I missed the part about the 'new target'. No that will not work. You would need to resubmit the app to the app store. – Ron May 29 '18 at 18:25
  • Sorry I was timed out. Do I have to submit a new app version with each new in-app purchase? – C. Outwin May 29 '18 at 18:35
  • It depends on the type of purchase it is. If its new functionality that requires new executable code then yes. If its non-executable data (maybe an image, db table, or whatever) then no. – Ron May 29 '18 at 18:36
  • So the process is submit the original binary with the original iap and for each new iap, create a target, upload it and submit a new app version? – C. Outwin May 29 '18 at 18:38
  • The iap is non consumable. The target contains a json file and a .sks file (SpriteKit) and a .xcassets file. The exec doesn't change. – C. Outwin May 29 '18 at 18:42
  • Your app may have many many in app purchases available. They could be used to unlock functionality or add new data. If you need to extend your app with new IAPs that require new executable code to work then you will need to resubmit the updated version of your app. – Ron May 29 '18 at 18:42
  • Thanks for your help. I appreciate you time. – C. Outwin May 29 '18 at 18:45
  • Sounds like in your case the IAPs could just trigger a download from icloud, or your own backend server. I updated my answer above. – Ron May 29 '18 at 19:04