<In App Purchase> how to generate a SKProduct directly
app-store-connect, in-app-purchase, ios
Solution
I use this to buy a product without fetching all the products from iTunes:
- (void)buyProductIdentifier:(NSString *)productIdentifier
{
SKMutablePayment *payment = [[SKMutablePayment alloc] init] ;
payment.productIdentifier = productIdentifier;
[[SKPaymentQueue defaultQueue] addPayment:payment];
}
Problem
recently I working on `IAP`. As you know, when you want to send a payment request, you should call ``` + (id)paymentWithProduct:(SKProduct *)product ``` but I found only way to get product is using `SKProductsRequest`, is there any way to generate `SKProduct` directly? just like the deprecated one, ``` + (id)paymentWithProductIdentifier:(NSString *)identifier ``` The fact is I want a new `SKProduct` object directly using product id. BR, Roger