IOS:应用程序购买时出错

发布于 2024-12-06 20:18:02 字数 2143 浏览 1 评论 0原文

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

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];
 }];    
}

I use in my app a section with app purchse but when I test it I have a problem and this is my result in console:

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  

practically when I start my app and push on in app purchase button I have an alert with "Impossible to connect to apple store" and this result in console.
What's the problem?

the code where I have the problem is:

- (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];
 }];    
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文