IOS:应用购买时出错

时间:2011-09-27 09:48:47

标签: ios xcode in-app-purchase

我在我的应用程序中使用app purchse的部分但是当我测试它时我遇到了问题,这是我在控制台中的结果:

response for request product data
2011-09-26 19:14:37.601 MyApp[1233:707] Feature: puzzle, Cost: 0.790000, ID: com.mycompany.MyApp.puzzle
2011-09-26 19:14:44.973 MyApp[1233:707] Review request cannot be checked now: (null)
2011-09-26 19:14:44.980 MyApp[1233:707] making paymentQueue updatedTransactions
2011-09-26 19:14:46.095 MyApp[1233:707] making paymentQueue updatedTransactions
2011-09-26 19:14:46.098 MyApp[1233:707] FAILED!!! 4B2D3ECB-784D-415E-B3EA-942D88BD5A23  

几乎当我启动我的应用程序并按下应用程序购买按钮时,我有一个警告“无法连接到苹果商店”,这个结果在控制台中。 有什么问题?

我遇到问题的代码是:

- (void) buyFeature:(NSString*) featureId
     onComplete:(void (^)(NSString*)) completionBlock         
    onCancelled:(void (^)(void)) cancelBlock
{
self.onTransactionCompleted = completionBlock;
self.onTransactionCancelled = cancelBlock;

[MKSKProduct verifyProductForReviewAccess:featureId                                                              
                               onComplete:^(NSNumber * isAllowed)
 {
     if([isAllowed boolValue])
     {
         UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Review request approved", @"")
                                                         message:NSLocalizedString(@"You can use this feature for reviewing the app.", @"")
                                                        delegate:self 
                                               cancelButtonTitle:NSLocalizedString(@"Dismiss", @"")
                                               otherButtonTitles:nil];
         [alert show];
         [alert release];

         if(self.onTransactionCompleted)
             self.onTransactionCompleted(featureId);                                         
     }
     else
     {
         [self addToQueue:featureId];
     }

 }                                                                   
                                  onError:^(NSError* error)
 {
     NSLog(@"Review request cannot be checked now: %@", [error description]);
     [self addToQueue:featureId];
 }];    
}

0 个答案:

没有答案