代碼如下 - 這個代碼昨天工作正在提供無效的ID現在不再工作,我已經受夠了代碼的10倍左右SKProductsRequest - 無應答現在(是工作 - 同樣的代碼)
.M
#import <UIKit/UIKit.h>
#import <StoreKit/StoreKit.h>
@interface InAppViewController : UIViewController <SKProductsRequestDelegate, SKPaymentTransactionObserver> {
SKProduct *proUpgradeProduct;
SKProductsRequest *productsRequest;
}
.H
#import "InAppViewController.h"
@implementation InAppViewController
- (void)viewDidLoad{
[self requestProUpgradeProductData];
}
- (void)dealloc {
[super dealloc];
}
- (void)requestProUpgradeProductData
{
NSLog(@"called productsRequest");
NSSet *productIdentifiers = [NSSet setWithObject:@"com.okz8.investor.gem15" ];
productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:productIdentifiers];
productsRequest.delegate = self;
[productsRequest start];
// we will release the request object in the delegate callback
}
#pragma mark -
#pragma mark SKProductsRequestDelegate methods
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
NSArray *products = response.products;
proUpgradeProduct = [products count] == 1 ? [[products firstObject] retain] : nil;
if (proUpgradeProduct)
{
NSLog(@"Product title: %@" , proUpgradeProduct.localizedTitle);
NSLog(@"Product description: %@" , proUpgradeProduct.localizedDescription);
NSLog(@"Product price: %@" , proUpgradeProduct.price);
NSLog(@"Product id: %@" , proUpgradeProduct.productIdentifier);
}
for (NSString *invalidProductId in response.invalidProductIdentifiers)
{
NSLog(@"Invalid product id: %@" , invalidProductId);
}
// finally release the reqest we alloc/init’ed in requestProUpgradeProductData
[productsRequest release];
//[[NSNotificationCenter defaultCenter] postNotificationName:kInAppPurchaseManagerProductsFetchedNotification object:self userInfo:nil];
}
這只是不返回響應我所做的一切都在這裏http://troybrant.net/blog/2010/01/invalid-product-ids/
是越來越無效的ID現在我這裏沒有得到任何
在應用程序購買不工作在模擬器。 – damithH 2014-03-12 09:37:31