We are developing an application that (in turn) is used when purchasing applications (IAP). I did everything in the manual to enable iap, and everything works fine until I want to make a purchase.
Some of the code:
MainViewController.m
-(void)viewDidLoad { if ([SKPaymentQueue canMakePayments]) { MyStoreObserver *observer = [[MyStoreObserver alloc] init]; [[SKPaymentQueue defaultQueue] addTransactionObserver:observer]; SKProductsRequest *request= [[SKProductsRequest alloc] initWithProductIdentifiers: [NSSet setWithObjects: @"com.company.app.product1", @"com.company.app.product1", nil]]; request.delegate = self; [request start]; } }; -(void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response { for (SKProduct *prod in response.products) { NSLog(@"%@ (%@)", prod.localizedTitle, prod.price); } [request release]; }; -(IBAction)clickBuy:(UIButton *)__sender { SKPayment *payment = [SKPayment paymentWithProductIdentifier:@"com.company.app.product1"]; [[SKPaymentQueue defaultQueue] addPayment:payment]; };
MyStoreObserver.m
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { for (SKPaymentTransaction *transaction in transactions) { switch (transaction.transactionState) { case SKPaymentTransactionStatePurchased: NSLog(@"SKPaymentTransactionStatePurchased"); break; case SKPaymentTransactionStateFailed: NSLog(@"SKPaymentTransactionStateFailed"); break; case SKPaymentTransactionStateRestored: NSLog(@"SKPaymentTransactionStateRestored"); break; case SKPaymentTransactionStatePurchasing: NSLog(@"SKPaymentTransactionStatePurchasing"); default: break; } } };
Delegate method productRequest: shows 2 products with their name / price. How I entered the iTunes connect site.
But as soon as I click the Buy button, a dialog box does not appear or does not ask for my credentials. Only "SKPaymentTransactionStatePurchasing" is recorded.
And I:
-... left in the settings panel / store
-... I use the right training profiles
-... desperately
Is anyone
basvk source share