Skip to content

useIAP() fails on tvOS with "Nitro runtime not installed yet" error #3141

@MatheoElieG

Description

@MatheoElieG

Description

Then using useIAP() hook on tvOS (via react-native-tvos), the app crashes immediately with:

  WARN  [RN-IAP] [purchaseErrorListener] Nitro not ready yet; listener inert until initConnection()
  WARN  [RN-IAP] [promotedProductListenerIOS] Nitro not ready yet; listener inert until initConnection()
  ERROR [RN-IAP] Failed to initialize IAP connection: [Error: Nitro runtime not installed yet. Ensure react-native-nitro-modules is initialized before calling IAP.]
  ERROR [RN-IAP] initConnection failed: [[react-native-iap]: PurchaseError: Nitro runtime not installed yet. Ensure react-native-nitro-modules is initialized before calling IAP.]

The issue occurs because react-native-nitro-modules is not fully initialized when the component mounts on tvOS. This works fine on iOS.

Environment

  • react-native-tvos: 0.81-stable
  • react-native-iap: 14.7.7
  • react-native-nitro-modules: 0.33.7
  • expo: 54.0.0
  • Platform: tvOS (Apple TV)

How to reproduce

Clone this project
https://github.com/MatheoElieG/react-native-iap-issue

Run the basic app in an AppleTV emulator and the issue will occur

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions