iOS Question In-App Purchase test

Emme Developer

Well-Known Member
Licensed User
Longtime User
Hi!
I'm tryng in-app purchase and i followed the tutorials, but i really don't understand why i got this

B4X:
Purchase completed
Product: 0001, date=01:00:00, Transaction identifier=8A5845BF-8B38-414B-B300-EE477CE5FC72
Success = false

Maybe success = false because it is a test account? Or because i'm on simulator?
This is my code, i not already buy the product, and i'm using sandbox account. Any help?

B4X:
Main.MyStore.Initialize("MyStore")
            If Main.MyStore.CanMakePayments = True Then Main.MyStore.RequestPayment("0001")


Sub MyStore_PurchaseCompleted (Success As Boolean, Product As Purchase)
    Log("Purchase completed")
    If Product.IsInitialized Then
        Log("Product: " & Product.ProductIdentifier & ", date=" & DateTime.Time(Product.TransactionDate) & _
       ", Transaction identifier=" & Product.TransactionIdentifier)
    End If
    Log("Success = " & Success)
End Sub
 

Emme Developer

Well-Known Member
Licensed User
Longtime User
@Erel error is
B4X:
<B4IExceptionWrapper: Error Domain=SKErrorDomain Code=0 "Cannot connect to iTunes Store" UserInfo={NSLocalizedDescription=Cannot connect to iTunes Store}>
I think because simulator doesn't have iTunes store, so in app purchase cannot be used on simulator
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
You can't test IAPs on a simulator. I think you can test certain parts (like requesting products & showing localizes prices) but you can't complete a purchase from a simulator.

- Colin.
 
Upvote 0
Top