无效的产品id:IOS中的应用内购买

无效的产品id:IOS中的应用内购买,ios,xcode,in-app-purchase,itunes,Ios,Xcode,In App Purchase,Itunes,您好,我在测试IAP功能时遇到了一个真正的问题。有人能告诉我如何解决这个问题吗 这是我的密码 -(IBAction)purchase:(id)sender{ SKProduct *skProduct = _products[0]; NSLog(@"Found product: %@ %@ %0.2f", skProduct.productIdentifier, skProduct.localizedTitle, skProduct.price.floatVa

您好,我在测试IAP功能时遇到了一个真正的问题。有人能告诉我如何解决这个问题吗

这是我的密码

-(IBAction)purchase:(id)sender{

SKProduct *skProduct = _products[0];
NSLog(@"Found product: %@ %@ %0.2f",
      skProduct.productIdentifier,
      skProduct.localizedTitle,
      skProduct.price.floatValue);

NSString *tempTitle = NSLocalizedString(@"InAppTitle", @"Message");
NSString *tempMessage = NSLocalizedString(@"InAppText", @"Message");
NSString *tempRestoreBtn = NSLocalizedString(@"Restore", @"Message");
NSString *tempPurchaseBtn = NSLocalizedString(@"Purchase", @"Message");
NSString *tempCancelBtn = NSLocalizedString(@"Cancel", @"Message");

NSString *temp = [NSString stringWithFormat:tempMessage,skProduct.localizedTitle,skProduct.price.floatValue];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:tempTitle message:temp delegate:self cancelButtonTitle:tempCancelBtn otherButtonTitles:tempRestoreBtn,tempPurchaseBtn, nil];
alert.tag = 456;
[alert show];
}

我的静电计

#define AdmobBannerAdsID  @"ca-app-pub-xxxxxxxxxxxxxxxxxxxxxxxxxx"

#define AdmobFullScreenAdsID @"ca-app-pub-xxxxxxxxxxxxxxxxxxxxxxxxxx"

#define ProductIdentifiers @"com.7minute.workout.zerone.remove"
这是我在itunes Connect中的产品id:

这是我的包标识符

调试区

2017-01-10 07:24:52.823 7分钟训练[39958:433489]已加载产品列表。。。 2017-01-10 07:24:52.824 7分钟训练[39958:433489]无效的产品id:com.7minute.workout.zerone.remove 2017-01-10 07:24:57.440 7分钟训练[39958:433489]*由于未捕获的异常“NSRangeException”而终止应用程序,原因:“*-[NSArray0 objectAtIndex::]:索引0超出空NSArray的界限” ***第一次抛出调用堆栈: ( 0 CoreFoundation 0x0000000105ecbd4b例外预处理+171 1 libobjc.A.dylib 0x000000010592821e objc_异常_抛出+48 2 CoreFoundation 0x0000000105ee37dd-[\uu NSArray0 objectAtIndex:][93 3 7分钟训练0x000000010226e4ff-[设置购买:]+79 4 UIKit 0x00000001024c18bc-[UIApplication sendAction:to:from:forEvent:+83 5 UIKit 0x0000000102647c38-[UIControl发送操作:发送到:forEvent:+67 6 UIKit 0x0000000102647f51-[UIControl\u发送操作预防:withEvent:+444 7 UIKit 0x0000000102646e4d-[UIControl触摸已终止:withEvent:][668 8 UIKit 0x000000010252f545-[UIWindow\u sendTouchesForEvent:+2747 9 UIKit 0x0000000102530c33-[UIWindow sendEvent:+4011 10 UIKit 0x00000001024dd9ab-[UIApplication sendEvent:+371 11 UIKit 0x0000000102cca72d uuu调度预处理事件RomeventQueue+3248 12 UIKit 0x0000000102cc3463\uuuu handleEventQueue+4879 13 CoreFoundation 0x0000000105e70761\uuu CFRUNLOOP\u正在调用\u OUT\u以执行\u SOURCE0\u函数+17 14 CoreFoundation 0x0000000105e5598c\uu CFRunLoopDoSources0+556 15 CoreFoundation 0x0000000105e54e76_u CFRunLoopRun+918 16 CoreFoundation 0x0000000105e54884 CFRunLoopRunSpecific+420 17图形服务0x0000000107e7fa6f GSEventRunModal+161 18 UIKit 0x00000001024bfc68 UIApplicationMain+159 19 7分钟训练0x0000000102272a3f干管+111 20 libdyld.dylib 0x0000000109b1068d启动+1 ) libc++abi.dylib:以NSException类型的未捕获异常终止 (lldb)


您是否检查了
\u产品
,是否至少有一个元素?@nynohu是我检查了您是否检查了
\u产品
,是否至少有一个元素?@nynohu是我检查了