29 Commits

Author SHA1 Message Date
ad77f102e6 Add a workaround for giving people pro mode
The accounts setup is taking way way too long. And some ios users have
paid for pro and haven't gotten it. This way, they will at least get it
ASAP. I should have done this weeks ago.
2020-11-30 12:59:23 +01:00
48ac4b8850 Add debug logs for ios transaction processing 2020-11-27 00:26:11 +01:00
1ab2f8725e _subscriptionStatus: Print out more info
Also return the sub with the largest datetime. Not sure when/if this
case actually occurs.
2020-11-07 14:36:07 +01:00
699f79ae4c Add a few more log statements
ConfirmProPurchase doesn't seem to be working for everyone on iOS
2020-11-07 14:31:15 +01:00
42de2be044 Android: Confirm pending purchases
There seems to be a race condition which results in some purchases not
being confirmed.
2020-10-22 22:50:24 +02:00
fe08834259 Split Settings into AppSettings and Settings
This way I can eventually change Settings into RepoSettings without
breaking anything.
2020-09-25 00:33:54 +02:00
fde1149f56 ios: Clear transactions which haven't completed 2020-09-07 22:29:01 +02:00
4c55c0882d Add an easier way to toggle pro mode 2020-09-04 08:19:56 +02:00
477d47c824 Remove unused imports 2020-09-03 12:27:27 +02:00
40b5afdb7b IAP Verify Fail: Report it to Sentry
Not as analytics. This should typically never be happening.
2020-09-03 08:30:17 +02:00
b3bdb8657c Handle IAP of products
We were only handling subscriptions properly
2020-09-01 10:29:50 +02:00
b9aeb430fd Handle case when we cannot get subscription status
This occurs in ios when the user is asked for their iTunes password and
they press cancel.

It seems with the current approach they will be asked for their password
once a month. It seems a bit annoying. How can this be made better?
2020-07-26 12:29:21 +02:00
4e40814825 ReceiptValidation: Send the psuedoID
Can be used to avoid duplication.
2020-07-26 12:20:16 +02:00
28d53242d8 Move away from RevenueCat
The iOS updates keep getting rejected, and I think it's because
RevenueCat is taking too long to respond. Additionally, revenueCat
doesn't really give us anything useful as its receipt validation isn't
perfect, and I've had to roll my own.

Plus from a privacy point of view, this is better as we are no longer
talking to any third party service.

This has so far only been tested on iOS
2020-07-26 12:20:09 +02:00
9d00fdac06 Use import_sorter
flutter pub run import_sorter:main --no-comments

The code feels much cleaner
2020-07-24 12:43:28 +02:00
a6fba3d2e7 IAP: Do not check for pro mode on boot
If the user has freshly installed the app, they can click on the
Purchase Pro Mode button and that will put them in Pro mode if already
bought.

This is being done, because otherwise the experience in ios is shitty as
the moment the app is launched, the user is asked for their iTunes
password.
2020-07-21 10:37:01 +02:00
e7984f87f3 IAP: Validate the token on the server side
As recommended by Apple and Google.
2020-07-21 10:33:13 +02:00
7c6a5b5d26 ios IAP: Select the latest purchase
We really should be using server side validation. This is incredibly
hacky.
2020-07-14 22:20:48 +02:00
dc671054f3 IAP: Confirm if isPro without RevenueCat on ios
Fixes #171
2020-07-14 21:27:45 +02:00
27bcb09edf IAP: Log the expiry date 2020-07-09 17:11:48 +02:00
bb8cb5e442 IAP: Always check
Disable the optimization of not checking for pro mode on boot. The
optimization fails and pro members cannot always get the pro features.
This is not good.

As a workaround, opening the but pro mode page also checks if already
purchased.
2020-07-05 20:38:06 +02:00
1035bacc58 SubscriptionStatus: Avoid rechecking on start
Just check once and cache the value.
2020-07-03 22:32:34 +02:00
cc7d6e7e61 Pro Mode [Android]: Verify the purchase locally and without RevenueCat
We're using RevenueCat to manage the subscriptions. In my case in
Android, it gives me data saying I'm missing a subscription even though
I clearly have it (though in Trial mode).

The subscription token isn't really being verified right now. Ideally
this needs to be done on the server side. This is a good first start to
get rid of RevenueCat.

Related to #171
2020-07-03 22:15:03 +02:00
94af59fb84 IAP: Convert print to Log 2020-06-12 10:57:58 +02:00
faf561f104 Allow configuring the Home Screen
It can either be the Folders view or the All Notes view.
2020-05-08 19:30:53 +02:00
516768b692 iap: Allow exp to be null
Not sure how this can ever happen, but it's clearly being reported in
Sentry.
2020-05-02 13:33:21 +02:00
45a57da88a Only check if subscription is valid if it has expired
This way we avoid extra network access.
2020-04-22 23:30:50 +02:00
f84642207d Always check if not in pro mode
A person can install the app and be already in pro mode - for example if
they have cleared their cache. Ideally, we shouldn't be checking each
time on boot and instead just be checking when it expires.

Fixes #110
2020-04-20 00:28:24 +02:00
cb126c733a Add missing file 2020-04-10 13:46:49 +02:00