adaptyteam / AdaptySDK-React-Native

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

Purchase Failed in sandbox with Unknown Error #88

Closed samuelzxu closed 4 months ago

samuelzxu commented 11 months ago

Description

I was attempting to make a purchase in the sandbox but was greeted with an unknown error:

[Error: #0 (unknown): Product purchase failed]

  const handlePurchase = async () => {
    try {
      const id = 'pairsessentials';
      const locale = 'en';

      const paywall = await adapty.getPaywall(id, locale);
      const products = await adapty.getPaywallProducts(paywall);
      const profile = await adapty.makePurchase(products[0]);
      console.log(profile);
      } catch (error) {
        console.log(error);
      }
    }

Version

^2.6.0

What platforms are you seeing the problem on?

iOS

System info

System:
  OS: macOS 13.2.1
  CPU: (10) arm64 Apple M2 Pro
  Memory: 55.05 MB / 16.00 GB
  Shell:
    version: 5.8.1
    path: /bin/zsh
Binaries:
  Node:
    version: 18.16.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.19
    path: /usr/local/bin/yarn
  npm:
    version: 9.5.1
    path: /usr/local/bin/npm
  Watchman:
    version: 2023.08.14.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.12.1
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.4
      - iOS 16.4
      - macOS 13.3
      - tvOS 16.4
      - watchOS 9.4
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
  Xcode:
    version: 14.3.1/14E300c
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.19
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.4
    wanted: 0.72.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: true
  newArchEnabled: false
divanc commented 11 months ago

Hey! Does this persist? Apple recently had problems maintaining sandbox servers... @samuelzxu

samuelzxu commented 11 months ago

@divanc I think that the iOS 17 update has broken something with the library. It consistently fails on iOS 17 across all devices when running on iOS hardware (iPhone, iPad) but it works on iOS 16.

divanc commented 11 months ago

@samuelzxu That is awful, if your purchases fail on iOS 17! I've just tried Adapty 2.6.0 on iOS 17.0, it seems fine for me. Our next release will be thouroughly tested on a spectre of iOS 17 devices, but I haven't seen any Swift API changes that might cause these problems.

Do you have failing purchases on a real device with debug build? I don't think simulator can validate purchases