【发布时间】:2013-01-21 13:52:03
【问题描述】:
我有一个很奇怪但很严重的问题,我找不到任何有类似情况的人。
我有一个应用程序,其中包含三个应用程序内购买选项。在内部,paymentQueue:updatedTransactions: 方法,我在成功购买后向我的服务器发送一个调用并将其记录在我的数据库中。因此,我可以实时了解我的应用的每个 IAP 的确切数量。
但是,当登录 iTunesConnect 并查看销售额时,我发现应用内购买完成的数量要少得多。例如,三天前,我的数据库记录了 150 的应用购买。然而 iTunesConenect 仅显示当天总共有 30 个已完成的交易。
我不知道为什么会这样。
我不验证收据 - 我选择不验证收据,因为我真的不在乎少数人是否越狱他们的手机并免费获得 IAP。所以我想这可能是问题所在,但我真的怀疑使用我的应用程序的 150 个用户中有 120 个使用的是越狱手机。
所以我想知道:iTunesConnect IAP 报告是否存在延迟?或者它在我的代码中? (代码如下)
-(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"];
// show wait view here
//statusLabel.text = @"Processing...";
break;
case SKPaymentTransactionStatePurchased:
//TODO-> Log analytics
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
NSLog(@"Finished purchase: %@\n", transaction.payment.productIdentifier);
//All Filters were purchased
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]];
}
}
//Filter Pack ONE was purchased
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]];
}
}
//Filter Pack TWO was purchased
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];
// remove wait view here
NSLog(@"Transation restored\n");
break;
case SKPaymentTransactionStateFailed:
if (transaction.error.code != SKErrorPaymentCancelled) {
NSLog(@"Error payment cancelled");
}
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
// remove wait view here
[_purchasingActivityView dismissWithClickedButtonIndex:-1 animated:YES];
NSLog(@"Purchase Error: %@\n", [[transaction error] description]);
break;
default:
break;
}
}
}
从用户的角度来看,交易似乎完美无缺。
任何帮助/建议将不胜感激。这让我完全困惑。 谢谢!
编辑:我还要提一下,我有三个 IAP 产品,根据我的数据库记录,所有这些产品都被多次购买。然而,ITC 只显示其中两个曾经被购买过。
【问题讨论】:
-
我遇到了同样的问题。也许会有延迟?我不知道...有时我一天会购买 30 次,但只会报告 20 次。然后第二天我会有 25 次购买,35 次会被报告。只要你有收据号码,如果你没有得到苹果欠你的钱,你可以自己备份。
-
你知道发生了什么吗?只是延迟吗?我的 IAP 也有同样的问题。
标签: iphone objective-c in-app-purchase storekit