Not sure if this is a bug or I might be doing something wrong
For a simple test I have a single Page with a Purchase Button and a Restore Button that works in Sandbox mode with the Apple in-app stuff.
If I press the Purchase button I can buy a subscription and PurchaseCompleted is called.
If I press the Purchase button a second time it tells me I am already subscribed and I can press Manage or OK. If I press Manage then go back, PurchaseCompleted is called again and it gives a list of about 20 subscriptions I have tested with, all with different dates and Transaction IDs.
So far this is all good.
Next I press the Restore button to Restore Transactions and PurchaseCompleted is called.
BUT... instead of listing the 20 subscriptions I have tested with, all with different dates and Transaction IDs, it lists a single subscription with the same date and Transaction ID 20 times. (and it's not even the latest Purchase, it's an old one)
How can I fix this?
For a simple test I have a single Page with a Purchase Button and a Restore Button that works in Sandbox mode with the Apple in-app stuff.
If I press the Purchase button I can buy a subscription and PurchaseCompleted is called.
If I press the Purchase button a second time it tells me I am already subscribed and I can press Manage or OK. If I press Manage then go back, PurchaseCompleted is called again and it gives a list of about 20 subscriptions I have tested with, all with different dates and Transaction IDs.
So far this is all good.
Next I press the Restore button to Restore Transactions and PurchaseCompleted is called.
BUT... instead of listing the 20 subscriptions I have tested with, all with different dates and Transaction IDs, it lists a single subscription with the same date and Transaction ID 20 times. (and it's not even the latest Purchase, it's an old one)
How can I fix this?
B4X:
Private Sub Application_Start (Nav As NavigationController)
NavControl=Nav
Test.Initialize("Test")
Test.RootPanel.LoadLayout("Test")
NavControl.ShowPage(Test)
MyStore.Initialize("MyStore")
inappsupport=MyStore.CanMakePayments
End Sub
Sub MyStore_PurchaseCompleted (Success As Boolean, Product As Purchase)
If Success=True Then
Log("Product: " & Product.ProductIdentifier & ", date=" & DateTime.Date(Product.TransactionDate) &" "& DateTime.Time(Product.TransactionDate) & _
", Transaction identifier=" & Product.TransactionIdentifier)
End If
End Sub
Sub Subscribe_Click
If inappsupport=True Then
MyStore.RequestPayment("test123")
End If
End Sub
Sub Restore_Click
If inappsupport=True Then
Log("RESTORE")
MyStore.RestoreTransactions
End If
End Sub
Results from Purchasing...
Product: test123, date=05/29/2019 13:31:08, Transaction identifier=1000000532568554
Product: test123, date=05/29/2019 13:36:08, Transaction identifier=1000000532569667
Product: test123, date=05/29/2019 13:41:08, Transaction identifier=1000000532570311
Product: test123, date=05/28/2019 23:40:47, Transaction identifier=1000000532571015
Product: test123, date=04/30/2019 08:59:51, Transaction identifier=1000000532571016
Product: test123, date=04/25/2019 14:44:25, Transaction identifier=1000000532571017
Product: test123, date=04/24/2019 23:35:36, Transaction identifier=1000000532571018
Product: test123, date=05/28/2019 23:35:47, Transaction identifier=1000000532571019
Product: test123, date=04/25/2019 15:48:42, Transaction identifier=1000000532571020
Product: test123, date=05/29/2019 00:04:53, Transaction identifier=1000000532571021
Product: test123, date=04/25/2019 15:09:25, Transaction identifier=1000000532571022
Product: test123, date=05/29/2019 08:25:37, Transaction identifier=1000000532571023
Product: test123, date=04/25/2019 23:23:33, Transaction identifier=1000000532571024
Product: test123, date=04/24/2019 23:25:36, Transaction identifier=1000000532571025
Product: test123, date=04/25/2019 23:18:33, Transaction identifier=1000000532571026
Product: test123, date=05/28/2019 23:30:47, Transaction identifier=1000000532571027
Product: test123, date=05/29/2019 08:35:53, Transaction identifier=1000000532571028
Product: test123, date=04/30/2019 08:44:51, Transaction identifier=1000000532571029
Product: test123, date=04/24/2019 23:45:36, Transaction identifier=1000000532571030
Product: test123, date=04/25/2019 23:38:33, Transaction identifier=1000000532571031
Results from Restore Transaction...
Product: test123, date=04/24/2019 23:20:37, Transaction identifier=1000000522570757
Product: test123, date=04/24/2019 23:20:37, Transaction identifier=1000000522570757
Product: test123, date=04/24/2019 23:20:37, Transaction identifier=1000000522570757
Product: test123, date=04/24/2019 23:20:37, Transaction identifier=1000000522570757
Product: test123, date=04/24/2019 23:20:37, Transaction identifier=1000000522570757
Product: test123, date=04/24/2019 23:20:37, Transaction identifier=1000000522570757
Product: test123, date=04/24/2019 23:20:37, Transaction identifier=1000000522570757
etc...