I'm using revenuecat for in-app purchase I want to add "Monthly subscription", So I follow the Docs for configuration. and set up everything as they wrote.
For code part
In App.js
import Purchases from 'react-native-purchases';
export default class App extends React.Component {
componentDidMount() {
...
Purchases.setDebugLogsEnabled(true);
Purchases.setup('apiKey');
}
......
}
here a specific screen here should I return the price, name, time "monthly" and other data (display product)
import React, {Component} from 'react';
import {View, Text} from 'react-native';
import Purchases from 'react-native-purchases';
export default class OneMonthPurchases extends Component {
getOfferings = async () => {
try {
const offerings = await Purchases.getOfferings();
console.log('offerings', offerings); // offerings: {"all": {}}
} catch (error) {
console.log('error when get offerings', error);
}
};
componentDidMount() {
this.getOfferings();
}
render() {
return (
<View>
<Text>One Month Purchases</Text>
</View>
);
}
}
but when I log offers I got offerings: {"all": {}}
So how can I solve it Or I miss something?
Note: I test on simulator