我試圖在應用商店中爲我的新應用程序實現IAP。 這裏是我所做的一切:IOS的IAP不要求我購買該產品,並給我「沒有產品」
- 在iTunes連接和狀態=準備上傳新版本。
- 在「管理應用內購買」中添加新產品
- 創建測試用戶帳戶。
實現流動代碼:
-(IBAction)audio{ //test the restriction if ([SKPaymentQueue canMakePayments]){ SKProductsRequest *skproductrequiste = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObject:@"AudioPlayer"]]; skproductrequiste.delegate = self; [skproductrequiste start]; } //after purshsing youcan show /* detailViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"show_pro"]; detailViewController.product = @"audio"; [self.navigationController pushViewController:detailViewController animated:YES]; */ } -(void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response{ SKProduct *validproducte = nil; int count = [response.products count]; if (count >0) { validproducte = [response.products objectAtIndex:0]; SKPayment *pay = [SKPayment paymentWithProductIdentifier:@"AudioPlayer"]; [[SKPaymentQueue defaultQueue] addTransactionObserver:self]; [[SKPaymentQueue defaultQueue]addPayment:pay]; } else{NSLog(@"no product");} } -(void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions{ for(SKPaymentTransaction *transiction in transactions){ switch (transiction.transactionState) { case SKPaymentTransactionStatePurchasing: break; case SKPaymentTransactionStatePurchased: NSLog(@"dobe buying"); [[SKPaymentQueue defaultQueue]finishTransaction:transiction]; break; case SKPaymentTransactionStateRestored: break; case SKPaymentTransactionStateFailed: break; } } }
之前測試我在實際設備應用程序,我退出應用程序的store.then運行應用程序,並按下了音頻IBAction爲,但它給了我「沒有產品「。它甚至沒有要求我登錄應用商店。 這裏有什麼問題?此外,我想知道如何保存客戶購買案例,如果他們刪除了應用程序並重新安裝?
在此先感謝。
我寫的,我測試在實際設備應用.. –