首页 文章

通过应用内购买解决无效的产品ID问题?

提问于
浏览
18

这是“In app purchases with MKStoreKit failing: “Problem in iTunes connect configuration for product: xxx”的后续问题

我有一个类似的问题,并尝试使用和不使用MKStoreKit做两件事并获得类似的消息 .

Check-list

感谢:http://troybrant.net/blog/2010/01/invalid-product-ids/

您是否为应用程序ID启用了应用程序内购买?

你有没有检查过你的产品清仓?

您是否已提交(并可选择拒绝)应用程序二进制文件?

您的项目的.plist捆绑ID是否与您的应用ID相匹配?

您是否为新的App ID生成并安装了新的配置文件?

您是否已使用此新配置文件将项目配置为代码签名?

您是为iPhone OS 3.0或更高版本构建的吗?

是 . iOS4.2及以上 .

您在制作SKProductRequest时是否使用完整的产品ID?

是 . 也只是没有反向域的产品ID本身

自从将产品添加到iTunes Connect后,您有几个小时的时间吗?

是 . 它说“等待审查”并且已经过去4-5天了

您的银行详细信息是否在iTunes Connect上有效?

没有 . 这是一个客户端项目,我只测试它是否正常工作 . 我需要银行详细信息来测试它吗?

编辑:我现在改变了 . 但我不明白为什么我只需要测试沙盒就可以做到这一点 .

您是否尝试从设备中删除该应用并重新安装?

你的设备越狱了吗?

没有


App notation is correct

我见过的一些例子使用了这种表示法:com.domain.APP_ID.PRODUCT_TO_BUY

但其他人使用com.domain.PRODUCT_TO_BUY

哪个是对的?

在我的代码中,我尝试使用完整的符号和产品ID本身,但仍然遇到“无效的产品ID”的相同问题 .

Developer rejected

App Bundle(发布)在iTunes Connect上,我有“开发者拒绝”这个包 .

图片:
App developer rejected

Waiting for review?

在我的应用内购买中,我有1个产品,一个可自动更新的订阅 . 它已被清除出售;然而,它是“等待审查”并且不是绿灯 .

图片:

waiting for review

我差不多4-5天前创建了它,它仍然被标记为“等待审查”?

我想知道我的应用程序是否被“开发者拒绝”是否会影响自动续订订阅的“等待审核”?

我没有改变这个项目的任何内容 .

根据各种文章,我必须等待24-48小时才可以使用它?

但是,在我可以在测试中使用它之前,是否需要等待接受或绿灯?

Bank details

我没有填写任何银行详细信息,因为这是一个客户端的应用程序 - 我是否需要填写银行详细信息才能继续测试?

根据这些文档:http://developer.apple.com/library/ios/#technotes/tn2259/_index.html需要银行详细信息吗?

Do I need to be logged into iTunes on my device under a test account before running the app?

我想知道是否有人可以澄清这些问题?也许就像等待应用内购买“绿灯”一样简单,或者我错过了一步?

注意:无论我使用MKStoreKit还是使用后面的代码,都会发生这种情况 .

谢谢 .

我的代码(这是非MKStoreKit版本)

#define kMySubscriptionFeature @"uk.co.samplewebsite.myappproject.sub1"

    - (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.title = @"Manage Subscriptions";


    if ([SKPaymentQueue canMakePayments])
    {
        // Display a store to the user.

        //[MKStoreManager sharedManager];
        //NSLog(@"purhcasable = %@", [[MKStoreManager sharedManager] purchasableObjectsDescription] );
        [self requestProUpgradeProductData];

    }
    else
    {
        // Warn the user that purchases are disabled.
        NSString *message = @"In-app purchases are disabled. Please review your settings";
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error" message:message delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
        [alertView show];
        [alertView release];
    } // end if
}


#pragma mark - StoreKit Delegate

