-3

I have to create an application for iOS and Android, from which I can buy some "items".

I don't understand how the in-app purchase work; can I buy and download the content I already paid for? Or can I buy just the unlocking of internal content without downloading it? If its just for unlocking internal content, is there any way to buy and download the content?

Thanks

Nirav Bhatt
  • 6,940
  • 5
  • 45
  • 89
simox89
  • 45
  • 4
  • 3
    What happens when the user purchases something in-app is entirely up to the developer. You can unlock content. You can unlock content and make it available for download. Or you can unlock content and download immediately. Could be a combination of either of the above. Considering that it is something the developer will decide, and does not relate to programming of any kind (_yet_), I am not sure if this really is something we can help with. I speak only for Android. – Siddharth Lele Jul 02 '15 at 14:06
  • @IceMAN mmm ok! and..How can I buy something and download the content?? – simox89 Jul 02 '15 at 15:10
  • There are several tutorials which will help you implement in-app purchases and several tutorials that will demonstrate how to download content (_files, images, videos, etc._) from your servers of off a website URL. I would advice, if you are seeking it, to start with either of these two first, then proceed to the next. Basically, start coding somewhere and if you run into difficulties and need additional help, then I / we can be of _better_ assistance. As for how you can download, start with the Android [DownloadManager](https://developer.android.com/reference/android/app/DownloadManager.html) – Siddharth Lele Jul 02 '15 at 15:21

1 Answers1

1

The only thing you can't do with in-app purchase is selling actual goods - that's also allowed in case you have a website doing the same thing (eg ebay app). And there are some more rules for iOS in-app purchase.

As for the step by step idea about in-app purchase, here is a gist:

  • iOS app requests for SKProducts from app store (already setup via itunes connect portal by developer)
  • The retrieved products are displayed in the app along with localised pricing
  • User selects a product to buy
  • Purchase goes through via various steps - in-progress / success / failure. Depending upon the status, the app UI should be updated to keep the user informed.
  • Upon successful purchase, you can download content inside the app using your own server, or the content that's uploaded on Apple servers. You can unlock the content from within the app as well.

In a nutshell, you have a long way to go. The best way to start theoretically is to refer to In-app purchase programming guide. In addition, this book by Apple is also helpful. And for your needs, here is a sample code from Apple to begin with.

If you rather want a step by step tutorial, here is one authored by me. A rather easier one is the video lecture series with SWIFT and Objective C - prepared by me - which also accompanies code sample for SWIFT and Objective C to save time.

Nirav Bhatt
  • 6,940
  • 5
  • 45
  • 89