Empty Auto-Renewing iOS In-App purchases from SKProductsRequest initWithProductIdentifiers

Viewed 431

I've made an iOS in-app Auto-Renewable Subscription, now I'm trying to allow users to purchase it in a React-Native app.

I've found react-native-in-app-utils, but can't seem to even load my products. I have 3 "products" (auto-renewable subscriptions) in iTunes connect, but trying to load them with:

var products = [
  'com.xxxx.app.monthly',
  'com.xxxx.app.6months',
  'com.xxxx.app.year',
];

InAppUtils.loadProducts(products, (error, products) => {
  console.log('products:', products);
});

just logs "products: []".

Digging a little deeper, I've added some additional logging to the objective-c code doing the querying, and it looks like:

NSLog(@"loading products %@", productIdentifiers);
if([SKPaymentQueue canMakePayments]){
    SKProductsRequest *productsRequest = [[SKProductsRequest alloc]
                                          initWithProductIdentifiers:[NSSet setWithArray:productIdentifiers]];
    productsRequest.delegate = self;
    _callbacks[RCTKeyForInstance(productsRequest)] = callback;
    [productsRequest start];
} else {
    callback(@[@"not_available"]);
}

Then in the callback:

NSLog(@"products response %@", response.products);
products = [NSMutableArray arrayWithArray:response.products];
NSMutableArray *productsArrayForJS = [NSMutableArray array];     
for(SKProduct *item in response.products) {
    NSDictionary *product = @{
    ...

This will log "loading products" with my product ids, as expected. But then "products response ()"... empty response.

Those products are listed in iTunes connect as "Ready to Submit". And they've been added to the app info under In-App Purchases. What gives? Why aren't the products showing up?

1 Answers
Related