To replicate:
Using latest Flutter plugin 3.4.1 and the ‘purchase_tester’ example project
Add an ElevatedButton that calls canMakePayments()
eg replace the ‘UpsellScreen’ build method with this
@overrideWidget build(BuildContext context) { return ElevatedButton( onPressed: () async { bool _storeAvailable = false; try { print("Checking availability"); _storeAvailable = await Purchases.canMakePayments(); print("Store available? $_storeAvailable"); //This line never prints } on PlatformException catch (e) { var errorCode = PurchasesErrorHelper.getErrorCode(e); print("Error was $errorCode"); } }, child: Text("Check Store Available"), );}
On Android the call never returns (on iOS it works as expected)
Expected result:
bool returned within a reasonable time (or an exception)
Testing info:
This function was working correctly on vs 3.3.0 of the plugin.
Tested on Android Pixel 4a
Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-x64)