Before you implement 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:
Choose a method for content protection.
Decide how to deliver the in-app purchase items. If you:
bundle the in-app purchase items within your app, you should use Nokia Publish to apply DRM encryption to protect these items from unauthorised distribution.
deliver the in-app purchase items from your own back-end server, you must manage the protection, download, and restoration of these items yourself.
See also step 6 on DRM protection.
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.
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.
Implement the in-app purchase feature.
Implement the in-app purchase feature in your application code:
Enable the user to purchase and restore more than one item. For more information on purchasing and restoring multiple items, see How to implement purchase and restoration of multiple items with In-App Purchase and Java ME.
Enable the user to restore a previously purchased product (if applicable)
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.
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 provides DRM encryption of all
resource files stored under the folders <project_root>\<resource_folder>\drm\data\resourceid_xxxxxx
. These resource files can include image, audio, video, etc. as described
in Protecting content with built-in DRM.
If you are using your own DRM solution, encrypt the content and store the encrypted content in the application.
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.
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.
Submit the application to Nokia Publish.
Submit your final application, without DRM packaging or encryption, to Nokia Publish:
Log in to Nokia Publish.
Select the content item created in step 2.
In the Content Files tab, upload the application files.
In the Distribution tab, specify the target devices, countries, and languages.
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.