MKStoreKit 非消耗性连接和 NSUbiquitousKeyValueStore 均失败

发布于 2025-01-04 01:36:52 字数 2593 浏览 0 评论 0原文

我正在尝试将应用程序内购买添加到我的应用程序中,因此在浏览互联网后我决定使用 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

让我们退一步看一下场景:

这是我的调用代码

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

所以基本上我除了调用测试项目的购买之外什么也没做。

这是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"

这些信息足以对我的案例场景进行分析,如果您需要更多详细信息,请询问,我很乐意回答。

希望有人能帮助我解决这个问题。 :) 提前致谢!

-k-

I'm trying to add the in app purchase to my app, so after wondering around the interwebs I decided to go fot MKStoreKit, everything is now set, the project looks ok, files that should be on the server, are actually on the server and all this kind of stuff.

The mess kicks in when I run the app on the device and I push the test button "Buy".
Firstly this is the result I get.

    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

Let's make a step back to give a look to the sceanrio:

This is my invocation Code

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

So basically I'm doing nothing than invoking the purchase of a test item.

This is the 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"

these infos shall suffice to make an analysis of my case scenario, if you need more details, just ask and I'll be glad to answer.

Hope someone could help me out with this. :)
thanks in advance!

-k-

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白衬杉格子梦 2025-01-11 01:36:52

当您收到消息“产品的 iTunes 连接配置出现问题:com.my.company.testinapp.pack001”时,这意味着您的产品在 iTunes 连接上配置不正确。

是否已经“清仓出售”?

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

如果这是您的第一个应用程序,您是否向 Apple 提交了银行和税务报表? - 奇怪的是,如果你不能“合法”销售产品,IAP就会失败。您的“合同、税务和银行”信息应在所有三个部分上显示绿色勾号。

希望有帮助。

--
Mugunth(我写了 MKStoreKit)

When you get the message, "Problem in iTunes connect configuration for product: com.my.company.testinapp.pack001", it means, your product is not configured properly on iTunes connect.

Is it already "Cleared for sale"?

Have you uploaded a screenshot and marked the state as "Developer approved"?

If this is your first app, have you submitted your banking and tax statements to Apple? - Strangely, IAP will fail if you cannot "legally" sell products. Your "Contracts, Tax and Banking" information should show a green tick on all three sections.

Hope that helps.

--
Mugunth (I wrote MKStoreKit)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文