I have a rather strange but serious problem, and I could not find anyone with a similar scenario.
I have an application in which there are options for three in-app purchases. Inside, the paymentQueue:updatedTransactions:method, I send my server to a successful purchase and write it to my database. Therefore, I know the exact amount of each of the IAPs in real time for my application.
However, when I enter iTunesConnect and view the sales, I see a significantly lower number for the number of completed purchases in the application. For example, three days ago my database recorded 150 in app purchases. However, iTunesConenect only shows 30 completed transactions for the same day.
I do not understand why this could be.
I do not check receipts - I decided not to check them, because I really do not care if a small number of people jailbreak their phone and get IAP for free. Therefore, I believe that this may be a problem, but I really doubt that 120 out of 150 users using my application use jailbroken phones.
So, I am wondering: is there a delay in iTunesConnect IAP reports? Or is it something in my code? (Code below)
-(void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions {
for (SKPaymentTransaction *transaction in transactions) {
NSLog(@"Transaction: %@\n", transaction.payment.productIdentifier);
switch (transaction.transactionState) {
case SKPaymentTransactionStatePurchasing:
NSLog(@"Processing purchase");
[_purchasingActivityView setTitle:@"Processing"];
break;
case SKPaymentTransactionStatePurchased:
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
NSLog(@"Finished purchase: %@\n", transaction.payment.productIdentifier);
if([transaction.payment.productIdentifier isEqualToString:kInAppPurchaseFilterPackALLProductId]) {
if ([[ACSimpleKeychain defaultKeychain] storeUsername:@"iapALL"
password:nil
identifier:transaction.transactionIdentifier
forService:@"myService"]) {
[Logger log:[NSString stringWithFormat:@"Stored transaction credentials for fall: %@", transaction.transactionIdentifier]];
[[WebCallManager sharedManager] sendPurchaseNotice:@"ALL" withDeviceId:[OpenUDID value] withDelegate:nil];
}
else {
[Logger log:[NSString stringWithFormat:@"Error storing transaction credentials for fpone & fptwo purchase: %@", transaction.transactionIdentifier]];
}
}
else if([transaction.payment.productIdentifier isEqualToString:kInAppPurchaseFilterPackONEProductId]) {
if ([[ACSimpleKeychain defaultKeychain] storeUsername:@"iapONE"
password:nil
identifier:transaction.transactionIdentifier
forService:@"myService"]) {
[Logger log:[NSString stringWithFormat:@"Stored transaction credentials for fpone purchase: %@", transaction.transactionIdentifier]];
[[WebCallManager sharedManager] sendPurchaseNotice:@"ONE" withDeviceId:[OpenUDID value] withDelegate:nil];
}
else {
[Logger log:[NSString stringWithFormat:@"Error storing transaction credentials for fpone purchase: %@", transaction.transactionIdentifier]];
}
}
else if([transaction.payment.productIdentifier isEqualToString:kInAppPurchaseFilterPackTWOProductId]) {
if ([[ACSimpleKeychain defaultKeychain] storeUsername:@"iapTWO"
password:nil
identifier:transaction.transactionIdentifier
forService:@"myService"]) {
[Logger log:[NSString stringWithFormat:@"Stored transaction credentials for fptwo purchase: %@", transaction.transactionIdentifier]];
[[WebCallManager sharedManager] sendPurchaseNotice:@"TWO" withDeviceId:[OpenUDID value] withDelegate:nil];
}
else {
[Logger log:[NSString stringWithFormat:@"Error storing transaction credentials for fptwo purchase: %@", transaction.transactionIdentifier]];
}
}
[_purchasingActivityView dismissWithClickedButtonIndex:0 animated:YES];
break;
case SKPaymentTransactionStateRestored:
if(_purchasingActivityView) {
[_purchasingActivityView dismissWithClickedButtonIndex:-1 animated:YES];
}
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
NSLog(@"Transation restored\n");
break;
case SKPaymentTransactionStateFailed:
if (transaction.error.code != SKErrorPaymentCancelled) {
NSLog(@"Error payment cancelled");
}
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
[_purchasingActivityView dismissWithClickedButtonIndex:-1 animated:YES];
NSLog(@"Purchase Error: %@\n", [[transaction error] description]);
break;
default:
break;
}
}
}
From the point of view of users, transactions look flawless.
Any help / advice would be incredibly appreciated. This is completely confusing for me. Thank!
EDIT . I should also mention that I have three IAP products, all of which were purchased several times according to my database entries. However, ITC shows only two of them that have ever been acquired.