I am new to Monetize on the Google Play console. I can purchase In-app products from Google Play Console. But I am not able to subscribe to the product. For this, I am using chargebee_flutter 0.4.2. The problem is That every time I try to subscribe to the product of Subscription it shows me a dialog of “Subscription not available.The subscription that you selected isn’t available” but in actual it is available on my PlayConsole.
try {
await Chargebee.configure("site", "PublishableApiKey", "iosSdkKey","androidSdkey");
final retriveProduct = await Chargebee.retrieveProductIdentifiers();
print(retriveProduct) // able to get Subscription product.it is a list of product id as String
List<Product> productList = await Chargebee.retrieveProducts(retriveProduct);
print(productList); // able to get list of Product
final customer = CBCustomer("customer-id", "firstname", "lastname", "email");
final result = await Chargebee.purchaseStoreProduct(productList[0], customer:customer);
print("subscription id : ${result.status}");
// Unable to subscribe Product It pop up the Dialog Subscription not Available
// and goes to the platfromException
} on PlatformException catch (e) {
debugPrint('Error Message: ${e.message}, Error Details: ${e.details}, Error Code: ${e.code}');
}
But if we pass In-app product on Chargebee.purchaseStoreProduct(
in-app product,
customer: customer); method we can purchase the product but unable to subscribe Subscription product.