You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: gdx-pay-android-googlebilling/src/com/badlogic/gdx/pay/android/googlebilling/Iso8601DurationStringToFreeTrialPeriodConverter.java
Copy file name to clipboardExpand all lines: gdx-pay-android-googlebilling/src/com/badlogic/gdx/pay/android/googlebilling/PurchaseManagerGoogleBilling.java
+4-2
Original file line number
Diff line number
Diff line change
@@ -170,7 +170,8 @@ private Information convertSkuDetailsToInformation(SkuDetails skuDetails) {
Copy file name to clipboardExpand all lines: gdx-pay-android-googlebilling/test/com/badlogic/gdx/pay/android/googlebilling/Iso8601DurationStringToSubscriptionPeriodConverterTest.java
Copy file name to clipboardExpand all lines: gdx-pay-iosrobovm-apple/README.md
+45-2
Original file line number
Diff line number
Diff line change
@@ -19,5 +19,48 @@ Next to other ways, I find the easiest way to test the IAP the following:
19
19
* your build installed from TestFlight will have working IAPs that are not charged to the users
20
20
21
21
22
-
(1) In order for you to use your actual IAP in your app you also have to fill some information regarding your App Store Connect account. Normally you will see a warning if something is missing, but sometimes when your app is marked as distributed for free, the warnings won't show. In case of IAP, make sure that you have filled required information in following section:
23
-
My Apps -> Agreements, Tax, and Banking -> Paid Apps. It's status should be "Active". As stated there: "The Paid Apps agreement alllows your organization to sell apps on the App Store or **offer in-app purchases.**"
22
+
(1) In order for you to use your actual IAP in your app you also have to fill some information regarding your App Store
23
+
Connect account. Normally you will see a warning if something is missing, but sometimes when your app is marked as
24
+
distributed for free, the warnings won't show. In case of IAP, make sure that you have filled required information in
25
+
following section: My Apps -> Agreements, Tax, and Banking -> Paid Apps. It's status should be "Active". As stated
26
+
there: "The Paid Apps agreement alllows your organization to sell apps on the App Store or **offer in-app purchases.**"
27
+
28
+
29
+
## Subscriptions
30
+
31
+
To verify if the user has a valid subscription we recommend server-side validation.
32
+
33
+
If you do not want to user server-side validation, it can be done by parsing receipt in the App. GdxPay has not
34
+
implemented that. Pull requests are welcome :).
35
+
36
+
It is still possible to find out if user has a valid subscription.
37
+
38
+
iOS keeps expired Transactions from subscriptions in it's SkPaymentTransaction queues (as apposed to Google Play, which
39
+
does not return them in the list of purchases).
40
+
41
+
All Transactions, including historical transactions, are passed through to the `PurchaseObserver`.
42
+
43
+
For example, if a user has a subscription with monthly period going on for 6 months and restores purchases,
44
+
6 Transactions will be passed too in PurchaseObserver#handleRestore().
45
+
46
+
Filter out expired purchases manually. Some pointers:
47
+
48
+
* Start time of Transaction: `Transaction#getPurchaseTime()`
49
+
* Reference to Product Information: `Transaction#getInformation()`
50
+
* Reference to Subscription period: `Information#getSubscriptionPeriod()`
51
+
52
+
Putting that together, you can calculate Transaction purchaseEndTime.
53
+
54
+
If you have Billing Grace Period enabled in App Store Connect, you should add those days to the purchaseEndTime.
55
+
56
+
This logic is covered by `Transaction#calculateSubscriptionEndDate(int billingGracePeriodInDays)`
57
+
58
+
If there are zero transactions with your calculated purchaseEndTime available, the user has cancelled his subscription
59
+
and should resubscribe.
60
+
61
+
Limitations of this method:
62
+
63
+
* payment cancellations cannot be detected
64
+
* free trial periods cannot be detected; if someone decides to start a free trial of 3 days of a one-year subscription,
65
+
the user will get the full year for free if he cancels after the first day.
0 commit comments