qonversion / react-native-sdk

React Native SDK for cross-platform in-app purchase and subscription infrastructure, revenue analytics, engagement automation, and integrations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Entitlement data after purchase

darimuhittinhey opened this issue · comments

Platform : IOS
react-native-qonversion : "^6.2.0"
react-native : "0.70.6"

I have a function to subscribe

 const subscribe = async () => {
    dispatch(SET_LOADING(true));
    try {
      const selected = products?.find(
        prod => prod.qonversionID === (selectedId === 1 ? 'monthly' : Platform.OS === 'ios' ? 'yearly' : 'sixmonths'),
      );
      if (selected) {
        const entitlements: Map<string, Entitlement> =
          Platform.OS === 'ios'
            ? await Qonversion.getSharedInstance().purchaseProduct(selected)
            : await Qonversion.getSharedInstance().purchase(selected.qonversionID);

        if (entitlements.keys()) {
          for (const [key, value] of entitlements.entries()) {
            reactotron.log?.('key', key);
            reactotron.log?.('value', value);
          }
        }
        reactotron.log?.('entitlements', entitlements);
      }
    } catch (e: any) {
      if (e.userCanceled) {
        // Purchase canceled by the user
        reactotron.log?.('Purchase canceled by the user');
      }
      reactotron.log?.('error in subscribe', e);
    }
    dispatch(SET_LOADING(false));
  };

and when i log returned entitlements i got this :

image

this is my entitlement:

image

and the docs says that Entitlement object is like this :

image

But if we look into Entitlement class in react-native-conversion package:

image

i need other information as docs says. Like transaction id or purchaseToken (for android) of purchase.

whats the point in here ? am i missing something ?

Hi, @darimuhittinhey
Those fields are available for iOS and Android SDK's. We are working on a release for RN SDK that will be available in the next few days. Let's keep in touch. I'll come back with an update after the release.

Hi, @darimuhittinhey
I am happy to say that the new version 6.3.0 has arrived!

This issue is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 5 days.

This issue was closed because it has been stalled for 5 days with no activity.