In-App Purchases - a guide

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hi everybody!
    This is a small guide to create and use In-App-Purchases using the iOS Store extension.

    First, you must go to iTunes Connect and sign in with your Apple ID.
    Note that you must have the right contracts signed to use IAP's.

    Select "Manage Your Applications" and select your app that you have previously set up that you wish to add IAP's for.

    Important: The "Bundle ID" of the app you are setting up IAP's for should match the Bundle ID that you are using in your MFA file.

    Then click 'Manage In-App Purchases' in the menu at the right.

    Under "In-App Purchase Summary" you will find a button to create a new IAP:
    Please login to see this picture.

    You must decide which type of item you are in the process of creating.
    For this guide I'm sticking to simple non-consumables - which basically means that once you buy the item you will have it forever.
    Please login to see this picture.

    You should then chose a reference name for your item. This item name is only for your own reference.
    It will not be shown in your app.
    Please login to see this picture.

    You must then chose a product identifier.
    It is a good idea to use the inverse URL way of making an unique identifier so it doesn't clash with any other name you might be using.
    For example: "com.companyname.gamename.itemname"
    Please login to see this picture.

    Under "Pricing and Availability" you must select which price tier the product should be in:
    Please login to see this picture.


    Under "In-App Purchase Details" you must name your item and describe it in the languages you decide.
    Please login to see this picture.

    Save it:Please login to see this picture.

    Here i added the item name and description in English and Danish:
    Please login to see this picture.

    You must decide if the content of the item is downloadable or simply just "unlockable" from your game.
    If the item requires that you download some content from a server you can choose to host it on Apple's servers.

    Please login to see this picture.

    It is optional if you wish to fill out the review notes but you must supply a screenshot to Apple for
    review purposes so they can see what the IAP is all about.

    Save the information:
    Please login to see this picture.

    I have added three IAP items for my test app:
    Please login to see this picture.

    Press done - and you are done! (with the iTunes Connect part)

    Time to set up IAP's in your MFA!
    Please login to see this link.

    I have written a bunch of comments inside.
    Please note that this is just one way of doing in app-purchases.
    You can also fetch the list of items from a server using the GET Object and then fetch the item information.
    You can also use the 'specific' conditions in the iOS Store object to hardcode the identifiers if you don't need to have that many IAP's in your app.

    In my example file I dynamically created the buttons as the information is retrieved but you can easily
    have them created beforehand with prettier graphics and then show a "progress/loading" indicator while it fetches the product information from the store.

    When you are all set: export and try it in the simulator (to run it in the sandbox):

    Please login to see this picture.

    Please note that the sandbox can be quite slow at fetching the product identifiers.
    It will take a while before they are shown on the screen in my example.

    Also please read the help-file of the iOS Store object to read more about how In-App Purchases work.

    Please login to see this picture. Please login to see this link. - Please login to see this picture.

  • I'm having a little trouble when I test it on the device. It comes up with the price, and the product details so I know its connecting and getting the data correctly.
    When the user clicks to buy it pops up asking if they want to buy (sandboxed). But then nothing happens. I don't get a payment failed notification and it doesn't purchase the item no matter how long I wait.

    Is this a sandbox problem or is it a problem with user certificates or something along those lines.

  • I'm having a little trouble when I test it on the device. It comes up with the price, and the product details so I know its connecting and getting the data correctly.
    When the user clicks to buy it pops up asking if they want to buy (sandboxed). But then nothing happens. I don't get a payment failed notification and it doesn't purchase the item no matter how long I wait.

    Is this a sandbox problem or is it a problem with user certificates or something along those lines.

    First, go to your device settings and sign out of iTunes. It's probably trying to use your currently logged in iTunes account as a Sandbox account and failing.

    When you create a Sandbox user, make sure you don't under any circumstances sign in unless it's through your app requesting it via an IAP. There's some weird thing with Sandbox accounts that makes them invalid if you do anything else with it. Read more about it here - Please login to see this link.

    hi, do we need mmf developer for this??

    Yes, the iOS Store object is Developer only if I'm not mistaken.

  • Is this a sandbox problem or is it a problem with user certificates or something along those lines.

    Is the device running on iOS 4.3? Had this problem with IAP on the 4.3 simulator, not on 5.0 or higher.

    @hcem: yes, I think so

    Please login to see this link.
    Please login to see this link.
    Please login to see this link.

  • First, go to your device settings and sign out of iTunes. It's probably trying to use your currently logged in iTunes account as a Sandbox account and failing.

    When you create a Sandbox user, make sure you don't under any circumstances sign in unless it's through your app requesting it via an IAP. There's some weird thing with Sandbox accounts that makes them invalid if you do anything else with it. Read more about it here - Please login to see this link.


    Yes, the iOS Store object is Developer only if I'm not mistaken.

    Awesome! Sorted thanks!

  • Thanks Andos, this really helped.

    But I still managed to get stuck...I later found out it was due to old provisioning profiles in xcode and on my device. When I deleted all of them, except for my new provisioning profile pointing to the correct App ID with the correct Bundle ID, everything worked.

    Please login to see this link.
    @Javira

  • The documentation says that the IAP identifiers need to be in the format: com.myCompany.myApp.purchaseName

    This no longer seems to be correct; IAPs wouldn't work for me unless I got rid of the bundle ID and just used the purchaseName for the identifier. Should this be this way?

  • This "incorrect" method that Game_Master pointed out is in both the help file and in the IAP guide Anders wrote. If it is incorrect, both those sources should be updated so people don't get confused in the future. I have lost almost a week because of it.

    Please login to see this link.

  • I am using com.myCompany.myApp.purchaseName without problems. I can think of 2 potential issues that could prevent a developer from testing IAPs:

    - You are using a wildcard App ID which is ineligible for In App Purchase and Game Center. You must use explicit App IDs which are automatically enabled for In App Purchase and Game Center. More info about this here: Please login to see this link.

    - You are not using an In App Purchase Test User account. You must create an In App Purchase Test User account in iTunes Connect in order to utilize the In App Purchase Sandbox for testing on your device(s).
    More info about this here: Please login to see this link.
    And here: Please login to see this link. (check more specifically "Testing Your In-App Purchases")

  • I looked at my apps and can confirm "com.myCompany.myApp.purchaseName" works as well as "com.myCompany.purchaseName" - before this thread I wasn't aware that I used different identifier formats in my apps, but both were successfully updated with the latest MMF build. So, better check Olivier's hints.

    Please login to see this link.
    Please login to see this link.
    Please login to see this link.

  • I am using com.myCompany.myApp.purchaseName without problems. I can think of 2 potential issues that could prevent a developer from testing IAPs:

    - You are using a wildcard App ID which is ineligible for In App Purchase and Game Center. You must use explicit App IDs which are automatically enabled for In App Purchase and Game Center. More info about this here: Please login to see this link.

    - You are not using an In App Purchase Test User account. You must create an In App Purchase Test User account in iTunes Connect in order to utilize the In App Purchase Sandbox for testing on your device(s).
    More info about this here: Please login to see this link.
    And here: Please login to see this link. (check more specifically "Testing Your In-App Purchases")


    That's weird - I made sure I was doing both of those correctly when I was testing, but I always got invalid identifiers until I just used the IAP names. I'm using the latest build of everything, but it happened even on previous builds for me.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!