Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5977631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:23:56+00:00 2026-05-22T21:23:56+00:00

I got sample code online about in-app purchases. When the purchase completes, I want

  • 0

I got sample code online about in-app purchases. When the purchase completes, I want a value to state it is bought.

For example, an integer within the app could be equal to 1 or a string could say “Bought”. The user will not see this, it is just for reference. When the user goes to the storefront next time, if they hit a button, I want it to check to see if this value is equal to 1 or Bought. If it is, I will have it move to the next page from there.

How can this be done?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:23:57+00:00Added an answer on May 22, 2026 at 9:23 pm

    Check out this tutorial on In-App Purfchases.

    Edit:

    There are quite a few ways to achieve what you are looking for. No one will write your code for you ( unless you hire them ;-D ). You should look more into the StoreKit framework to get a better understanding of how it works. You will then learn how to manage purchases and how to check if an item is purchased.

    For In-App purchases, I like to use UrbanAirship‘s In-App Purchase classes.

    This is how I keep local tabs on items purchased in one of my apps:

    + (void) updateProductsFromPurchases
    {
        if ([[NSFileManager defaultManager] fileExistsAtPath:PRODUCT_IDS] == NO) {
            [[NSFileManager defaultManager] copyItemAtPath:[[NSBundle mainBundle] pathForResource:@"Products" ofType:@"plist"] 
                                                    toPath:Strings(DOC_DIR,@"/Products.plist")
                                                     error:nil];
        }
        /*  update our product id list so we display updated products to the user  */
        NSArray *downloads = [FILEMANAGER contentsOfDirectoryAtPath:DOWNLOADS error:nil];
        for (NSString *purchased in downloads) 
        {
            if ( [purchased hasPrefix:@"com"] ) 
            {
                /*  for each purchase, add it to the list of product id's  */
                NSMutableArray *addPurchase = [NSMutableArray arrayWithContentsOfFile:PRODUCT_IDS];
                /*  this is to make sure we don't add duplicate product id's  */
                if ( ! [addPurchase containsObject:purchased] ) 
                {
                    [addPurchase addObject:purchased];
                    [addPurchase writeToFile:PRODUCT_IDS atomically:YES];
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got some sample code from the net here: http://www.javadb.com/sending-a-post-request-with-parameters-from-a-java-class That works fine. It
I'm signed up, I've downloaded sample code, I've got a WSDL...and yet I have
I've got a source code file that started as a copy of some sample
i've used a sample found on online and applied it to my code: <?php
I got some sample code for android.nfc.NfcSecureElement but it throws some error. The import
I am using the fistdata global api, I got the sample code in php.
I just started the use of Mapkit Framework. I got a sample code from
I've got a sample script as below. I wanna see if local.js or online/latest.js
I've got some sample code that I'd like to refactor as I need it
I got a sample snippet code from OpenNETCF and cfAes, but name space definition

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.