Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Title of purchasable item cannot be retrieved with In-App Purchase API in Series 40

From Wiki
Jump to: navigation, search



The title of a purchasable item cannot be retrieved with In-App Purchase API and null is returned instead.


Each purchasable item contains 4 General In-App Purchase Metadata, that the developer can define on Nokia Store's Publish Web Page:

  • Display Name
  • Short Description
  • Long Description
  • Global Price Point

All Metadata with the exception of Long Description, can be retrieved with the In-App Purchase API. This enables the publisher to display information to the potential customers, before a purchase is initiated. Metadata is represented as Product Data in the API and the following methods can be applied on a Product Data Object:

Metadata Method
Display Name getTitle
Short Description getShortDescription
Global Price Point getPrice

While Short Description and Global Price Point are successfully retrieved, the Display Name of the Purchasable Item cannot be retrieved and null is displayed instead.

How to reproduce

Prior to attempting to retrieve Product Data with In-App Purchase API, a new Content Item needs to be created on Nokia Store's Publish Web page, and a new In-App purchase item, for the created content item needs to be added. The General In-App Purchase Metadata for the In-App purchase item, should be filled out and the item needs to be submitted to QA. As soon as QA approves the In-App purchase item, the Publication State for the item changes to Published and an In-App ID is assigned to the item. This is needed in order for the developer to be able to retrieve the item's Metadata with the API by using the code below:

import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class InAppProductDataRetrievalMIDlet
extends MIDlet
implements IAPClientPaymentListener {
Form mainForm;
Display display;
protected void startApp() throws MIDletStateChangeException {
mainForm=new Form("IAP");
try {
IAPClientPaymentManager manager = IAPClientPaymentManager.getIAPClientPaymentManager();
int status = manager.getProductData("681803"); //BattleTank's Product ID
if (status != IAPClientPaymentManager.SUCCESS) {
mainForm.append("Not Product Data will be Received\n");
} catch (IAPClientPaymentException e) {
public void productDataReceived(int status, IAPClientProductData pd) {
if (status == IAPClientPaymentListener.OK) {
String title = pd.getTitle(); //This should return "BattleTank", instead of null
String price = pd.getPrice();
String sdesc = pd.getShortDescription();
mainForm.append("Short Description:"+sdesc+"\n");
mainForm.append("Product data retrieval failed with code:" +status);
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
protected void pauseApp() {
public void purchaseCompleted(int arg0, String arg1) {
public void userAndDeviceDataReceived(int arg0,IAPClientUserAndDeviceData arg1) {
public void productDataListReceived(int arg0, IAPClientProductData[] arg1) {
public void restorableProductsReceived(int arg0, IAPClientProductData[] arg1) {
public void restorationCompleted(int arg0, String arg1) {

The source code above can be downloaded from here:

The installation files for the source code above can be downloaded from here:

Ensure that there is an active data package connection prior to running the application. This application contacts Nokia Store's back end server.

Actual Result

The following message is displayed on the screen:



Short Description:Full version of Battle Tank

Expected Result

The following message should be displayed on the screen:

Title:Battle Tank


Short Description:Full version of Battle Tank

Affected Devices

This error affects all devices that support the In-App purchase API for Java ME. A list of these devices can be found on the Device Specification page here.


No solution is available.

Article Metadata
Code ExampleTested with
Devices(s): Nokia 303
Created: skalogir (29 Feb 2012)
Last edited: hamishwillee (31 Jul 2013)
This page was last modified on 31 July 2013, at 06:34.
40 page views in the last 30 days.