adaptyteam / AdaptySDK-React-Native

React Native SDK for growing in-app subscriptions
https://docs.adapty.io/docs/quickstart
MIT License
125 stars 12 forks source link

[IOS] Error while fetching paywall products on real device and emulator #99

Closed I-Kovalov closed 8 months ago

I-Kovalov commented 11 months ago

Description

Hello, I found this error in docs, but it's strange because when I call getPaywall I see products in console, but when I want to extract them using getPaywallProducts I get this error: ERROR Error occured while fetching paywall [Error: #1000 (noProductIDsFound): No In-App Purchase product identifiers were found.]; Is it Apple Configuration or SDK problem?

Code:

 const fetchPaywall = async () => {
    try {
      const paywallResult = await adapty.getPaywall('main_paywall', 'en');
      console.log(JSON.stringify(paywallResult));
      const productResult = await adapty.getPaywallProducts(paywallResult);
      setProducts(productResult);
    } catch (error) {
      console.error('Error occured while fetching paywall', error);
    }
  };

Console:

 LOG  {"abTestName":"General Paywall","hasViewConfiguration":false,"id":"main_paywall","locale":"en","name":"General Paywall","products":[{"vendorId":"testable","ios":{},"android":{}},{"vendorId":"monthly","ios":{},"android":{}},{"vendorId":"annual","ios":{},"android":{}},{"vendorId":"catwoman","ios":{},"android":{}}],"revision":1,"variationId":"f9ed0a74-0cb8-495c-be54-e54775853ec3","version":1699976524531}
 ERROR  Error occured while fetching paywall [Error: #1000 (noProductIDsFound): No In-App Purchase product identifiers were found.]```

### Version

v2.7.0

### What platforms are you seeing the problem on?

iOS

### System info

```yml
Usage: react-native [command] [options]

Options:
  -v                                         Output the current version
  --verbose                                  Increase logging verbosity
  -h, --help                                 display help for command

Commands:
  bundle [options]                           builds the javascript bundle for offline use
  ram-bundle [options]                       builds javascript as a "Random Access Module" bundle for offline use
  start [options]                            starts the webserver
  config                                     Print CLI configuration
  clean [options]                            Cleans your project by removing React Native related caches and modules.
  info                                       Get relevant version info about OS, toolchain and libraries
  upgrade [version]                          Upgrade your app's template files to the specified or latest npm version using `rn-diff-purge` project. Only valid semver versions are allowed.
  profile-hermes [options] [destinationDir]  Pull and convert a Hermes tracing profile to Chrome tracing profile, then store it in the directory <destinationDir> of the local machine
  log-ios [options]                          starts iOS device syslog tail
  run-ios [options]                          builds your app and starts it on iOS simulator
  build-ios [options]                        builds your app on iOS simulator
  log-android                                starts logkitty
  run-android [options]                      builds your app and starts it on a connected Android emulator or device
  build-android [options]                    builds your app
  init [options] <projectName>               Initialize a new React Native project named <projectName> in a directory of the same name.
  doctor [options]                           Diagnose and fix common Node.js, iOS, Android & React Native issues.
  help [command]                             display help for command
raptor-i commented 11 months ago

I faced this error as well, creating and assign a StoreKit in xcode solves it for developing but still doesn't work if you build and test on testflight. I guess that the products can get fetch when app is ready to submit.

I-Kovalov commented 11 months ago

@raptor-i yes, storeKit in xcode solves for developing, but doesn't work on testFlight. Do you have receipt error with storeKit in xCode? error 2003

raptor-i commented 11 months ago

@I-Kovalov it is been a while but i remember that there was an issue when .makePurchase(), so i used only for building the structure of the paywall.

I-Kovalov commented 11 months ago

@raptor-i yes, this problem was when call .makePurchase(). Ah 0 ideas how to have them on testflight:(

raptor-i commented 11 months ago

@I-Kovalov hope there is a solution. App store rejected our product because paywall has no response as we expected :D i guess i see in adapty document that product should be ready to submit status but looks like there is no chance to get this status without paywall has no response :(

I-Kovalov commented 11 months ago

@raptor-i Well, I'll let you, if I find the solution. And let me know if you find

I-Kovalov commented 11 months ago

@raptor-i Hi, I have fixed this problem. The reason was in taxes (client forgot to set all taxes and bank account). He set them, but it wasn't working for a while (probably apple were updating subs and info), after 30 minutes it started working.

raptor-i commented 11 months ago

@I-Kovalov Hey, really appreciated to share this solution with me. We are going to try this one and hope fix our issue too. Thanks again ^^

T30-H0 commented 5 months ago

Hi @I-Kovalov , could you please show me more details to check taxes configuration or any docs mentioned about it, I'm facing this error on the android emulator. thanks in appreciation.

I-Kovalov commented 4 months ago

@T30-H0 Hi! Unfortunately I don't know details, I just know that my client forgot to set all necessary options in app store connect(taxes, etc)