Hi! Could you share the code snippet where your Android app has the logic to purchase the first instance of the bronze plan versus the second, so that I can take a look on my end?
This already works on IOS, so we believe that it is not a logic problem, we only have this error with Google Play.
const init = async () => {
try {
Purchases.setAttributes({ groupUuid, userUuid: String(user?.uuid) });
Purchases.setLogLevel(LOG_LEVEL.DEBUG);
if (Platform.OS === 'ios') {
Purchases.configure({
apiKey: APIKeys.apple,
appUserID: `${user?.uuid}-${groupUuid}`,
});
} else {
Purchases.configure({
apiKey: APIKeys.google,
appUserID: `${user?.uuid}-${groupUuid}`,
});
}
setIsReady(true);
await loadOfferings();
} catch (e) {
console.error(e);
}
};
async function loadOfferings() {
const offerings = await Purchases.getOfferings();
setOferrings(offerings);
}
This section is used to check whether the user already has a subscription or not, if so, they get all the packages from that current offering, otherwise (if the group is free), they get the packages from the first available offering
const currentPackages = useMemo(() => {
const oferingId = subscription?.subscription_plan?.revenue_cat_offering_id;
if (!oferrings) return [];
if (oferingId) {
const currentOferring = oferrings.all?.[oferingId];
return currentOferring.availablePackages;
} else {
const oferindIdAvailable = avaiablePlans[0];
const currentOferring = oferrings.all[oferindIdAvailable];
return currentOferring.availablePackages;
}
}, [oferrings, subscription, avaiablePlans]);
the variable oferrings is like:
{
"all": {
"family1": {
"annual": [Object],
"availablePackages": [Array],
"identifier": "family1",
"lifetime": null,
"metadata": [Object
],
"monthly": null,
"serverDescription": "grupo 1",
"sixMonth": null,
"threeMonth": null,
"twoMonth": null,
"weekly": null
},
"family2": {...
the variable avaiablePlans is like avaiable oferrings: “family1”, “family2”,”family3”, “family4”,”family5”]
if the user subscribes to a package in the offering family1, The current offering is removed from the availablePlans list