iOS Question istore problem

Discussion in 'iOS Questions' started by tufanv, May 14, 2018.

  1. tufanv

    tufanv Expert Licensed User

    Hello,

    I want to display the localized price in my app.

    I use :

    Code:
    mystore.Initialize("MyStore")
    mystore.RequestProductsInformation(
    Array("product1"))
    Code:
    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: May 14, 2018
  2. Erel

    Erel Administrator Staff Member Licensed User

    Maybe a name conflict with another module? Is there a global variable named pr?
     
  3. tufanv

    tufanv Expert Licensed User

    I tried to change the pr to something else , no luck. There is no other pr decleated.

    other utils are dateutils,b4xloadingindicator,kvs
     
  4. tufanv

    tufanv Expert Licensed 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.
     
  5. Computersmith64

    Computersmith64 Well-Known Member Licensed User

    What is the output of your Log(Products) statement?

    - Colin.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    You can send me the project and I'll check it.
     
    tufanv likes this.
  7. tufanv

    tufanv Expert Licensed User

    if i delete the error giving lines i can compile and products are :
    "<SKProduct: 0x1c401b7a0>"
     
  8. tufanv

    tufanv Expert Licensed User

    sent. thank you.
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    Can you post the full compilation window error?
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    No need. I see it now.
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    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:
    Code:
    #if OBJC
    #import <StoreKit/StoreKit.h>
    #End If
     
    tufanv and Computersmith64 like this.
  12. tufanv

    tufanv Expert Licensed User

    Thank you very much Erel. It works now.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice