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

  • Home
  • SEARCH
  • 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 8332339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:41:37+00:00 2026-06-09T02:41:37+00:00

i set my in app purchase creating two bundle id’s .i created a test

  • 0

i set my in app purchase creating two bundle id’s .i created a test account and checked my in app purchase..it was working perfectly fine…after a week later when i tested i m getting this error *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 0 beyond bounds for empty array'
*** First throw call stack:
and its not returning the products…could u guys help me out.what possibly could be wrong with this

 -(void)Declarations
 {
if ([SKPaymentQueue canMakePayments]) {

    NSLog(@"parental functions are disabled");
    SKProductsRequest *productRequest = [[SKProductsRequest alloc]initWithProductIdentifiers:[NSSet setWithObjects:@"com.techzone.9xo.onedollar",@"com.techzone.9xo.twodollar",nil]];
    productRequest.delegate=self;
    [productRequest start];
}else {
    NSLog(@"parental functions are enabled");
}

}
   -(void)productsRequest:(SKProductsRequest *)request didReceiveResponse:  (SKProductsResponse *)response
{
SKProduct *validProduct=nil;
int count = [response.products count];
NSLog(@"number of prouducts present:%d",count);

if(_HintValue)
{
    validProduct = [response.products objectAtIndex:0];

}
if (!_HintValue) {
    validProduct = [response.products objectAtIndex:1];
}
NSLog(@"the product is :%@",validProduct.localizedTitle);
SKPayment *skpayment = [SKPayment paymentWithProduct:validProduct];
[[SKPaymentQueue defaultQueue] addPayment:skpayment];
[[SKPaymentQueue defaultQueue]addTransactionObserver:self];

 }
  - (void)request:(SKRequest *)request didFailWithError:(NSError *)error  
  {  
  NSLog(@"Failed to connect with error: %@", [error localizedDescription]); 

 }
 -(void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
for (SKPaymentTransaction *transaction in transactions) {

    switch (transaction.transactionState) {
        case SKPaymentTransactionStatePurchasing:
            NSLog(@"stuff is getting purchased");
            break;
        case SKPaymentTransactionStatePurchased:   
            NSLog(@"purchased properly");
            NSInteger currentValue=[Util getIntegerValueForKey:@"hintValue"];
            if(_HintValue)
            [Util setIntegerValue:10+currentValue forKey:@"hintValue"];
            if (!_HintValue) 
            [Util setIntegerValue:25+currentValue forKey:@"hintValue"];
            [[SKPaymentQueue defaultQueue]finishTransaction:transaction];
            break;
        case SKPaymentTransactionStateRestored:
            [[SKPaymentQueue defaultQueue]finishTransaction:transaction];
            break;
        case SKPaymentTransactionStateFailed:
            if (transaction.error.code != SKErrorPaymentCancelled) {
                NSLog(@"error happened");
            }
            [[SKPaymentQueue defaultQueue]finishTransaction:transaction];
            break;
        default:
            break;
    }
    }
   }
  • 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-06-09T02:41:39+00:00Added an answer on June 9, 2026 at 2:41 am

    The problem is that you are getting an empty list of valid product IDs. You are accessing objectAtIndex:0 of an empty array which creates that error.

    if you check response.invalidProductIdentifiers you will find your product IDs there.

    Unfortunately that can have many reasons. Have a look at this checklist of reasons that can lead to invalid product IDs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to set up a test account to test in app purchase on
I created a blank MVC 3 application on VS2010 SP1, and set the app
I'm trying to set up an in app purchase and once the purchase has
In my iPhone app, i've set up an in app purchase. I start the
I'm trying to test my new in-app purchase code. I have a few items
While i finished developing an in-app-purchase application, and after several testing on iPad/Iphone, every
I am using in-app purchase to buy a set audiobooks. I am using MKStoreKit
I'm implementing in app purchase in my app. I created a product at itunes
I'm changing my app to add an in app purchase. When I initially set
Basically, I've tried to set up in app purchases on a test app before

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.