我有一个相当奇怪但又严重的问题,而且我找不到任何有类似情况的人。
我有一个应用程序,可以选择三个应用内购买。在内部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只显示其中两个曾被购买过。
答案 0 :(得分:0)
如果用户之前购买了您的应用内购买,然后移除应用并重新安装应用,他们可以再次购买但实际上不会被视为促销(它也不会显示在iTunes连接中) 。这可能是你的脱节吗?
答案 1 :(得分:0)
很可能是越狱手机。在我的应用程序中,我看到的假收据是真实收据的两倍。