Quantcast
Channel: Questions in topic: "storekit"
Viewing all articles
Browse latest Browse all 89

How to bind Prime31 ios storekit plugin with GUIText elements?

$
0
0
Hello everyone! So, I've bought the storekit plugin from prime31, did a successfull implementation with all the items on the demo working and managed to get it working on my project also (sort of). As I move into more complex scenarios, I'm incurring into a rather singular problem, for which I need your help. I'm doing these operations on my code: 1-I want to fill a couple of GUIText objects with the product details. So I have a :Monobehaviour c# class where I handle all my GUI matters and where I call the StoreKit plugin. 2-So, I start by getting a List products from StoreKitManager.productListReceived, I then to all the required value assigning (from variables to the GUI controls). 3-Finally I make my "form" visible and was supposed to get the product data visible on the screen. What really happens is that the form is returned blank...This is what I've debuged so far: 1-Added some Debug.Logs around to check if stuff was getting done. Confirmed that it is, so the connectability is working just fine, with product data being returned from the appstore. 2-Also detected that some debug.log are being printed only when execution ends, meaning that they are being printed way after their supposed execution point. So my questions to you guys are: 1-Is debug.Log supposed to print immediatly upon call, or it may print with delay? 2-I'm left with the impression that for some reason there is a delay on the response from the appstore and unity just runs the rest of the code without waiting. Is this assumption correct? How can I fix it? Below I'm sending a sample of the source code I'm using: var productIdentifiers=new string[]{"myIdentifier"}; StoreKitBinding.requestProductData( productIdentifiers ); //Debug.Log( "In!! "); List _products=new List(); StoreKitManager.productListReceived += allProducts => { //this one only gets printed after everything else is done...is it supposed to?? Debug.Log( "received total products: " + allProducts.Count ); _products = allProducts; }; if(_products.Count>0) { //this section is never hit Debug.Log("haz product"); foreach(StoreKitProduct product in iapWrapper._products) { IAPFormDesc.GetComponent().text="Product Description: "+ product.description; IAPFormName.GetComponent().text="Product Name: "+ product.title; IAPFormPrice.GetComponent().text="Price: " +product.price; } } else { IAPFormDesc.GetComponent().text="Product Description:" ; IAPFormName.GetComponent().text="Product Name: "; IAPFormPrice.GetComponent().text="Price: " ; Debug.Log("no product?!"); } //I tried to make unity "wait" a while, but at no avail... float time=30.5F; StartCoroutine(Wait(time)); //here I show my form showIAPForm(); Debug.Log("LoadingForm"); Thanks for the help guys!

Viewing all articles
Browse latest Browse all 89

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>