1

I am trying to use Apple In-App purchase in my application's development mode. I have created test In-App product on iTunes connect (Ready to Submit) and trying to fetch product identifiers in my code but its saying invalid identifier

Please tell me that how i can test In-App purchase in development mode (app not submitted to live yet)

Steps i have used

  1. created In-App product on my iTunes connect account which have status Ready to Submit
  2. enabled In-App purchase in my Xcode project
  3. using iAPHelper class downloaded from here - https://github.com/saturngod/IAPHelper
  4. using following code to access products

But its returning my product id as invalid identifier. don't know what wrong i am doing.

if(![IAPShare sharedHelper].iap) {
    NSSet* dataSet = [[NSSet alloc] initWithObjects:@"com.mydomain.app.test", nil];
    [IAPShare sharedHelper].iap = [[IAPHelper alloc] initWithProductIdentifiers:dataSet];
}

[IAPShare sharedHelper].iap.production = NO;

[[IAPShare sharedHelper].iap requestProductsWithCompletion:^(SKProductsRequest* request,SKProductsResponse* response)
 {
     if(response > 0 ) {
         SKProduct* product =[[IAPShare sharedHelper].iap.products objectAtIndex:0];
         NSLog(@"Price: %@",[[IAPShare sharedHelper].iap getLocalePrice:product]);
         NSLog(@"Title: %@",product.localizedTitle);
 }];

1 Answers1

0

This is working for me

The contract for paid applications must be in effect in order to receive data about the in app purchases configured.

This worked for me. I had the exact same problem.

check : https://stackoverflow.com/a/2045064/3901620

Community
  • 1
  • 1
KKRocks
  • 8,222
  • 1
  • 18
  • 84