iOS Question istore problem

tufanv

Expert
Licensed User
Longtime User
Hello,

I want to display the localized price in my app.

I use :

B4X:
mystore.Initialize("MyStore")
mystore.RequestProductsInformation(Array("product1"))

B4X:
Sub mystore_InformationAvailable (Success As Boolean, Products As List)
    Log(Products)
    If Success Then
        For Each pr As ProductInformation In Products
            btnsubscribe.Text="Subscribe for " & pr.LocalizedPrice & " / Month"
        Next
    End If

End Sub

this code gives an error :

B4i line: 1274
For Each pr As ProductInformation In Products
expected expression


this if valid for both hosted and local , I cant compile it. what am i missing here ?
 
Last edited:

tufanv

Expert
Licensed User
Longtime User
Maybe a name conflict with another module? Is there a global variable named pr?
I tried to change the pr to something else , no luck. There is no other pr decleated.

other utils are dateutils,b4xloadingindicator,kvs
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
it is pretty interesting , when i compile without product information and I buy the item with sandbox , For a minute or two I can compile with this code and get the product price but after that it is impossible again. It is very confusing.
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
What is the output of your Log(Products) statement?

- Colin.
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Thank you very much Erel. It works now.
It's is a problem in iStore library. It will be fixed in the version included in B4i v5.0.

Workaround is to add this code to the module:
B4X:
#if OBJC
#import <StoreKit/StoreKit.h>
#End If
 
Upvote 0
Top