deliverProduct method
Future<void>
deliverProduct(
- PurchaseDetails purchaseDetails
)
Implementation
Future<void> deliverProduct(PurchaseDetails purchaseDetails) async {
purchaseList.add(purchaseDetails);
if (purchaseDetails.productID == "monthly_pack_1") {
if (validateSubscription(purchaseDetails)) {
isSubscribed = true;
subscriptionDetail = purchaseDetails;
log("Activating monthly_pack Pack");
isPendingStatus = false;
sharedPreferences?.setBool("premiumUser", true);
premiumUser = true;
GlobalAdVariables.isPremiumUser = true;
notifyListeners();
}
// InAppController.validatePurchases([purchaseDetails]);
}
if (purchaseDetails.productID == "weekly_pack") {
if (validateSubscription(purchaseDetails)) {
isSubscribed = true;
subscriptionDetail = purchaseDetails;
log("Activating weekly_pack Pack");
sharedPreferences?.setBool("premiumUser", true);
premiumUser = true;
GlobalAdVariables.isPremiumUser = true;
isPendingStatus = false;
notifyListeners();
}
// InAppController.validatePurchases([purchaseDetails]);
}
if (purchaseDetails.productID == "yearly_pack_2") {
if (validateSubscription(purchaseDetails)) {
isSubscribed = true;
subscriptionDetail = purchaseDetails;
log("Activating yearly_pack Pack");
sharedPreferences?.setBool("premiumUser", true);
premiumUser = true;
GlobalAdVariables.isPremiumUser = true;
isPendingStatus = false;
notifyListeners();
}
}
}