Implementing in-app purchase

Before you begin implementing the in-app purchase feature in your application, make sure to familiarize yourself with in-app purchase at large and the basic design guidelines for in-app purchase. You also need to register as a Nokia Publisher and familiarize yourself with the Nokia Store publishing guidelines.

To add the in-app purchase feature into your application:

  1. Choose a method for content protection.

    Decide what kind of protection you want for the purchase items. The application must take care of granting access to the items. The items can be either unlocked in the application after the purchase event (using DRM) or downloaded to the device after the purchase (no DRM).

    See also step 6 on DRM protection.

  2. Add information about the in-app purchase items to Nokia Publish.

    Log in to Nokia Publish, create a new Java content item for the application, and specify the in-app purchase items in the application. Nokia Publish generates a unique ID for each purchase item. You need these IDs in your application to query the purchase item metadata from Nokia Store, and to identify the items that are being purchased through the In-App Purchase API.

    After you submit the content item to Nokia Publish, the in-app purchase metadata is published to Nokia Store and becomes publicly accessible via the In-App Purchase API.

    Tip: To avoid information leaks, provide temporary descriptions when you first create the content item. Provide the real descriptions when you are ready to release your application.

  3. Create the in-app purchase resource files used by the application.

    Create the in-app purchase resource files used by the application and store them in the application project folder structure. For more information, see section Creating the in-app purchase resource files.

  4. Implement the in-app purchase feature.

    Implement the in-app purchase feature in your application code:

  5. Verify the purchase (if applicable).

    If you are using a back end server to store the purchasable content, confirm the product purchase in the back end server by verifying the purchase ticket received from Nokia Store.

    Note: The purchase verification is implemented fully in the back end server. The application plays no part in this process.

  6. Handle DRM-protected content (if applicable).

    If you are using built-in DRM, store the to-be-protected content in the application as per the Nokia Publish requirements. Nokia Publish performs the actual DRM-protection of the content.

    If you are using your own DRM solution, encrypt the content and store the encrypted content in the application.

  7. Provide end user support.

    Provide easy-to-find help and customer service contact information in the application for the user. For design examples, see section Design guidelines.

  8. Test the in-app purchase feature.

    Test your application extensively by purchasing each possible item using each in-app purchasing flow. If your in-app purchase process uses a back end server, use the live version of the server for testing.

  9. Submit the application to Nokia Publish.

    Submit your final application, without DRM packaging or encryption, to Nokia Publish:

    1. Log in to Nokia Publish.

    2. Select the content item created in step 2.

    3. In the Content Files tab, upload the application files.

    4. In the Distribution tab, specify the target devices, countries, and languages.

    5. Select Submit to QA.

    Nokia Publish tests the application and applies DRM protection if requested, and, if the application passes QA, publishes the application to Nokia Store.