EDIT3:SOLVED
inAppPurchase doesn't work on jailbreak devices! (at least the sandbox testing)
EDIT2: Now I know why the response wasn't getting through: It was a network malfunction on the iPhone. When the network connection is up but not getting through any data the productRequest never gets a response.
Meanwhile I'm still getting an invalid product ID. Any help?
EDIT: Update: After trying adding new test user accounts and using them (and deleting/reinstalling the app over and over I now get Invalid Product...) What's wrong? What's missing?
I'm trying to implemente inAppPurchase system and it's been a pain!
After keep getting invalid product ID's I went through the following list:
[CHECKED] Have you enabled In-App Purchases for your App ID?
[CHECKED] Have you checked Cleared for Sale for your product?
[CHECKED] Have you submitted (and optionally rejected) your application binary?
[CHECKED] Does your project’s .plist Bundle ID match your App ID?
[CHECKED] Have you generated and installed a new provisioning profile for the new App ID?
[CHECKED] Have you configured your project to code sign using this new provisioning profile?
[CHECKED]开发者_如何转开发 Are you building for iPhone OS 3.0 or above?
[CHECKED] Are you using the full product ID when when making an SKProductRequest?
[CHECKED - a week now] Have you waited several hours since adding your product to iTunes Connect?
[CHECKED - received payments] Are your bank details active on iTunes Connect? (via Mark)
[THIS is where the problem arised] Have you tried deleting the app from your device and reinstalling? (via Hector, S3B, Alex O, Joe, and Alberto)
----> And now the delegate doesn't seem to work....?? I don't get my @"didReceiveResponse" on the console but i do get the @"clicked and handling" (Code below)
@implementation InAppHandler
- (void)requestProUpgradeProductData
{
NSLog(@"clicked and handling");
NSSet *productIdentifiers = [NSSet setWithObject:@"pastedFromiTunesConnect"];
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
{
NSLog(@"didReceiveResponse");
NSArray *products = response.products;
proUpgradeProduct = [products count] == 1 ? [[products objectAtIndex:0] 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];
}
@end
As anyone got this before? Thanks!
inAppPurchase doesn't work on some jailbreak devices (seems that can have something to do with AppSync)! (the sandbox testing doesn't work that is)
InAppPurchase works on jailbreak devices! You just need to remove AppSync from your JailBreak device till testing.
精彩评论