1
0
mirror of https://github.com/GitJournal/GitJournal.git synced 2025-07-17 18:49:55 +08:00

Add a few more log statements

ConfirmProPurchase doesn't seem to be working for everyone on iOS
This commit is contained in:
Vishesh Handa
2020-11-07 14:27:27 +01:00
parent c37b47302d
commit 699f79ae4c
2 changed files with 6 additions and 1 deletions

@ -46,6 +46,7 @@ class InAppPurchases {
static Future<void> confirmProPurchase() async {
SubscriptionStatus sub;
Log.i("Trying to confirmProPurchase");
try {
sub = await _subscriptionStatus();
if (sub == null) {
@ -63,9 +64,11 @@ class InAppPurchases {
return;
}
Log.i("SubscriptionState: $sub");
var isPro = sub.isPro;
var expiryDate = sub.expiryDate.toIso8601String();
Log.i(sub.toString());
Log.i("Pro ExpiryDate: $expiryDate");
if (AppSettings.instance.proMode != isPro) {
Log.i("Pro mode changed to $isPro");
@ -84,6 +87,7 @@ class InAppPurchases {
var dtNow = DateTime.now().toUtc();
var response = await iapConn.queryPastPurchases();
Log.i("Number of Past Purchases: ${response.pastPurchases.length}");
for (var purchase in response.pastPurchases) {
DateTime dt;
try {

@ -407,6 +407,7 @@ class _RestorePurchaseButtonState extends State<RestorePurchaseButton> {
setState(() {
computing = true;
});
Log.i("Confirming Pro Purchase");
await InAppPurchases.confirmProPurchase();
if (AppSettings.instance.proMode) {
Navigator.of(context).pop();