Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android subcriptions list is not coming in app [same code working for IOS] #2451

Open
prashantpadhariya1137 opened this issue May 30, 2023 · 7 comments

Comments

@prashantpadhariya1137
Copy link

"react-native-iap": "^12.10.5",
"react-native": "0.68.2",
"react": "17.0.2",

My code :

import * as RNIap from 'react-native-iap';

const subscriptionSkus = {
skus: ['test1', 'test2'],
};

async componentDidMount(): void {
try {
const result = await RNIap.initConnection()
.then(res => console.log('LOGG 1 ', res))
.catch(err => console.log('LOGG 2', err));
console.log('connection is => ', result);
} catch (err) {
console.log('error in cdm => ', err);
}

const products: Product[] = await RNIap.getSubscriptions(subscriptionSkus)
  .then(res => console.log('LOGG 3 ', res))
  .catch(err => console.log('LOGG 4 ', err));
console.log('Products[0]', products);

}

Output :

LOGG 3 []
Products[0] undefined

I've used above library for in app purchase in app and above methods for getting subscriptions from play console but subscriptions list is not coming from "RNIap.getSubscriptions" this method in android and i've implemented same library in IOS and its working.

Expected Behavior

  • Subscriptions should come from "RNIap.getSubscriptions" this method.

Environment:

  • react-native-iap:
  • react-native:
  • Platforms (Android, device):
@puneetkansal04
Copy link

Are you getting RNIap.getProducts from the List. As I am getting an empty array also I have to disable hermes to use this package in react-native@0.64

@prashantpadhariya1137
Copy link
Author

No not getting products also and getting empty array in subscriptions and products.

@puneetkansal04
Copy link

@prashantpadhariya1137 I am also looking for a solution me know if you will get anything to resolve this I am using
"react-native-iap": "^12.10.5",
react-native:0.64

@prashantpadhariya1137
Copy link
Author

Okay sure @puneetkansal04

@Prathameshlabde
Copy link

#2455 Can anyone please suggest on this issue Please ?

@adilcjr
Copy link

adilcjr commented Jun 12, 2023

I can't get any subscription, too, neither iOS. I have a question, is it required to launch a new production version to get subscriptions on sandbox environment? My subscriptions are "ready to send" status.

@Haseeba393
Copy link

I'm using "react-native-iap": "12.10.2" this package. I have 2 subscription added in Play and App store. This is my code:

const getAppSubscriptions = async () => {
    try {
      await RNIap.initConnection();
      await clearPendingPurchases();
      dispatch(actionSetIsIAPStoreConnected(true));
      const appSubs = await RNIap.getSubscriptions({ skus: _GET_SKUS() });
      console.log(`${Platform.OS} appSubs`, appSubs);

      dispatch(actionSetAppSubscriptions(appSubs));
    } catch (error) {
      showConsoleMessage(`ERROR WHILE FETCHING APP SUBSCRIPTIONS ${JSON.stringify(error)}`);
    }
  }

Both subscriptions are coming in iOS but in Android only 1 subscription is fetched. I have made a signed build uploaded in internal testing as well but nothing happens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants