When I try to fetch PurchaserInfo in flutter application. getting below response. Empty details. No able to find clear documentation or video to understand this. Please help.
Details are below
- app type - Flutter - iOS version.
- Getting this error while running on iOS simulator.
- Try to run below code in initS method in a screen.
Future<void> initPlatformState() async {
Purchases.setDebugLogsEnabled(true);
await Purchases.setup(<apikey>);
PurchaserInfo purchaserInfo;
try {
await Purchases.getOfferings().then(
(value) => print(value.all),
);
purchaserInfo = await Purchases.getPurchaserInfo();
print(purchaserInfo.toString());
if (purchaserInfo.entitlements.all['pro'] != null) {
appData.isPro = purchaserInfo.entitlements.all['pro'].isActive;
} else {
appData.isPro = false;
}
} on PlatformException catch (e) {
print(e);
}
print('#### is user pro? ${appData.isPro}');
}
PurchaserInfo{entitlements: EntitlementInfos{all: {}, active: {}},