- (void) requestProductData
{
    SKProductsRequest *request= [[SKProductsRequest alloc] initWithProductIdentifiers: [NSSet setWithObject:kMySubscriptionFeature]];
    request.delegate = self;
    [request start];
}

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
    NSArray *myProduct = [[NSArray alloc] initWithArray:response.products];

    for(SKProduct *item in myProduct)
    {

        NSLog(@"Product title: %@" , item.localizedTitle);
        NSLog(@"Product description: %@" , item.localizedDescription);
        NSLog(@"Product price: %@" , item.price);
        NSLog(@"Product id: %@" , item.productIdentifier);
    }


    for (NSString *invalidProductId in response.invalidProductIdentifiers)
    {
        NSLog(@"Problem in iTunes connect configuration for product: %@" , invalidProductId);
    }


    [myProduct release];

    // populate UI
    [request autorelease];
}

编辑:

作为故障保险,我已添加银行详细信息以防万一,但我不明白为什么这会导致问题 .

我还确保上传并拒绝了应用发布包而不是adhoc;虽然我不知道这是否有所不同 .

5 回答

  • 11

    经过2天的等待,新的应用程序ID,配置文件等,这为我修好了..

    为什么文档说使用完整的com.iap.isrubbish语法?

    谢谢你的帮助

    我替换了:定义kMySubscriptionFeature @“uk.co.somesite.someapp.sub1”:define kMySubscriptionFeature @“sub1”

  • 1

    我想我现在已经做到了 . 我要做一些测试只是为了确保 .

    这还不会被接受;我正在使用不同的storekit框架运行一些测试 .

    我的输出:

    2011-10-27 15:17:49.297 My Simple App[7376:707] productsRequest
    2011-10-27 15:17:49.298 My Simple App[7376:707] Product title: Simple subscription
    2011-10-27 15:17:49.299 My Simple App[7376:707] Product description: Subscribe and get the latest content to your iPhone or iPod Touch device
    2011-10-27 15:17:49.299 My Simple App[7376:707] Product price: 2.99
    2011-10-27 15:17:49.300 My Simple App[7376:707] Product id: sub1
    

    这就是我做的 .

    • 我添加了银行详细信息 . 我仍然认为这与它无关 .

    • 注意 . 该应用程序的应用内购买仍然是“等待审核”,我得到了上述输出 .

    • 我换了:

    #define kMySubscriptionFeature @"uk.co.somesite.someapp.sub1"

    有:

    #define kMySubscriptionFeature @"sub1"
    

    我将使用MKStoreKit和其他框架运行一些测试,看看它是否正常 .

    我使用的代码如下,出于安全原因进行了编辑:

    .h文件

    //  ManageSubscriptionsVC.h
    //  This doesn't have visual output, just NSLog at the moment
    //  This doesn't use MKStoreKit yet
    
    #import <UIKit/UIKit.h>
    #import "StoreKit/StoreKit.h"
    
    #define kMySubscriptionFeature @"sub1"
    
    /*
     Shared Secret
    
     A shared secret is a unique code that you should use when you make the 
     call to our servers for your In-App Purchase receipts. 
     Without a shared secret, you will not be able to test auto-renewable 
     In-App Purchase subscriptions in the sandbox mode. 
    
     Also note that you will not be able to make them available 
     on the App Store.
    
     Note: Regardless of what app they are associated with, 
     all of your auto-renewable subscriptions will use this 
     same shared secret.
     */
    #define sharedSecret @"PUTSHAREDSECRETHERE"
    
    
    @interface ManageSubscriptionsVC : UIViewController
    <SKProductsRequestDelegate, SKProductsRequestDelegate, SKPaymentTransactionObserver>
    {
        SKProduct *proUpgradeProduct;
        SKProductsRequest *productsRequest;
    }
    
    - (void)requestProUpgradeProductData;
    
    @end
    

    .m文件

    //
    //  ManageSubscriptionsVC.m
    
    #import "ManageSubscriptionsVC.h"
    
    @implementation ManageSubscriptionsVC
    
    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
    {
        self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
        if (self) {
            // Custom initialization
        }
        return self;
    }
    
    - (void)didReceiveMemoryWarning
    {
        // Releases the view if it doesn't have a superview.
        [super didReceiveMemoryWarning];
    
        // Release any cached data, images, etc that aren't in use.
    }
    
    #pragma mark - View lifecycle
    
    - (void)viewDidLoad
    {
        [super viewDidLoad];
        // Do any additional setup after loading the view from its nib.
        self.title = @"Manage Subscriptions";
    
    
        if ([SKPaymentQueue canMakePayments])
        {
            // Display a store to the user.
    
            //[MKStoreManager sharedManager];
            //NSLog(@"purhcasable = %@", [[MKStoreManager sharedManager] purchasableObjectsDescription] );
            [self requestProUpgradeProductData];
    
        }
        else
        {
            // Warn the user that purchases are disabled.
            NSString *message = @"In-app purchases are disabled. Please review your settings";
            UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error" message:message delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
            [alertView show];
            [alertView release];
        } // end if
    }
    
    - (void)viewDidUnload
    {
        [super viewDidUnload];
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
    }
    
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        // Return YES for supported orientations
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    }
    
    #pragma mark - StoreKit Delegate
    
    - (void) requestProductData
    {
        NSLog(@"requestProductData");
        SKProductsRequest *request= [[SKProductsRequest alloc] initWithProductIdentifiers: [NSSet setWithObject:kMySubscriptionFeature]];
        request.delegate = self;
        [request start];
    }
    
    - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
    {
        NSLog(@"productsRequest");
    
        NSArray *myProduct = [[NSArray alloc] initWithArray:response.products];
    
        for(SKProduct *item in myProduct)
        {
    
            NSLog(@"Product title: %@" , item.localizedTitle);
            NSLog(@"Product description: %@" , item.localizedDescription);
            NSLog(@"Product price: %@" , item.price);
            NSLog(@"Product id: %@" , item.productIdentifier);
    
    
        }
    
        /*
        for(NSString *invalidProduct in response.invalidProductIdentifiers)
            NSLog(@"Problem in iTunes connect configuration for product: %@", invalidProduct);
        */
    
        for (NSString *invalidProductId in response.invalidProductIdentifiers)
        {
            NSLog(@"Problem in iTunes connect configuration for product: %@" , invalidProductId);
        }
    
    
        [myProduct release];
    
        // populate UI
        [request autorelease];
    }
    
    #pragma mark - PaymentQueue
    
    -(void)paymentQueue:(SKPaymentQueue *)queue removedTransactions:(NSArray *)transactions
    {
    }
    
    -(void)paymentQueue:(SKPaymentQueue *)queue restoreCompletedTransactionsFailedWithError:(NSError *)error
    {
    }
    
    -(void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
    {
    }
    
    -(void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue
    {
    }
    
    #pragma mark - Other
    
    
    - (void)requestProUpgradeProductData
    {
        NSSet *productIdentifiers = [NSSet setWithObject:kMySubscriptionFeature];
        productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:productIdentifiers];
        productsRequest.delegate = self;
        [productsRequest start];
    
        // we will release the request object in the delegate callback
    }
    
    
    
    
    
    @end
    
  • 6

    我刚刚发现我在创建应用内购买时交换了产品ID和引用名称,所以在我的情况下我使用了错误的字符串来尝试找到产品......难以发现 .

  • 0

    我在app-purchase中测试了现有的,功能齐全的应用程序的最新版本,以确保功能仍然按预期工作,当我开始看到iTunes连接消息中的问题时 . 我的问题是(我忘了)MKStoreKit在我的各种设备的钥匙串上存储了购买的事实,所以即使我使用的是新用户帐户,我的钥匙串也在注册已购买的设备 . [self removeAllKeychainData]从MKStoreManager中修复了麻烦 . 希望这可以节省一些人的挫败感 .

  • 1

    我的问题是,我已使用真正的苹果ID登录设备 . 然后退出(Iphone->设置 - >应用程序商店 - >我的ID->退出)然后再次部署,并欢呼它工作 .

    谢谢大家在网上 .

相关问题