voltrue2 / in-app-purchase

A Node.js module for in-App-Purchase for iOS, Android, Amazon and Windows.
http://iap.gracenode.org
Other
1.04k stars 287 forks source link

Empty array returned from purchaseData #330

Open waltermvp opened 3 years ago

waltermvp commented 3 years ago

I always get an empty array when calling getPurchaseData with a validated receipt. I am using a sandbox account + actual device for testing.

    iap
      .setup()
      .then(() => {
        iap
          .validate(receipt)
          .then(validatedData => {

            if (iap.isValidated(validatedData)) {
              var options = {
                ignoreCanceled: true,
                ignoreExpired: true, 
              };

              var purchaseData = iap.getPurchaseData(validatedData, options); //ALWAYS RETURNS []
              resolve(purchaseData);
            } else {
              console.log("false");
            }
          })
          .catch(error => {
            resolve(error);
          });
NLueg commented 3 years ago

I have the same issue for iOS.