购买过程无法连接到iTunes Store?

时间:2014-01-29 10:13:11

标签: iphone ios7

我的代码

 #define kMyFeatureIdentifier @"com.yourcompany.FussballQuiz"
 - (void) initializeStore
 {
        SKProductsRequest *request= [[SKProductsRequest alloc]
                             initWithProductIdentifiers:
                             [NSSet setWithObject: kMyFeatureIdentifier]];
        request.delegate = self;
        [request start];
 }
 -(void)productsRequest:(SKProductsRequest *)request didReceiveResponse:  (SKProductsResponse *)response
 {

}
- (void) request:(SKRequest *)request didFailWithError:(NSError *)error
{
   NSLog(@"Failed to connect with error: %@", [error localizedDescription]);
}

输出

无法连接错误:无法连接到iTunes Store .. 为什么不在iphone中调用didReceiveResponse?

1 个答案:

答案 0 :(得分:1)

您只能使用真实设备测试购买。模拟器将始终返回错误。请务必事先在设备上注销iTunes商店帐户并使用沙盒用户。

编辑:

有关更多指导,请参阅此处:

https://developer.apple.com/in-app-purchase/