Hi, i have been using code below for years now, and suddenly it has stopped working. Did i missed some changes or its just something wrong with the code?
Maybe someone can help me?
user.getPricingPlans().then((plans) => {
const time = new Date().getTime();
// Get only the active plans;
plans.filter(items => items.expiryDate.getTime() < time);
// Get the plan that matches the specified name
plans.filter(items => items.name === 'planname');
/* Now check if there are any items in the plans array, if there are
any items left, then the plan is found and is active */
if (plans.length > 0) {
// The user has an active plan;
$w("#repeater1").show();
$w("#text25").show();
console.log("User is a member ")
} else {
// User doesn't have an active plan
$w("#repeater1").hide();
$w("#text25").hide();
$w("#text200").expand();
console.log("User not-subscribed")
}
})