Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In App Purchase: dynamically add non consumable items

I'm developing an app where the user can purchase digital maps, charts and so on. I'd like to wrap these in in-app-purchases. The thing is that I don't know beforehand how many charts there will be, as I'm getting them from another source from the net. There could be hundreds.

I have a server that periodically gets the charts from that source and stores them locally; there may appear new charts in the future or disappear existing ones. All this without manual intervention.

There are three distinct types of charts.

My first solution was to create three consumable items and let the user buy these; this was working fine but unfortunately Apple rejected it, since they require charts to be "non consumable".

But I'm quite at a loss how to implement what I want with the non-consumable type. If I create these three types as non-consumable, and the user buys one, he will get all the other charts in that group for free, since a non-consumable item can only be bought once.

The only solution I can think of is to create a non-consumable item for every single chart. But that's something I want to avoid at all costs: as it is now, the charts are periodically fetched from the remote source without any manual work on my side. I'd like to keep it that way. I don't want to manually create a new non consumable purchases every time a new chart appears.

Any ideas how to make this scalable?

like image 582
Thomas Wana Avatar asked Jul 03 '12 17:07

Thomas Wana


People also ask

What is consumable and non consumable In-app Purchase?

Consumables: User purchases the same product multiple times. Often they're “used up” and bought again. Examples are currency in a free-to-play game, or healing potions, extra lives, etc. Non-consumables: User buys once (and only once), then has access to the item forever.

What is the difference between in-app purchase and subscription?

The Difference between In-App Purchase and SubscriptionIn-app purchases are the expenses an app may ask to purchase digital items once users download the app. But when users subscribe, they need to pay a fixed amount to use all the app features on a monthly, weekly, or yearly basis.

What is a consumable In-app Purchase?

Consumables. A consumable item gives users a one-time benefit. So after using it once, it disappears. Especially in freemium games, users can buy premium currencies like “Gems” in Clash of Clans.


2 Answers

I can't completely spell it out for you with code but you can handle this problem two ways:

Currency. You do not sell non-consumable items such as maps. You sell currency. With that currency you purchase maps. The maps you feed dynamically whenever the user hits your store front. That way you only need to track a few purchase options.

The other option: The company I worked for initially set this up very simply. Our app would launch and we would reach out for a php script that handed us back the app store IDs that we had sitting in it. At that point we'd verify them and use the valid returns. This option allowed us to change our in app purchases through iTunes Connect and then in the script and everything was great.

like image 64
Sandoze Avatar answered Oct 21 '22 19:10

Sandoze


This is an older post, but I just had the same question and found out there is now a way to dynamically provide non-consumables by hosting the product identifier list on your own server:

Every product you sell in your app has a unique product identifier. Your app uses these product identifiers to fetch information about products from the App Store, such as pricing, and to submit payment requests when users purchase those products. Your app can either read its list of product identifiers from a file in its app bundle or fetch them from your server.

If your app has a fixed list of products, such as an in-app purchase to remove ads or enable functionality, embed the list in the app bundle. If the list of product identifiers can change without your app needing to be updated, such as a game that supports additional levels or characters, have your app fetch the list from your server.

There’s no runtime mechanism to fetch a list of all products configured in iTunes Connect for a particular app. You’re responsible for managing your app’s list of products and providing that information to your app. If you need to manage a large number of products, consider using the bulk XML upload/download feature in iTunes Connect.

Apple Developer In-App Purchasing Guide

like image 40
Korey Hinton Avatar answered Oct 21 '22 18:10

Korey Hinton