libgdx / gdx-pay

A libGDX cross-platform API for InApp purchasing.
Apache License 2.0
225 stars 83 forks source link

Prevent crash for undefined/null transaction date #221

Closed LobbyDivinus closed 3 years ago

LobbyDivinus commented 3 years ago

According to https://developer.apple.com/documentation/storekit/skpaymenttransaction/1411273-transactiondate transaction date cannot be undefined/null for purchased or restored items.

In my experience date is null only for hacked transactions so considering them as invalid seems to be the right approach. Prior to this change the app would just crash if date is null which could lead to bad reviews (yeah, how dare it to crash for hackers...).

Associated issue: https://github.com/libgdx/gdx-pay/issues/219

MrStahlfelge commented 3 years ago

@keesvandieren what do you think, should we merge this? The change is ok for me, but I am not sure if it is really needed if it never happened for normal usage.

keesvandieren commented 3 years ago

We never had a problem like this (we have crash reporting, but did not report this problem).

If only one user has it, we can decline it. If it happens again, we can check it again

MrStahlfelge commented 3 years ago

I have the same opinion.

Thanks for the contribution. We will remember it when we see that the problem occurs for other users, too. Otherwise it seemed to by a one-time problem and we close this for now.