SKStoreProductViewController不能在iPad ios8上工作

时间:2023-01-12 21:48:26

I'm using SKStoreProductViewController on iPad with iOS 8. Pressing a button opens an instance of it:

我在iPad上使用SKStoreProductViewController和ios8。按下按钮就会打开一个实例:

[self.storeProductViewController loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier:appStoreIdNumber}
                completionBlock:^(BOOL result, NSError *error) {...}];
[[self getPresentingViewController] presentViewController:self.storeProductViewController animated:YES completion:^{...}];

It pops up the first time fine. But after it is dismissed, pressing the button again to reopen it throws an exception and the pop up never appears.

这是第一次。但当它被取消后,再次按下按钮重新打开它会抛出一个异常,弹出窗口永远不会出现。

<SKRemoteProductViewController: 0x15c1ec00> timed out waiting for fence barrier from com.apple.ios.StoreKitUIService

Anyone know what's going on or how to work around it?

有人知道是怎么回事吗?

4 个解决方案

#1


0  

I've also had some other problems with UIAppearance and StoreKit not working together (see StoreKit's SKStoreProductViewController leaving space between the nav bar and the view?)

我还遇到过UIAppearance和StoreKit不能协同工作的其他问题(参见StoreKit的SKStoreProductViewController在导航条和视图之间留下空间吗?)

I was having the same problem that you now have and removing all UIAppearance code fixed it, but I noticed that the SKStoreProductViewController won't load any iPad apps on an iPhone on iOS 8 and it will fail silently. Let me know if you have the same problem.

我有同样的问题,你现在有并删除所有的UIAppearance代码修复了它,但是我注意到SKStoreProductViewController不会在iOS 8上的iPhone上加载任何iPad应用它会无声地失败。如果你有同样的问题,请告诉我。

#2


0  

I had the same problem, where the first time I present the SKRemoteProductViewController it works fine, but subsequent presentations give the error as the OP described. Apparently the problem is related to presenting the same SKRemoteProductViewController more than once. If I dispose of the SKRemoteProductViewController after presenting it and then re-load another one each time I want it to present again then things work without issue.

我遇到了同样的问题,当我第一次展示SKRemoteProductViewController时,它工作得很好,但是后续的展示会像OP描述的那样给出错误。显然,问题与多次显示同一个SKRemoteProductViewController有关。如果我在显示SKRemoteProductViewController之后处理它,然后在每次我想让它再次显示时重新加载另一个视图那么事情就可以正常工作了。

#3


0  

Had this problem as well. Make sure that identifier is actually an NSString

也有这个问题。确保标识符实际上是一个NSString。

@{ SKStoreProductParameterITunesItemIdentifier : identifier }

I was inadvertently passing an NSURL object, which resulted in the same error -- "timed out waiting for fence barrier from com.apple.ios.StoreKitUIService"

我无意中传递了一个NSURL对象,这导致了同样的错误——“超时等待com.apple.ios.StoreKitUIService的围栏。”

#4


0  

you should present SKStoreProductViewController before loading it

在加载SKStoreProductViewController之前,应该先显示skviewcontroller

#1


0  

I've also had some other problems with UIAppearance and StoreKit not working together (see StoreKit's SKStoreProductViewController leaving space between the nav bar and the view?)

我还遇到过UIAppearance和StoreKit不能协同工作的其他问题(参见StoreKit的SKStoreProductViewController在导航条和视图之间留下空间吗?)

I was having the same problem that you now have and removing all UIAppearance code fixed it, but I noticed that the SKStoreProductViewController won't load any iPad apps on an iPhone on iOS 8 and it will fail silently. Let me know if you have the same problem.

我有同样的问题,你现在有并删除所有的UIAppearance代码修复了它,但是我注意到SKStoreProductViewController不会在iOS 8上的iPhone上加载任何iPad应用它会无声地失败。如果你有同样的问题,请告诉我。

#2


0  

I had the same problem, where the first time I present the SKRemoteProductViewController it works fine, but subsequent presentations give the error as the OP described. Apparently the problem is related to presenting the same SKRemoteProductViewController more than once. If I dispose of the SKRemoteProductViewController after presenting it and then re-load another one each time I want it to present again then things work without issue.

我遇到了同样的问题,当我第一次展示SKRemoteProductViewController时,它工作得很好,但是后续的展示会像OP描述的那样给出错误。显然,问题与多次显示同一个SKRemoteProductViewController有关。如果我在显示SKRemoteProductViewController之后处理它,然后在每次我想让它再次显示时重新加载另一个视图那么事情就可以正常工作了。

#3


0  

Had this problem as well. Make sure that identifier is actually an NSString

也有这个问题。确保标识符实际上是一个NSString。

@{ SKStoreProductParameterITunesItemIdentifier : identifier }

I was inadvertently passing an NSURL object, which resulted in the same error -- "timed out waiting for fence barrier from com.apple.ios.StoreKitUIService"

我无意中传递了一个NSURL对象,这导致了同样的错误——“超时等待com.apple.ios.StoreKitUIService的围栏。”

#4


0  

you should present SKStoreProductViewController before loading it

在加载SKStoreProductViewController之前,应该先显示skviewcontroller