IOS:应用程序购买时出错
我在我的应用程序中使用了应用程序购买部分,但是当我测试它时,我遇到了问题,这是我在控制台中的结果:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论