Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[Released] BFS WP8 Goodies Plugin

Discussion in 'Assets and Asset Store' started by BFS-Kyle, Jul 17, 2013.

  1. TerraCo

    TerraCo

    Joined:
    Jun 8, 2013
    Posts:
    26
    I don't get the purchase display page when I click the button for the consumable, just comes up with the error straight away.

    I'll try it without the numbers to see how it goes.

    Cheers,

    TerraCo
     
  2. amolnaik3

    amolnaik3

    Joined:
    Jul 19, 2011
    Posts:
    13
    Hi Kyle,

    Just one question is it mandatory to have VS Express edition or we can do build the project with any other VS edition as well?


    Regards,
    -Amol
     
  3. TerraCo

    TerraCo

    Joined:
    Jun 8, 2013
    Posts:
    26
    No luck.

    Created a new item called "fuelcan". Submitted the beta app, downloaded the app once it was approved and went to purchase the new item. Got the blank Confirm page. Restarted app and purchased the item successfully. Went to purchase the item again and got the same error as above where it crashes at WP8Goodies.IAP.<RequestPurchaseAsync>d_3.Move.Next()

    Uninstalled, restarted phone, reinstalled. Still get the same error.
     
  4. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi Amol,

    VS Express edition is not required - it is just the free version available, but Unity also supports Visual Studios Professional I believe.

    -Kyle
     
  5. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi TerraCo,

    Thanks a bunch for your feedback - I have some theories as to what might cause it based on what you have described. Will give them a shot see if I can resolve this issue. Hopefully will have something to try out tomorrow, will keep you all posted here!

    -Kyle
     
  6. TerraCo

    TerraCo

    Joined:
    Jun 8, 2013
    Posts:
    26
    Sounds great to me, I eagerly anticipate your update. Will this address the blank Confirm page issue as well?
    Feature request: Are there plans to add pubCenter to this plugin?

    Also, I can confirm that Unity supports the Pro versions of Visual Studio. I have used 2012 Pro and am now using 2013 Beta Pro with zero issues.
     
    Last edited: Sep 3, 2013
  7. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi TerraCo, Amol,

    I have been able to reproduce the issue of the blank confirm page. It will happen if you call the function

    Code (csharp):
    1.  
    2. WP8Goodies.IAP.RequestPurchase("");
    3.  
    twice in rapid succession. This could happen because e.g. the Button Trigger code you are using is accidentally firing off twice, and so the IAP function is called twice. Put in some Debug Logs to see if it is being called twice, and if it is make sure that it will only get called once.

    TerraCo,

    As for your "fuelcan" test - it is possible that you have an out-dated version of the plugin, or maybe a related issue to do with the purchase call being fired twice. Make sure you have the latest version from the Asset Store, and not calling the purchase function twice. If it is still happening for you - is this item a durable or consumable?

    Hope this helps you guys, let me know if you still have any issues.

    P.s. a new update will be going out soon for the IAP product details so you can retrieve the price / description from within the app - will be live on the asset store in the next week or two (just have some final testing here, then submitting to the store for approval :D)

    Cheers,

    -Kyle
     
  8. appliquette

    appliquette

    Joined:
    Apr 14, 2008
    Posts:
    143
    Hi Kyle,

    Thanks for this - have adjusted and will be testing as soon as beta is approved, will let you know the results.

    Update will be welcomed! Any thoughts on ingame-ads?
     
  9. TerraCo

    TerraCo

    Joined:
    Jun 8, 2013
    Posts:
    26
    Hi Kyle,

    I tested this out and did find an issue with my buttons firing too many times. This has been resolved and they now fire a maximum of once every 5 seconds. There seems to be an issue with the IAP functions in that they seem to send off 3 requests and return 3 results every time. It also returns 3 errors each time it fails.

    My coin purchase works, but gives the player 3 times the amount that they purchase. The fuelcan purchase still returns the error stating the "Operation is not valid due to the state of the object" as shown in my screenshots from earlier

    EDIT: The triplication thing is on my end. When I click ANY button, they all fire a purchase. I'll sort that out. Still getting the error with some purchases though. Is there any updated IAP script you can send through or do I have to wait for the update? Just trying to get this game ready for the Unity/Windows comp :D
     
    Last edited: Sep 4, 2013
  10. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi TerraCo,

    For the first issue, it would probably be that you are assigning a function to the OnIAPPurchaseSucceeded event multiple times, and/or adding it when you go to the IAP screen, but not removing it when you go away (so each time you return to the IAP screen it will call it one additional time). Double check to make sure every time you add a listener to the event, you also remove it when it is finished.

    As for the fuelcan - is that a Durable IAP item?

    -Kyle
     
  11. TerraCo

    TerraCo

    Joined:
    Jun 8, 2013
    Posts:
    26
    Hi Kyle,

    I got the triple call issue sorted, scripting issue. The fuelcan (not working) is a consumable item, just like the hundredBucks item (which now works). I have a Durable item which works as well.

    The fuelcan button doesn't even go and check the store. As soon as it is clicked it throws up the error.

    Cheers,
    TerraCo
     
  12. amolnaik3

    amolnaik3

    Joined:
    Jul 19, 2011
    Posts:
    13
    Hi Kyle,

    I have also checked for the button triggered .. It is calling once only.
    Still giving the same error.

    Regards,
    -Amol
     
    Last edited: Sep 5, 2013
  13. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi Amol,

    Hmm... if you are 100% certain that it is only being called once and still causes the issue then it could be something else entirely.

    What I would suggest is something like the following just as a test:

    Code (csharp):
    1.  
    2. void OnBuyButtonClicked()
    3. {
    4.     PurchaseIAPItem("your.iap.here");
    5. }
    6.  
    7. void PurchaseIAPItem(string a_ProductID)
    8. {
    9.     StartCoroutine(PurchaseIAPItemDelayed(a_ProductID));
    10. }
    11.  
    12. IEnumerator PurchaseIAPItemDelayed(string a_ProductID)
    13. {
    14.     yield return new WaitForSeconds(UnityEngine.Random.Range(1f, 2f));
    15.    
    16.     WP8Goodies.IAP.RequestPurchase(a_ProductID);
    17. }
    18.  
    This will ensure two things:

    1. It will (most of the time) ensure it is not called twice in a row (due to the random delay).
    2. It will ensure that any other WP8 dialogues that are being used will be finished up by the time the IAP purchase will be processed.

    If you can run this test and see if it works for you then, that will limit what the possibilities are for your error.

    Cheers,

    -Kyle
     
  14. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi TerraCo,

    Not sure whats happening with fuelcan then - is the setup exactly the same as for the hundredbucks? Try swapping the two and see if the reverse happens (hundredbucks doesnt work, but fuelcan does).

    If when you swap them, fuelcan still doesnt work, it looks like it is a problem with the IAP product ID in the beta store - try deleting / recreating it.

    If when you swap them, hundredbucks stops working, then there is a problem with how you are calling the function to buy the fuelcan and you should check it to make sure it works in the same way.

    Let me know how this goes for you,

    -Kyle
     
  15. amolnaik3

    amolnaik3

    Joined:
    Jul 19, 2011
    Posts:
    13
    OK, Will try the same will get back to you.

    Regards,
    -Amol
     
  16. TerraCo

    TerraCo

    Joined:
    Jun 8, 2013
    Posts:
    26
    Thanks for those suggestions Kyle.

    I have since changed the fuelcan to be an in game item, not purchased through the store. So I should be good from here!

    Thanks for the great support!

    Cheers,

    TerraCo
     
  17. Darjamfar

    Darjamfar

    Joined:
    Jun 4, 2012
    Posts:
    63
    Hello,
    I bought your plugin. I have not tried to implement it yet, it's just a question about process. For iOS Storekit for example you have to request the products first, this is very useful because i can retrieve the price from the store and this can change depending on location and display it to the user.

    I don't see a request product method just RequestPurchase. Please help
     
  18. asharsamdani

    asharsamdani

    Joined:
    Jan 20, 2013
    Posts:
    4
    i am getting this error

    failed to purchase [in app identifier] with error[An unknown error]. If you are running directly from a unity build without any link to Windows Store this can happen.
     
  19. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi DarJam,

    This functionality should be coming in an update soon to the asset store - keep an eye out for it!

    -Kyle
     
  20. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi,

    You will get this error if you build and run the game directly from the unity editor. You cannot test IAP for Windows Phone without linking it to the Windows Phone Store - you can do this by logging in to the Windows Phone Developer Centre and setting up a new Beta app (which will remain private), then following the instructions there to upload your app and test it in the beta store.

    Let me know if you have any problems,

    -Kyle
     
  21. asharsamdani

    asharsamdani

    Joined:
    Jan 20, 2013
    Posts:
    4
    all m doing is generating the BFS Goodies Plugin code from unity3d after changing the in-app purchase id to my beta testing ID, and running that on WP8 device

    Do i need to do something more ??
     
  22. asharsamdani

    asharsamdani

    Joined:
    Jan 20, 2013
    Posts:
    4
    heres a screenshot of the status
    $Untitled.png
     
  23. Darjamfar

    Darjamfar

    Joined:
    Jun 4, 2012
    Posts:
    63
    Thanks Kyle for the reply.
    I don't know if MS do currency conversion on IAP, if they don't then it's possible to get away with it by omitting the currency symbol. If MS do currency conversion then its a big miss for me.
     
    Last edited: Sep 26, 2013
  24. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi DarJam,

    My understanding is that it provides a localised string value for the price, so you can just display that string straight in your GUI. But if that doesn't match your needs, then you might be able to parse the string to get some numerical value from it.

    -Kyle
     
  25. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi,

    It looks like it is all set up correctly - but are you running the BETA version of the app, or running straight from unity / visual studio?

    Simply having an app installed that is the same name as a beta app will not work. What you should do is delete your app off your phone, then go to the email you received from the windows store in regards to your Beta app submission. This will give you a link to the store where you can download your app in its BETA form. You can run this downloaded build and test your IAP.

    Let me know if you still have any issues.

    -Kyle
     
  26. asharsamdani

    asharsamdani

    Joined:
    Jan 20, 2013
    Posts:
    4
    didnt got any email from microsoft about the beta build..

    What i did was that i installed the game from visual studio on my phone and uploaded the same xpa to the windows store as beta build.

    Am i doing it wrong ?
     
  27. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi,

    Yeah - that won't work. When you uploaded the beta build, you would have been asked to enter email addresses as recipients for the build. All of the email addresses entered there would have received an email telling them how to download the beta version of the app. Double check to make sure your email is in there, and entered correctly. Note that it might take a few hours for the email to go out.

    -Kyle
     
  28. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    The update has just been approved and is now up in the store!

    This update contains features for loading details about your IAP items, such as their price, so that it can be displayed in-game.

    Hope it helps a few of you requesting this feature!

    -Kyle
     
  29. karios

    karios

    Joined:
    Nov 15, 2012
    Posts:
    12
    Kyle,
    first of all thanx for the plugin! Most things work great for me!
    My most important one seems to be acting weird though, IAPs. I am loading the items correctly from the store to my UI(the game is in beta and the IAPs are also in beta - the game was installed directly from the beta store) but when I request a purchase the result is unpredictable. It can work at one time, taking me to the "Confirm Purchase" Microsoft UI and then back to the game giving me the item and if I try to buy the same IAP, it will just crash the game. Most of the times though, it will crash while trying to buy any item before or after the MS IAP "confirm" UI. It's just an unstable mess :(

    Here is the code I am using:

    For getting the products' info: (this works)
    Code (csharp):
    1.  
    2. WP8Goodies.IAP.OnRetrieveAllProductListingsSucceeded+=addItems;
    3. WP8Goodies.IAP.RequestAllProductListings();
    4.  
    For actually buying the item:
    Code (csharp):
    1.  
    2. WP8Goodies.IAP.OnIAPPurchaseSucceeded+=giveItems;
    3. WP8Goodies.IAP.OnIAPPurchaseFailed+=error;
    4. WP8Goodies.IAP.RequestPurchase(productID);
    5.  
    So I am not doing anything fancy, just normal stuff. And I know it works, because sometimes, well, it works:) Even trying to buy the same item twice (waiting a few seconds in between after the first successful buy) may crash the app.
    All items I mention are consumables.

    Any ideas? Anything I can do to help debug this?
     
  30. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi Kairos,

    I have seen this sort of behaviour pop up for various things - it may be because you are calling the RequestPurchase function multiple times in a single frame. By the looks of the code, it would not happen, but it is possible that the click event you are detecting is firing off the purchase function multiple times. If you are using NGUI for Windows Phone, there have been some old bugs which could trigger the same event multiple times.

    I would suggest trying the sample GUI provided, replace the iap details with your actual IAP details, and then upload that as a beta to the store. If the sample GUI is working fine, then the problem is likely to be in how you're GUI is handling the function call.

    Let me know how it goes for you.

    -Kyle
     
  31. Janne-Ramstedt

    Janne-Ramstedt

    Joined:
    Jul 26, 2012
    Posts:
    1
    Hi,

    Can you add functionality to get receipts?
    I would like to get receipts of all purchased items and as result from purchase.
     
  32. DantaliaN00

    DantaliaN00

    Joined:
    Jun 2, 2013
    Posts:
    2
    What social networks support for winphone?
     
  33. Andrew_at_That_Wonderful_Lemon_Co

    Andrew_at_That_Wonderful_Lemon_Co

    Joined:
    Feb 1, 2014
    Posts:
    23
    Hi there,

    We have implemented the WP8 goodies bundle and managed to get successful purchases through IAP (we are only using consumables). However, we have just had a non-compliant issue come through:

    The application does not award Consumable IAP item(s) properly when the purchase cycle is interrupted.
    Steps to reproduce:
    1. Launch the application.
    2. Purchase 15 stars.
    3. After the purchase completes but prior to the purchase flow returning to the application, press the device start button.
    4. Re-launch the application.
    5. Note that the stars have not been awarded.
    6. Attempt to repurchase 15 stars.
    7. Note that the stars cannot be purchased because the previous purchase has not been awarded.

    In addition to this we were also sent through a link to:
    http://blogs.windows.com/windows_ph...-to-test-common-in-app-failure-scenarios.aspx where they reference DoFullfillment() from the In-App Purchase API documentation.


    On our side, at the start we call the WP8Goodies.IAP.RequestAllProductListings() after subscribing to all the events
    and after that we call WP8Goodies.IAP.RequestPurchase(). All works fine but we don't know how to deal with the situation where the plugin has failed deal with a purchase and not redeemed a consumable.

    Have we missed a step somewhere or is this possibly a bug in the plug-in?

    This currently applies to a live product so we would love to resolve this as soon as possible.

    Thanks for your time, your help is appreciated,

    Andrew M.
     
  34. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi Andrew,

    Thanks for your bug report - it seems that by quitting before the purchase has been fully completed as described in the steps above, the plugin doesn't get a chance to fulfill the purchase properly, and doesn't check for purchases in progress. I will work on adding this functionality in ASAP with a new version.

    -Kyle
     
    Vishal101090 likes this.
  35. Andrew_at_That_Wonderful_Lemon_Co

    Andrew_at_That_Wonderful_Lemon_Co

    Joined:
    Feb 1, 2014
    Posts:
    23
    Brilliant stuff Batman!

    Please let us know when that is ready to rock :)

    A.
     
  36. PuneetK

    PuneetK

    Joined:
    Sep 2, 2013
    Posts:
    75
    Hi,
    I've been using your plugin a lot lately, especially in my game Pastry Push and now Hues.

    I want to know if there is a way to check if a user has already purchased some items (Inapp purchase) so that I can give the user the benefit, after he switch device.

    In my case actually, one of the In app was not set up properly, so people didn't recieve the benefits from the purchase but were charged for it. So I need to check if any users have purchased it previously, and give them the required benefits.

    Thanks,
    Waiting for your reply
     
  37. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi PuneetK,

    What you are after is the function WP8Goodies.IAP.RequestAllProductListings() function. When you call that, it will fire off an event which you can listen to with WP8Goodies.IAP.OnRetrieveAllProductListingsSucceeded (or WP8Goodies.IAP.OnRetrieveAllProductListingsFailed if there is an error). This will pass a list of ProductListing objects which you can look at to see if they are active or not for the current user.

    Hope this helps.

    -Kyle
     
  38. PuneetK

    PuneetK

    Joined:
    Sep 2, 2013
    Posts:
    75
    So, you are saying that RequestAllProductListings() will give me a list of products for the current user?

    The way I expected that function to work is that it will give me a list of products from the app store.
    Please correct me and clarify
     
  39. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi PunteetK,

    Sorry you are right - I skipped a step in my instructions. You can RequestAllProductListings to get a list of the IAP options that can be purchased in the app.

    Then you want to call WP8Goodies.IAP.GetProductLicense("productID") to get the license for a specific IAP product. You can then check the .IsActive value on this ProductLicense - if it is true, then the player owns that IAP (they have bought it).

    Hope this helps,

    -Kyle
     
  40. PuneetK

    PuneetK

    Joined:
    Sep 2, 2013
    Posts:
    75
    Hi Kyle,

    Windows has decided to feature my game on the Windows Phone store but they said I had 2 problems with IAP. I do not know how to resolve these issues using your plugin, and I need to fix it immediately.
    Please send me a sample source code of how I will deal with this in the game.


    This is the first issue, related to product consumption:
    This is the second issue, related to product prices:
    I can also provide you with my current implementation for IAP.

    It is like this
    Code (CSharp):
    1. void OnRetrieveProductListingSucceeded (string a_ProductID, WP8Goodies.ProductListing a_ProductListing)
    2.     {
    3.         switch(a_ProductID)
    4.         {
    5.         case("@@@@"):
    6.             if(PlayerPrefs.GetInt("######", 0) == 0)
    7.             {
    8.                 PlayerPrefs.SetInt("######", 1);
    9.             }
    10.             break;
    11.         case("*******"):
    12.             if(PlayerPrefs.GetInt("######", 2) != 14)
    13.             {
    14.                 PlayerPrefs.SetInt("######", 14);
    15.             }
    16.             break;
    17.         }
    18.         m_ProductListingResponse = "Got listing for " + a_ProductID + " of type " + a_ProductListing.ProductType + " for price " + a_ProductListing.FormattedPrice;
    19.     }
     
  41. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi PuneetK,

    For the first issue, I have a new fix that is almost ready for release - if you send me a PM with your Asset Store Invoive No. for the purchase, I can send you the early build. This will fix your first issue, and allow you to properly award the consumable IAP even after exiting the flow part-way through the purchase as described.

    The second issue however you should be able to resolve by making use of the value returned by ProductListing.FormattedPrice for each item - it should return a value that you should display for each IAP item inside your application that will match the price shown in their store page, rather than hard-coding the cost values to just show the prices for one region (e.g. US$).

    Let me know if you have any issues with this,

    -Kyle
     
  42. PuneetK

    PuneetK

    Joined:
    Sep 2, 2013
    Posts:
    75
    Sent you a mail.

    Also, could you put up some sample code for the second issue?
     
  43. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi PuneetK,

    Here is how you should display the prices in-game, note that you need to do something with the ProductListing details to update your GUI based on how your game works, this part is up to you.

    Code (CSharp):
    1. void UpdateAllProductListings()
    2.     {
    3.         WP8Goodies.IAP.OnRetrieveAllProductListingsFailed += HandleOnRetrieveAllProductListingsFailed;
    4.         WP8Goodies.IAP.OnRetrieveAllProductListingsSucceeded += HandleOnRetrieveAllProductListingsSucceeded;
    5.         WP8Goodies.IAP.RequestAllProductListings();
    6.     }
    7.  
    8.     void HandleOnRetrieveAllProductListingsSucceeded (List<WP8Goodies.ProductListing> a_AllProductListings)
    9.     {
    10.         WP8Goodies.IAP.OnRetrieveAllProductListingsFailed -= HandleOnRetrieveAllProductListingsFailed;
    11.         WP8Goodies.IAP.OnRetrieveAllProductListingsSucceeded -= HandleOnRetrieveAllProductListingsSucceeded;
    12.  
    13.         //Just retrieved all the product listings - need to go through and update some GUI for my items
    14.         for(int i = 0; i < a_AllProductListings.Count; i++)
    15.         {
    16.             WP8Goodies.ProductListing _ProductListing = a_AllProductListings[i];
    17.  
    18.             //Use this product listing to update your GUI - create a new button for it, or just change some text fields
    19.             string _ProductName = _ProductListing.Name;
    20.             string _ProductID = _ProductListing.ProductId;
    21.             string _ProductPrice = _ProductListing.FormattedPrice;
    22.  
    23.             Debug.Log("You should charge a total of [" + _ProductPrice + "] for product [" + _ProductName + "] with ID [" + _ProductID + "].");
    24.         }
    25.     }
    26.  
    27.     void HandleOnRetrieveAllProductListingsFailed (string a_ErrorMessage)
    28.     {
    29.         WP8Goodies.IAP.OnRetrieveAllProductListingsFailed -= HandleOnRetrieveAllProductListingsFailed;
    30.         WP8Goodies.IAP.OnRetrieveAllProductListingsSucceeded -= HandleOnRetrieveAllProductListingsSucceeded;
    31.  
    32.         Debug.LogError("Got an error when trying to retrieve all product listings : " + a_ErrorMessage);
    33.     }
     
  44. PuneetK

    PuneetK

    Joined:
    Sep 2, 2013
    Posts:
    75
    Will I be able to test this from a build directly run from Unity?

    Here's my implementation, the rest of the code is exactly the same as yours. Let me know if it's right.

    Code (CSharp):
    1. void HandleOnRetrieveAllProductListingsSucceeded (List<WP8Goodies.ProductListing> a_AllProductListings)
    2.     {
    3.         WP8Goodies.IAP.OnRetrieveAllProductListingsFailed -= HandleOnRetrieveAllProductListingsFailed;
    4.         WP8Goodies.IAP.OnRetrieveAllProductListingsSucceeded -= HandleOnRetrieveAllProductListingsSucceeded;
    5.        
    6.         //Just retrieved all the product listings - need to go through and update some GUI for my items
    7.         for(int i = 0; i < a_AllProductListings.Count; i++)
    8.         {
    9.             WP8Goodies.ProductListing _ProductListing = a_AllProductListings[i];
    10.            
    11.             //Use this product listing to update your GUI - create a new button for it, or just change some text fields
    12.             string _ProductName = _ProductListing.Name;
    13.             string _ProductID = _ProductListing.ProductId;
    14.             string _ProductPrice = _ProductListing.FormattedPrice;
    15.             switch(_ProductID)
    16.             {
    17.             case("endless"):
    18.                 PlayerPrefs.SetString("endlessPriceLocal", _ProductPrice);
    19.                 break;
    20.             case("huesAllUnlocked"):
    21.                 PlayerPrefs.SetString("unlockPriceLocal", _ProductPrice);
    22.                 break;
    23.             case ("huesbasic"):
    24.                 PlayerPrefs.SetString("basicPriceLocal", _ProductPrice);
    25.                 break;
    26.             case ("huesmedium"):
    27.                 PlayerPrefs.SetString("mediumPriceLocal", _ProductPrice);
    28.                 break;
    29.             case ("huesadvanced"):
    30.                 PlayerPrefs.SetString("advancedPriceLocal", _ProductPrice);
    31.                 break;
    32.             }
    33.             Debug.Log("You should charge a total of [" + _ProductPrice + "] for product [" + _ProductName + "] with ID [" + _ProductID + "].");
    34.         }
    35.     }
    And in the GUI Code, I am just pasting the PlayerPrefs value there.

    Let me know if this is correct?
     
  45. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi PuneetK,

    That looks good - all you have to do next is when the user navigates to the IAP Purchase screen, you will update the text labels using these player prefs values, e.g:

    Code (CSharp):
    1. EndlessPurchasePrice.text = PlayerPrefs.GetString("endlessPriceLocal");
     
  46. PuneetK

    PuneetK

    Joined:
    Sep 2, 2013
    Posts:
    75
    Yep, that's what I've done!
     
  47. bbeckford

    bbeckford

    Joined:
    Apr 18, 2013
    Posts:
    5
    Hi there, just bought the plugin, not sure if this is the right place to get support.

    I'm trying to update live tiles, using the following code:

    Code (CSharp):
    1. string liveTileContent = "Best Score: 100";
    2. WP8LiveTileHelper.UpdateFlipTileData("", 0, "Stats", liveTileContent, liveTileContent,
    3.     "appdata:/Assets/WP8Tiles/tile_small.jpg",
    4.     "appdata:/Assets/WP8Tiles/tile_med.jpg",
    5.     "appdata:/Assets/WP8Tiles/tile_large.jpg");
    I get the following error when running the game:

    An exception of type 'System.UriFormatException' occurred in System.ni.dll and wasn't handled before a managed/native boundary
    Exception: Invalid URI: The format of the URI could not be determined.
    Type: System.UriFormatException
    Module: System
    InnerException: <No Data>
    AdditionalInfo:<No Data>
    at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
    at System.Uri..ctor(String uriString)
    at WP8Goodies.LiveTile.UpdateFlipTileData(String a_Title, Int32 a_Count, String a_BackTitle, String a_BackContent, String a_WideBackContent, String a_SmallBackgroundURL, String a_BackgroundURL, String a_WideBackgroundURL, String a_BackBackgroundURL, String a_WideBackBackgroundURL)
    at WP8LiveTileHelper.UpdateFlipTileData(String a_Title, Int32 a_Count, String a_BackTitle, String a_BackContent, String a_WideBackContent, String a_SmallBackgroundURL, String a_BackgroundURL, String a_WideBackgroundURL, String a_BackBackgroundURL, String a_WideBackBackgroundURL)
    at GameProgress.SaveToDisk()
    at GameManager.SaveProgress()
    at EventDelegate.Execute()
    at EventDelegate.Execute(List`1 list)
    at UIButton.OnClick()
    at UIButton.$Invoke1(Int64 instance, Int64* args)
    at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method)

    I have also tried using the standard code that comes with the plugin instead and I get exactly the same error:

    Code (CSharp):
    1. WP8LiveTileHelper.UpdateFlipTileData("test", 1, "Silly Stats", "Silly Stats", "Silly Stats",
    2.     "http://profile.ak.fbcdn.net/hprofile-ak-ash3/s160x160/164146_176567499045827_1075200_a.jpg",
    3.     "http://profile.ak.fbcdn.net/hprofile-ak-ash3/s160x160/164146_176567499045827_1075200_a.jpg",
    4.     "http://blowfishstudios.com/sites/all/themes/blowfish/logo.png");
    If anyone could point me in the right direction that would be great! Thanks!
     
  48. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    882
    Hi bbeckford,

    What version of Unity / Windows Phone are you running it on?
     
  49. bbeckford

    bbeckford

    Joined:
    Apr 18, 2013
    Posts:
    5
    Unity 4.5.3 and Windows Phone 8 (not got device with me right now for the actual version number but it's the latest version a UK Lumia 820 can be).

    Thanks Kyle!!
     
  50. bbeckford

    bbeckford

    Joined:
    Apr 18, 2013
    Posts:
    5
    The actual OS version is 8.0.10517.150.

    Also, is "appdata:/Assets/WP8Tiles/tile_small.jpg" the right URL structure for a local image?

    Thanks