小编okg*_*kgo的帖子

restoreCompletedTransactions坏了吗?

SDK 4.3中的restoreCompletedTransactions是否已损坏?

我正在尝试恢复我的自动续订订阅.它不会导致对updatedTransactions的回调.这是我的代码.

 {
 ....
 [appDelegate.inapp loadStore];

 [[SKPaymentQueue defaultQueue]  restoreCompletedTransactions];
 ....
 }
Run Code Online (Sandbox Code Playgroud)

期待回调到updatedTransactions,但不接收它.

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
     NSLog(@"IN updatedTransactions,  transaction.transactionState");

    for (SKPaymentTransaction *transaction in transactions)
    {

        switch (transaction.transactionState)
        {
            ...
            ...
            case SKPaymentTransactionStateRestored:
            NSLog(@"IN updatedTransactions,  SKPaymentTransactionStateRestored");
            [self restoreTransaction:transaction];
            break;

        }
    }
}
Run Code Online (Sandbox Code Playgroud)

但我最后接到了这个电话.

-(void) paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue {
}
Run Code Online (Sandbox Code Playgroud)

iphone in-app-purchase

21
推荐指数
3
解决办法
9726
查看次数

MPMoviePlayerViewController使用setDefaultCredential从yahoo托管站点保护URL

我正在使用MPMoviePlayerViewController文档中提到的类似代码.但它不起作用.它说"你没有被授权......".我的服务器托管在雅虎上.网址是这样的.

代码如下

NSURLCredential *credential = [[NSURLCredential alloc] 
                           initWithUser:@"abc" 
                           password:@"xyz"
                           persistence: NSURLCredentialPersistencePermanent];

 NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc]
                                     initWithHost:@"www.someurl.com"
                                     port:80
                                     protocol:@"http"
                                     realm:@"tmp"

   authenticationMethod:NSURLAuthenticationMethodDefault];

[[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential:credential
                                                forProtectionSpace:protectionSpace];

 [protectionSpace release];
 [credential release];
  MPMoviePlayerViewController *movie = [[[MPMoviePlayerViewController alloc] initWithContentURL:url] autorelease];
Run Code Online (Sandbox Code Playgroud)

iphone objective-c ipad

6
推荐指数
1
解决办法
333
查看次数

标签 统计

iphone ×2

in-app-purchase ×1

ipad ×1

objective-c ×1