【问题标题】:SKStoreProductViewController display apps from developerSKStoreProductViewController 显示来自开发人员的应用程序
【发布时间】:2013-12-19 07:34:24
【问题描述】:

我正在使用SKStoreProductViewController 来实现“更多应用程序”功能,但是当我点击列表中的产品时,我只得到空白屏幕,控制台中还有一个警告:

无法请求视图控制器:错误域=_UIViewServiceInterfaceErrorDomain Code=2“操作无法完成。(_UIViewServiceInterfaceErrorDomain 错误 2.)”

这仅在 ios 7 上发生,在 ios 6 中它只是重定向到应用商店,这是我的代码:

SKStoreProductViewController *productVC = [[SKStoreProductViewController alloc] init];
productVC.delegate = self;
NSDictionary *productParameters = @{ SKStoreProductParameterITunesItemIdentifier :  <itunes developer ID>};
[productVC loadProductWithParameters:productParameters completionBlock:^(BOOL result, NSError *error) {
    if(error)
    {
       [[UIAlertView alloc] initWithTitle:[error localizedDescription]
                                                            message:nil
                                                           delegate:nil
                                                  cancelButtonTitle:@"Ok"
                                                  otherButtonTitles:nil, nil] show];


    }

    if (result )
    {
        [self presentViewController:productVC animated:NO completion:nil];
    }

}];

我认为这是 ios 7 错误,任何帮助都非常有用

【问题讨论】:

  • 似乎在 iOS8 上工作! :)
  • 完美运行。有人可以告诉我在 iTunesConnect 或 developer.apple.com 中哪里可以找到 吗?我是通过从 iTunes 复制链接获得的,该链接仅在 AppStore 上提交一个或多个应用程序时有效。如果我要去我的第一个应用程序怎么办,那么我怎样才能获得 ??

标签: ios iphone ios7


【解决方案1】:

这是 iOS 7 中的一个错误。请参阅https://devforums.apple.com/message/951745(需要 Apple 开发人员登录),其中一名 Apple 员工确认“SKSPVC 目前不支持此功能。目前仅支持显示单个产品。”

很烦人,因为这曾经很有效,而且是公司向用户展示其其他应用的好方法。回到绘图板!

【讨论】:

  • 这整个问题让我有点发疯,所以我创建了一个新组件,它显示产品列表(您自己提供它们,而不是显示给定公司的所有产品)以及当用户点击时一、SKSPVC用于显示:github.com/thoughtbot/MultiProductViewer
【解决方案2】:

如果您使用的是模拟器,则 Inapp 购买 (storekit) 将无法在 ios7 中使用,而只能在 ios6 中使用。

在这里查看 - How to test IAP (in-app purchase) in iOS Simulator OR on the Device?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-07-17
    • 1970-01-01
    • 1970-01-01
    • 2014-07-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多