Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

[Windows Phone 8] Delete In-App Purchase 'history'?

Discussion in 'Windows' started by fendorio, Apr 17, 2014.

  1. fendorio

    fendorio

    Joined:
    Mar 8, 2014
    Posts:
    19
    Should probably have posted this on a Msdn somewhere but here goes.

    I'm beta testing a game I've made, the In-app purchasing works fine.

    Is there a way I can delete my purchasing history i.e. set the boolean property 'IsActive' of a consumable 'product' to false after it's been purchased? So that I can re-test the purchase.

    Thanks in advance
     
  2. pumpkinszwan

    pumpkinszwan

    Joined:
    Feb 6, 2014
    Posts:
    214
    Are you testing in Visual Studio? If so, redeploying the app should work as the fake purchases are not kept.

    e.g. when using the simulator, close the simulator and re-run the app. All in-app purchases in the simulator should reset to not purchased.
    I'm not sure how it works on a device. You may simply need to uninstall and re-install.

    You didn't specify, but I assume you're using the CurrentAppSimulator to simulate purchases. If you've done real purchases they cannot be removed from your account to the best of my knowledge.

    This works for me, and I did it just this morning (a non-Unity project however).
     
  3. iAbhinav

    iAbhinav

    Joined:
    May 1, 2014
    Posts:
    2
    can you please guide me how to do in app purchase for windows phone through unity, i am highly confused !! please help !!
     
  4. GarthSmith

    GarthSmith

    Joined:
    Apr 26, 2012
    Posts:
    1,240
  5. iAbhinav

    iAbhinav

    Joined:
    May 1, 2014
    Posts:
    2
    is there any free alternatives too for doing so ?
     
  6. RamaMurthyVeera

    RamaMurthyVeera

    Joined:
    May 5, 2014
    Posts:
    1
    Hi IAbhinav IAP for unity windows phone really easy you can go through the following link.

    http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj681689(v=vs.105).aspx

    call a method from unity for in app request if in app succes reply back to unity with success else fail
    private void MakeAPurchase()
    {

    Dispatcher.BeginInvoke(async () =>
    {

    Store.CurrentApp.LicenseInformation.ProductLicenses[productId]; //check whether he purchased or not
    if (licence.IsActive)
    {
    //give game reward items from here
    Store.CurrentApp.ReportProductFulfillment(productId);
    }
    else //make a new purchase request
    {
    await Store.CurrentApp.RequestProductPurchaseAsync(productId, false);

    var mproductLicense = Store.CurrentApp.LicenseInformation.ProductLicenses[productId];

    if (mproductLicense.IsConsumable mproductLicense.IsActive) //consumables
    {
    //give coins from here
    Store.CurrentApp.ReportProductFulfillment(mproductLicense.ProductId);
    }
    else if (!mproductLicense.IsConsumable mproductLicense.IsActive) //non consumables
    {
    //give non consumable items from here from here
    }
    else
    {
    ExternalInterfaceHandler.Instance.Receiver("false");
    }

    }
    } );
    }
     
    Last edited: May 5, 2014