如何在等待应用内购买商店加载后停止 uiactivityindicator
我认为其中之一可以做到这一点,但没有一个被调用 -_-
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
NSLog(@"flag paymentQueue");
// spinner.hidden=YES; //这去哪儿了?
for (SKPaymentTransaction *transaction in transactions)
{
switch (transaction.transactionState)
{
case SKPaymentTransactionStatePurchasing:
// [self stillPurchasing]; // this creates an alertView and shows
NSLog(@"flag SKPaymentTransactionStatePurchasing");
break;
case SKPaymentTransactionStatePurchased:
NSLog(@"flag SKPaymentTransactionStatePurchased");
[self completeTransaction:transaction];
break;
case SKPaymentTransactionStateFailed:
NSLog(@"flag SKPaymentTransactionStateFailed");
[self failedTransaction:transaction];
break;
case SKPaymentTransactionStateRestored:
NSLog(@"flag SKPaymentTransactionStateRestored");
[self restoreTransaction:transaction];
// spinner.hidden=YES;
break;
谢谢!!!
I thought one of these would do it, none of them are getting called -_-
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
NSLog(@"flag paymentQueue");
// spinner.hidden=YES; //where does this go?
for (SKPaymentTransaction *transaction in transactions)
{
switch (transaction.transactionState)
{
case SKPaymentTransactionStatePurchasing:
// [self stillPurchasing]; // this creates an alertView and shows
NSLog(@"flag SKPaymentTransactionStatePurchasing");
break;
case SKPaymentTransactionStatePurchased:
NSLog(@"flag SKPaymentTransactionStatePurchased");
[self completeTransaction:transaction];
break;
case SKPaymentTransactionStateFailed:
NSLog(@"flag SKPaymentTransactionStateFailed");
[self failedTransaction:transaction];
break;
case SKPaymentTransactionStateRestored:
NSLog(@"flag SKPaymentTransactionStateRestored");
[self restoreTransaction:transaction];
// spinner.hidden=YES;
break;
thanks!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过以下方法隐藏微调器 -
You can hide spinner in following method-
应该不错。在以下 3 种情况下,您应该隐藏微调器:
- SKPaymentTransactionStatePurchased
- SKPaymentTransactionStateFailed
- SKPaymentTransactionStateRestored
您检查过您的代表吗?
你的类应该实现以下委托方法:
-> SKPaymentTransactionObserver
我的声明如下:
@interface InAppPurchaseStoreManager : NSObject
it should be good. You should hide your spinner in the 3 cases :
- SKPaymentTransactionStatePurchased
- SKPaymentTransactionStateFailed
- SKPaymentTransactionStateRestored
Have you checked your delegates ?
your class should implement the delegate method of :
-> SKPaymentTransactionObserver
Mine is declared like that :
@interface InAppPurchaseStoreManager : NSObject