Search Unity

prime31 store plugin for windows phone

Discussion in 'Windows' started by LaurensiusTony, Jul 13, 2014.

  1. LaurensiusTony

    LaurensiusTony

    Joined:
    May 22, 2013
    Posts:
    78
    Hi, anyone using prime31 store plugin for in-app purcase in windows phone 8? can you tell me or give me some tutorial of using it? i just don't understand how it works, already read documentation but still confuse and the demo scene is not helping at all (because i don't see it working)

    maybe to making it more easy to answer i will point out what i want to know
    1. how show my in-app purcase?
    2. how buy?
    3. how to save what i have purcase? like i purcase 1000 gold for .99$...

    update:
    okay after trying to figuring it out by myself, i managed to make test mode to work by using this
    Code (CSharp):
    1. Store.loadListingInformation(listingInfo =>
    2.         {
    3.             bundle1 = listingInfo.productListings["bundle1"].name;
    4.             bundle1price = listingInfo.productListings["bundle1"].formattedPrice;
    5.         });
    but when i try to get my real product, i can't make it appear.... anyidea why?
     
    Last edited: Jul 14, 2014
  2. hiepchip

    hiepchip

    Joined:
    Jun 27, 2014
    Posts:
    2
    just show it like other offline items. when player click to buy, use this:
    Code (CSharp):
    1. Store.requestProductPurchase ("product_id", ( receipt, error ) => {
    2.                                                 if (receipt != null) {
    3.                                                         Debug.Log ("purchase completed with receipt: " + receipt);
    4.                                                 } else if (error != null) {
    5.                                                         //show error message
    6.                                                         Debug.Log ("error purchasing product: " + error);
    7.                                                 }
    8.                                         });
     
    Last edited: Jul 15, 2014
  3. LaurensiusTony

    LaurensiusTony

    Joined:
    May 22, 2013
    Posts:
    78
    yea i using the same method to showing offline product but not working...
    that is my example code for showing product but it only works for offline but i can't get data from microsoft server
     
  4. hiepchip

    hiepchip

    Joined:
    Jun 27, 2014
    Posts:
    2
    if you want to buy from microsoft server, you must submitting your app for beta distribution, then create some products. and wait for microsoft server validating.
     
  5. LaurensiusTony

    LaurensiusTony

    Joined:
    May 22, 2013
    Posts:
    78
    my product already registered but i don't know how to show like my product name and price into my UI or to my variable
     
  6. LaurensiusTony

    LaurensiusTony

    Joined:
    May 22, 2013
    Posts:
    78
    okay i managed to figure it that this is maybe the code for showing my in-app product from microsoft server... but it's not working... maybe anyone can correct it?
    Code (CSharp):
    1.         Store.loadListingInformation(listingInfo =>
    2.         {
    3.             var productListings = listingInfo.productListings.Values;
    4.             foreach (var value in productListings)
    5.             {
    6.                 bundles1.Add(value.name);
    7.                 bundles1price.Add(value.formattedPrice);
    8.             }
    9.             bundle1 = bundles1[0];
    10.             bundle1price = bundles1price[0];
    11.            
    12.         });