MKStoreKit非消耗品在连接和NSUbiquitousKeyValueStore都失败

hol*_*hix 0 objective-c in-app-purchase mkstorekit

我正在尝试将应用程序内购买添加到我的应用程序中,所以在想知道围绕这个互联网后我决定去找MKStoreKit,现在一切都已设置,项目看起来不错,应该在服务器上的文件,实际上是在服务器上所有这些东西.

当我在设备上运行应用程序并按下"购买"测试按钮时,混乱就开始了.首先,这是我得到的结果.

    2012-02-09 17:45:28.324 MyApp[7147:707] checking if com.my.company.testinapp.pack001 pack is purchased
    2012-02-09 17:45:30.814 MyApp[7147:707] Review request cannot be checked now: (null)
    2012-02-09 17:45:33.335 MyApp[7147:707] NSUbiquitousKeyValueStore error: com.my.company.inapp has no valid com.apple.developer.ubiquity-kvstore-identifier entitlement
    2012-02-09 17:45:33.370 MyApp[7147:707] Problem in iTunes connect configuration for product: com.my.company.testinapp.pack001
    2012-02-09 17:45:34.063 MyApp[7147:707] User cancelled transaction: <SKPaymentTransaction: 0x8c0fde0>
    2012-02-09 17:45:34.064 MyApp[7147:707] error: Error Domain=SKErrorDomain Code=3 "Cannot connect to iTunes Store" UserInfo=0x8c1f210 {NSLocalizedDescription=Cannot connect to iTunes Store}
    2012-02-09 17:45:34.065 MyApp[7147:707] User Cancelled Transaction
    2012-02-09 17:45:58:174 MyApp[7147:20747] finished networking setup
Run Code Online (Sandbox Code Playgroud)

让我们退一步看看sceanrio:

这是我的调用代码

- (IBAction)iap:(id)sender {
    NSLog(@"checking if %@ pack is purchased", kFeatureAId);
    if([MKStoreManager isFeaturePurchased:kFeatureAId]) { //unlock it
        NSLog(@"horray, you already purchased this item!");
    } else {
        [[MKStoreManager sharedManager] buyFeature:kFeatureAId
            onComplete:^(NSString* purchasedFeature) {
                NSLog(@"Purchased: %@", purchasedFeature);
            } onCancelled:^ {
                NSLog(@"User Cancelled Transaction");
        }];
    }
}
Run Code Online (Sandbox Code Playgroud)

所以基本上我什么也没做,只是调用购买测试项目.

这是MKStoreConfig.h

#define kConsumableBaseFeatureId @"com.my.company.inapp"                        /* this is the bundle id */
#define kFeatureAId @"com.my.company.testinapp.pack001"                         /* this is the product id */
#define kConsumableFeatureBId @"com.my.company.testinapp.pack001.582046155"     /* this is the product id + product number */
#define FishBasket @"FishBasket"

#define SERVER_PRODUCT_MODEL 4
#define OWN_SERVER @"http://testings.company.my.com/inappscripts"
#define REVIEW_ALLOWED 1

#warning Shared Secret Missing Ignore this warning if you don't use auto-renewable subscriptions
#define kSharedSecret @"d43ecfa9d8b94facfbcfed1eca509dbe"
Run Code Online (Sandbox Code Playgroud)

这些信息应足以分析我的案例情景,如果你需要更多细节,请问我,我很乐意回答.

希望有人可以帮我解决这个问题.:) 提前致谢!

-K-

Mug*_*nth 6

当您收到消息"iTunes中的问题连接产品配置:com.my.company.testinapp.pack001"时,表示您的产品未在iTunes连接上正确配置.

它已经"清除销售"吗?

您是否上传了屏幕截图并将状态标记为"开发者已批准"?

如果这是您的第一个应用程序,您是否已将您的银行和税务报表提交给Apple? - 奇怪的是,如果你不能"合法地"销售产品,IAP将会失败.您的"合同,税务和银行业务"信息应在所有三个部分显示绿色勾选.

希望有所帮助.

- Mugunth(我写过MKStoreKit)