none
How to Access the Store API (InApp Purchases) via Java? RRS feed

  • Question

  • I have a Java desktop application that I would like to port to the Windows 10 Store. The game is already running on Windows, but in order to publish it in the Windows 10 Store, I need to get in-app purchasing to work? How can one access the Store API from within a Java App?

    Corresponding C# Code:
    https://github.com/Microsoft/DesktopBridgeToUWP-Samples/tree/master/Samples/StoreSample

    What I am particularly interested is in how to port this code to Java:
    https://github.com/Microsoft/DesktopBridgeToUWP-Samples/blob/master/Samples/StoreSample/cs/InAppPurchases/PurchaseDialog/StoreConsumableHelper.cs

    I would like to use the Java Native Access (JNA). Here is how it looks like accessing Windows dlls:
    https://github.com/java-native-access/jna/blob/master/www/GettingStarted.md

    Are there any code samples? How can the StoreContext via StoreContext.GetDefault() obtained from within Java?

    PS: Sorry for the bad formatting. Apparently one cannot create proper links/etc. unless the account is verified. Not even sure how to verify it?


    Friday, March 8, 2019 9:38 AM

All replies

  • Hello noblemaster,

    Since this issue is related to UWP DesktopBridge so I'll move it to UWP forum for more professional support.

    Best regards,

    Rita


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 11, 2019 3:18 AM
  • Hi noblemaster,

    You could refer to the blog Enable In-App Product Purchases for Desktop Bridge Converted Applications for the detail steps.The blog has two important note for you , you need to convert your java desktop app with Desktop Bridge firstly and use the guide in the document:Using the StoreContext class with the Desktop Bridge

    Best regards

    Daisy  Tian


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 11, 2019 8:43 AM
  • Hi Daisy,

    Thanks for the response. Yes, I think the links show what I am trying to accomplish. The problem I am having is how to do the same from within Java? I am sorry, I am not too familiar with how to access the native code exactly? 

    Would it be possible to get some sample Java code from someone from Microsoft to get started? I am pretty sure I am not the only one interested in it?


    Thanks,
    Chris

    Tuesday, March 12, 2019 3:56 AM
  • Hi Chris,

    The samples Create an add-on and Create an add-on submission in document Java sample: submissions for apps, add-ons, and flights may give you some help.

    Best regards

    Daisy  Tian


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 13, 2019 6:40 AM
  • Hi Daisy,

    Thanks for the effort! Anyhow, that's not what I am looking for. Uploading the game to the store isn't the problem. 

    The problem is, I am required to use the Microsoft Store API for purchases/in-app payments. It's against Microsoft's Store policies to submit apps that don't use the Microsoft Store for purchases. How would I access those from a Java app using the UWP DesktopBridge? 

    Thanks,
    Chris

    Wednesday, March 13, 2019 2:03 PM
  • I too have the same problem. My Java based app Binfer was rejected citing this reason and I am unable to find any way to accomplish this using Java.
    Tuesday, May 7, 2019 1:38 PM
  • Any update on sample code?
    Thursday, July 11, 2019 12:55 PM