19

这是“在 MKStoreKit 失败的应用程序购买中出现的问题”的后续问题:“产品的 iTunes 连接配置问题:xxx ”

我遇到了类似的问题,并尝试使用和不使用 MKStoreKit 并得到类似的消息。

清单

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

您是否为您的 App ID 启用了应用内购买?

是的

您是否为您的产品检查过清仓?

是的

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

是的

您项目的 .plist Bundle ID 是否与您的 App ID 匹配?

是的

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

是的

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

是的

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

是的。iOS4.2 及以上。

您在发出 SKProductRequest 时是否使用了完整的产品 ID?

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

将产品添加到 iTunes Connect 后,您是否等待了几个小时?

是的。它说“等待审核”并且在过去 4-5 天内完成

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

不。这是一个客户项目,我只是在测试它是否有效。我需要银行详细信息来测试吗?

编辑:我现在已经改变了。但我不明白为什么我需要这样做只是为了测试沙盒。

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

是的

你的设备越狱了吗?


应用符号是正确的

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

但其他人使用 com.domain.PRODUCT_TO_BUY

哪个是对的?

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

开发者被拒绝

App Bundle (Release) 在 iTunes Connect 上,我已经“开发者拒绝”了这个包。

图片: 应用开发者被拒绝

等待审核?

在我的应用内购买中,我有 1 个产品,即自动续订订阅。已获准出售;然而,它是“等待审查”并且不是绿灯。

图片:

等待审核

我几乎在 4-5 天前创建了它,但它仍然标记为“等待审核”??

我想知道我的应用是否被“开发者拒绝”,这是否对自动更新订阅的“等待审核”有影响?

我没有更改此项目中的任何内容。

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

但是我是否需要等待它被接受或绿灯才能在我的测试中使用它?

银行明细

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

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

在运行应用程序之前,我是否需要在我的设备上使用测试帐户登录 iTunes?

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

注意:无论我是使用 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];
}

编辑:

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

我还确保我上传并拒绝了应用程序发布包,而不是临时发布包;虽然我不知道这是否有任何区别。

4

5 回答 5

11

经过 2 天的等待,新的应用程序 ID、配置文件等为我修复了它。

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

谢谢你的帮助

我更换了:

定义 kMySubscriptionFeature @"uk.co.somesite.someapp.sub1"

和:

定义 kMySubscriptionFeature @"sub1"

于 2012-11-26T00:25:38.230 回答
6

我想我现在已经做到了。我将进行一些测试以确保。

这还不会被接受。我正在使用不同的 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

这就是我所做的。

  1. 我添加了我的银行详细信息。我仍然不认为这与它有任何关系。

  2. 笔记。该应用的应用内购买仍然是“等待审核”,我得到了上述输出。

  3. 我更换了:

    #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
于 2011-10-27T14:31:15.693 回答
1

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

于 2013-01-31T12:40:50.133 回答
1

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

于 2013-04-30T20:49:48.233 回答
0

我的问题是,我使用真实的苹果 ID 登录了设备。然后退出(Iphone->设置-> App Store->我的ID->退出)然后再次部署,并且欢呼它工作。

感谢网络上的每一个人。

于 2016-10-25T14:55:09.037 回答