locked
RequestProductPurchaseAsync(): deprecated and new ones

    Question

  • I am about to migrate my app from Windows 8 to Windows 8.1. Until now, I used

    public static IAsyncOperation<string> RequestProductPurchaseAsync(
      string productId, 
      bool includeReceipt
    )

    for In-app purchases. This method is declared as deprecated/obsolte now.

    There is a new method:

    public static IAsyncOperation<PurchaseResults> RequestProductPurchaseAsync(
      string productId
    )

    In the help file [link] for this new method is this Remark:

    >>

    Use the LicenseInformation.IsActive property to confirm that a product license is active after a "successful" RequestProductPurchaseAsync call.

    Note  This method of confirming a successful purchase is only applicable to the RequestProductPurchaseAsync overloads that don't return a PurchaseResults object.

    You can see an example of how to use this method in our code sample.

    <<

    What I don't understand:

    1. Why does the first sentence tell us that we should use the IsActive property to confirm a successful purchase while the second sentence tells us that we should not?
    2. Why does this first sentence only exist for the new method and not in the help page for the deprecated method?
    3. Why does the mentioned code sample use IsActive, nevertheless?

    Does anybody understand this?

       

    Wednesday, January 28, 2015 7:23 PM

Answers

  • It makes sense to me.  It looks like they've modified the purchasing to offer more info about the purchase, instead of just returning the receipt.  It makes it easier for devs to know what's going on.

    1)  Don't worry about it.  Use the non-depreciated method and just check the returned object's Status value.  It will be Succeeded if the purchase succeeded, or another code if it fails.

    2) Because there isn't any other way to tell if it succeeded for the depreciated method.

    3) It's not wrong, you can still use it.  In fact, once the purchase has completed, that's how you'd tell across devices or after uninstalls/reinstalls. 


    Darin R.

    Thursday, January 29, 2015 6:23 PM
  • To add to what Darin says, if you find a documentation page confusing please leave feedback through the link at the bottom of the doc page
    Thursday, January 29, 2015 7:09 PM
    Owner

All replies

  • Any full code here?
    Thursday, January 29, 2015 6:41 AM
  • @Nusag Usdaf: My question is not about my app but about errors in the documentation.
    Thursday, January 29, 2015 8:54 AM
  • It makes sense to me.  It looks like they've modified the purchasing to offer more info about the purchase, instead of just returning the receipt.  It makes it easier for devs to know what's going on.

    1)  Don't worry about it.  Use the non-depreciated method and just check the returned object's Status value.  It will be Succeeded if the purchase succeeded, or another code if it fails.

    2) Because there isn't any other way to tell if it succeeded for the depreciated method.

    3) It's not wrong, you can still use it.  In fact, once the purchase has completed, that's how you'd tell across devices or after uninstalls/reinstalls. 


    Darin R.

    Thursday, January 29, 2015 6:23 PM
  • To add to what Darin says, if you find a documentation page confusing please leave feedback through the link at the bottom of the doc page
    Thursday, January 29, 2015 7:09 PM
    Owner