/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!

  \page qtpurchasing-windowsstore.html
  \title Registering Products in Windows Store
  \brief A short guide to registering in-app products in Windows Store.

  This guide provides a brief introduction to registering an application
  and its in-app products on Windows Store.

  In-App purchasing for WinRT differentiates between two modes:
  \list
   \li \c{Simulation}: All Windows Store interaction is emulated and controlled
   via a configuration XML file. A project containing this file will fail
   certification and cannot be published.
   \li \c{Store interaction}: The application talks to the Windows Store
   directly without any layer in between. This binary can neither be side-loaded
   nor tested locally. The user has to retrieve the app through the Windows
   Store itself.
  \endlist

  \section1 Using the Simulation Mode

  During the development process it is not allowed to interact with the Windows
  Store directly. Instead, an XML file has to be used, describing the available
  in-app products and the license of the application itself. Go to the
  \l{https://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.store.currentappsimulator.aspx}{MSDN documentation}
  for more information on the format of this XML file.

  This XML file has to be added to the root directory of the application
  resources and named \b{QtStoreSimulation.xml}.

  \section1 Using the Windows Store
  \section2 Adding In-App Products to Windows Store
  In order to access in-app products from your application, you must register
  them to the Windows Store. Go the the \uicontrol{IAPs} page and click
  \uicontrol{Create a new IAP}.

  Fill out the following information about your product:
  \list
   \li \uicontrol{Product type} – Choose either \uicontrol{Consumable} or
   \uicontrol{Durable} depending on the type of the in-app product. Note that
   you will \b{not} be able to change this later.
   \li \uicontrol{Product ID} – An identifier that is used to access the
   product from your code.
   \li \uicontrol{Pricing and Availability} – Price for the product and
   the geographical areas where it is available.
  \endlist

  In-app products will be available once you have published the application.

  \section2 Publishing Your Application

  In order to test in-app purchases in your application, you first have to
  publish it. To limit the users who can access the application before it is
  ready for production, it can be published as either alpha or beta.

  \section1 Platform Notes

  The Windows Store provides a way to set an application into trial mode and
  buy the application itself via in-app purchases. To reflect this
  functionality, the WinRT backend uses the \b{app} keyword as an
  \l{QInAppProduct::identifier}{identifier}. If a product query for \b{app}
  succeeds, the current license is valid. The
  \l{QInAppProduct::title()}{product name} itself will provide information on
  the license state of the app and can have the following content:

  \list
   \li \c{Trial period}: The app is in trial mode and can be purchased.
   \li \c{Fully licensed}: The app has been bought.
  \endlist

  If a product query for \b{app} fails, then either the trial has expired
  or the license is invalid. Your app should check for this product and react
  accordingly, for instance by showing a dialog to the user.

*/

