none
[UWP] Use functionality behind an IAP without to buy that IAP

    Question

  • Hi, I have a misterious problem - a couple of my users can use my IAP functionality without to buy it.
    So here is the description (important are the device-names):

    User-1: has 3 devices, 2 laptops (Laptop#1 and Laptop#2) and 1 phone (Phone#1)
    User-2: has 2 devices, 1 laptop (Laptop#2) and 1 phone (Phone#1)

    All devices are running Win10, no insider, no developers fetures (no side-loading, no developer mode)

    Both users use my app, where is an IAP. They have not purchased it so far. So they cannot use the functionality behind this IAP. They can see just a button saying "buy me". So it seems everything is fine.

    But! User-1 can use this IAP on a Laptop#1 !!! The button on this device is hidden (have a look at the code at the end of this description).
    Also User-2, if he uses the same Laptop#1, cann use this functionality.

    That means, if they share the device Laptop#1, they can use the functionality behind my IAP.
    Both users are members of my family so I am pretty sure they have not purchased it so far. Of course they get a promotional code from me :-)

    Ok, there are 2 IAPs. Both users have purchased (promo-cede) the first one (IAP1). But they have not purchased the second one (IAP2).

    And here is how it is coded:

    // I have a static class
    public static class InAppPurchase { // with a static member public static LicenseInformation _LicenseInformation; // and with a static initialisation function private static LicenseInformation GetLicenseInformation() { // initializes that static member _LicenseInformation = Windows.ApplicationModel.Store.CurrentApp.LicenseInformation; return _LicenseInformation; } bool IsPurchased(string iapname) { if (_LicenseInformation == null) { GetLicenseInformation(); } return _LicenseInformation != null ? _LicenseInformation.ProductLicenses[iapname].IsActive : false; } } //~ class InAppPurchase // I just simple hide the button, if particular IAP is purchased // is IAP1 purchased?
    // Both users have purchased this IAP so they get iap1Purchased == true var iap1Purchased = InAppPurchase.IsPurchased("IAP1"); /*this is a Button*/ iap1PurchaseButton.Visible = iap1Purchased ? Visibility.Collapsed : Visibility.Visible; // later I need to know, if IAP2 is purchased
    // Nobody has purchased this IAP so they SHOULD get iap1Purchased == false
    var iap2Purchased = InAppPurchase.IsPurchased("IAP2"); /*this is a Button*/ iap2PurchaseButton.Visible = iap2Purchased ? Visibility.Collapsed : Visibility.Visible; // finally if the button is visible, the user can buy the IAP and if the button is hidden // the user has already puchased the IAP and the functionality behind this IAP is enabled
    // and here is the problem -> its is true on the Laptop#1

    // expected: false
    // is: true for all users on Laptop#1, on all other machines false if (iap2Purchased) // should be false, but on the Laptop#1 is true { // ok, you can use this functionality... } // note this works everywhere on all machines except on the Laptop#1 // if you interested it is a DELL XPS 13 with Windows 10 Home // I think everything is fine, because on all machines it works, only the DELL is something special




    Wednesday, July 20, 2016 3:42 PM

All replies

  • Hi Tarh ik,
    Your issue is related to the Store apps and I know a better forum for it:" Publishing Windows Store apps", let's move your case to there for better support.

    Best Regards,
    Jayden Gu
    Friday, July 22, 2016 10:40 AM