AlexDisler / cordova-plugin-inapppurchase

A lightweight cordova plugin for in app purchases on iOS/Android
316 stars 192 forks source link

[IOS] getProducts() returns empty array in production mode! Help :-( #221

Closed Defcon0 closed 6 years ago

Defcon0 commented 6 years ago

I just got my app into the Apple AppStore but now my in-app-purchases which are auto-renewable subscriptions don’t work. The inAppPurchase-plugin returns no products in the production environment.

I searched Google for help, but all I have to do seems to be done already:

Create a paid Applications contract Get in app purchase products approved Do I have to somehow assign them to my app or something? In sandbox mode everything works like a charm.

Since the issue is urgent, I highly appreciate every help!!

Please include:

Your code / steps to reproduce

function initProducts() {
    var products = [];

    // init the store
    var productsToBeRegistered = [];

    angular.forEach(appConstants.products, function(productObj) {
        productsToBeRegistered.push(productObj.id);
    });

        inAppPurchase.getProducts(productsToBeRegistered).then(function (products) {
// products is empty array
// ...

Type of product you are working with consumable/non-consumable/subscription

auto renewable subscription

Version of cordova

7.1.0

Version of iOS/Android

latest iOS

Defcon0 commented 6 years ago

OK, this works now. It's been an issue with the AppStore systems. Only Apple support could help. So this has not been the fault of the plugin and the implementation was correct.

fedegarlo commented 6 years ago

Helo @Defcon0 How do you resolve the problem? I have the same issue. Thank you.

Defcon0 commented 6 years ago

Hello @fedegarlo ,

after my app got rejected 5 times for whatever reason (IAPs have been working in sandbox all the time) Apple review team called me by phone and told me that I should provide a video showing that it works completely on a device in sandbox mode (getProducts, purchase, restore). After that they escalated the issue to the internal Apple dev team and they have not been able to reproduce the issue (as I wasn't able, too). So my next binary got approved and then I had the problem described in this issue.

I now wrote to iTunes Connect support (they delegated to Apple Dev Support) and after some back and forth, my IAPs finally appeared. Since I waited over 48 hours after approval of my IAPs, I suspect that there was an issue with the Apple systems.

The key has been to communicate with iTunes Connect and Apple Dev support.