Skip to content

promotedProductListenerIOS and getPromotedProductIOS both fail to fire on cold start #143

@zhangsn

Description

@zhangsn

Bug Report

Description

When a user taps a promoted in-app product in the App Store and the app is cold started (not running in background), neither promotedProductListenerIOS callback nor getPromotedProductIOS() return any product — the callback is never triggered and getPromotedProductIOS() returns null.

The promotedProductListenerIOS callback does fire correctly when the app is resumed from background.

Steps to Reproduce

  1. Set up a promoted in-app purchase product in App Store Connect.
  2. Use a StoreKit configuration file or a direct App Store promoted product link (itms-apps://...?action=purchaseIntent&productIdentifier=xxx) to simulate a promoted product tap.
  3. Ensure the app is fully terminated (cold start scenario).
  4. Tap the promoted product link.
  5. Observe that neither onPromotedProductIOS (via useIAP) nor promotedProductListenerIOS fires, and getPromotedProductIOS() returns null.

Code Sample

// None of these work on cold start:

// Approach 1 - useIAP hook callback
useIAP({
  onPromotedProductIOS: (product) => {
    console.log('never called on cold start', product);
  },
});

// Approach 2 - standalone listener
useEffect(() => {
  const subscription = promotedProductListenerIOS((product) => {
    console.log('never called on cold start', product);
  });
  return () => subscription.remove();
}, []);

// Approach 3 - polling after mount
useEffect(() => {
  (async () => {
    const product = await getPromotedProductIOS();
    console.log('always null on cold start', product); // null
  })();
}, []);

Expected Behavior

At least one of the above APIs should reliably deliver the promoted product info when the app is cold-started from a promoted product tap in the App Store.

Environment

expo-iap version 4.2.4
Expo SDK ~54
React Native 0.79+
Platform iOS
Device Physical device
Xcode 16+

Metadata

Metadata

Assignees

No one assigned

    Labels

    expo-iapexpo-iap library🐛 bugSomething isn't working📱 iOSRelated to iOS

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions