×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    7

    Facing issues with the Nokia In-App Purchase API.

    Hi All,

    Have been facing this issue for the past few days. Am trying to build a game which supports In-App Transactions. Have created the In-App Id's for the available items on the Nokia Store and got them approved. However, every time i try to retrieve the Product Data from the game, the return value is -16, which stands for Invalid Product Data which is a Server specific error value. Had managed to run the game in the emulator on a couple of occasions, but never on the device. Suddenly, today even the emulator is not returning any values.

    Anybody else facing this issue and have any suggestions will be hugely appreciated.

    Thanks in advance.
    P.

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: Facing issues with the Nokia In-App Purchase API.

    Hi vishalgondal and welcome to Nokia Discussion Boards,

    So is it that you get -16 on the device always, and now you also get -16 on the emulator? Or is it that you do not get any value at all, on the emulator (does this throw any exception)? Do you use DRM-protected content?

  3. #3
    Registered User
    Join Date
    Jan 2009
    Posts
    7

    Re: Facing issues with the Nokia In-App Purchase API.

    Hi skalogir,

    Thanks. I have had multiple responses on the device ranging from -15, -16 and -35, with -16 being the most common. The emulator does not throw any exception, and currently the callback method productDataReceived() does not get triggered. I can see the http request in the traffic log but no response to the request.

    No DRM-protected content either.

    Thanks,
    P.
    Last edited by vishalgondal; 2011-11-30 at 06:25.

  4. #4
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: Facing issues with the Nokia In-App Purchase API.

    Hi vishalgondal,

    I assume that you have already added the IAP_VARIANTID.TXT and TEST_MODE.TXT files in the resource folder of your project.

    Can you try to compile the application with Nokia SDK 1.1(beta) for Java?
    It can be found here:

    https://projects.developer.nokia.com/NokiaSDKJava/

    On which device(s) are you testing? The In App API is only available for devices with Java Runtime 1.0.0. A list of supported devices can be found here:
    http://www.developer.nokia.com/Devic...vaRuntime1.0.0
    Last edited by skalogir; 2011-11-30 at 14:16.

  5. #5
    Registered User
    Join Date
    Jan 2009
    Posts
    7

    Re: Facing issues with the Nokia In-App Purchase API.

    Hi skalogir,

    Thanks again for your time.

    I have added the IAP_VARIANTID.TXT containing six zero's and an empty TEST_MODE.TXT in the project.

    Tried compiling with the Nokia SDK 1.1 and 1.0. Both are resulting in the same.

    Have sourced a test device from Nokia for the same, a prototype 303.

    The -16 error was being explained as an unexpected server error on the projects.nokia.developer.com website but unfortunately even that has gone down.

    Thanks,
    Prasad.

  6. #6
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: Facing issues with the Nokia In-App Purchase API.

    Hi vishalgondal,

    I could successfully retrieve my product data on Nokia 303 when I compiled my midlet with Nokia SDK 1.1 (beta) for Java with the following code:
    Code:
    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Form;
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.midlet.MIDletStateChangeException;
    import com.nokia.mid.payment.IAPClientPaymentException;
    import com.nokia.mid.payment.IAPClientPaymentListener;
    import com.nokia.mid.payment.IAPClientPaymentManager;
    import com.nokia.mid.payment.IAPClientProductData;
    import com.nokia.mid.payment.IAPClientUserAndDeviceData;
    
    public class IAPtest extends MIDlet implements IAPClientPaymentListener {
    	Form mainform;
    	Display display;
    	
    	protected void destroyApp(boolean arg0) throws MIDletStateChangeException {}
    	protected void pauseApp() {}
    
    	protected void startApp() throws MIDletStateChangeException {
    		display=Display.getDisplay(this);
    		mainform=new Form("IAP");
    		display.setCurrent(mainform);
    		try {
    		    IAPClientPaymentManager manager = IAPClientPaymentManager.getIAPClientPaymentManager();
    		    IAPClientPaymentManager.setIAPClientPaymentListener(this);
    		    int status = manager.getProductData("123456"); //Your ID here
    		    if (status != IAPClientPaymentManager.SUCCESS) {
    		    	mainform.append("Not Product Data will be Received\n");
    		    }
    		} catch (IAPClientPaymentException e) {
    			mainform.append("IAPClientPaymentException\n");
    		}
    	}
    	public void productDataReceived(int status, IAPClientProductData pd) {
    	    if (status == IAPClientPaymentListener.OK) {
    
    	        String title = pd.getTitle();
    	        String price = pd.getPrice();
    	        String sdesc = pd.getShortDescription();
    
    	       mainform.append(title+"\n");
    	       mainform.append(price+"\n");
    	       mainform.append(sdesc+"\n");
    	    }	
    	    else
    	    {
    	    	System.out.println("Product data retrieval failed with code:" +status);
    	    }
    	}
    	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) {}
    
    }
    I assume that the status from the QA review of your content item is still set to "Passed". Can you verify this from your Nokia Publisher account?
    Can you try the code above by just changing the Publisher ID to the one you are using?
    Are you using a back end server to store the purchasable content or do you connect directly? If you are using a back end server, you might need to check this link:

    http://library.developer.nokia.com/i...9EC5989D0.html

  7. #7
    Registered User
    Join Date
    Jan 2009
    Posts
    7

    Re: Facing issues with the Nokia In-App Purchase API.

    Hi skalogir,

    Sorry for responding so late.

    But using the code that you have shared hasnt had much success for me.

    The In-App item ID that i tried has been approved and the QA status for the same shows as Passed. Not sure if i had to use the In-App id or the publisher id. With the publisher id, it throws back error code -15, with the In-App ID it throws back -16.

    Not using a back end server to store any content, I am just unlocking pre-existing levels.

    Thanks again for your help,
    P.
    Last edited by vishalgondal; 2011-12-06 at 05:44.

  8. #8
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: Facing issues with the Nokia In-App Purchase API.

    It should work with your In-app ID.
    It could also be that your content has passed QA, but it has not been published. Can you check under the Content tab, in the table that shows your content items that you see something similar to this one?

    In-app purchases: 1 passed
    In-app purchases: 1 / 1 published

    And then when you click on your item> Select In-app purchases, you can see that the publication state is set to "Published" and when clicking on the "View Metadata" you can see the display name, short description and price for your item as you have specified them.

    It could also be a software specific issue. After verifying the above, could you share the software version of your device and the date of release? I managed to make it work on 13.24 (from 01-09-11)

  9. #9
    Registered User
    Join Date
    Jan 2009
    Posts
    7

    Re: Facing issues with the Nokia In-App Purchase API.

    In-app ID: 749088
    Revision: 8
    QA Status Passed
    Publication state Published (revision 8)

    The In-App item shows as published. I can see the Metadata item to reflect the name, desc and price as well.

    The s/w version i have running is 13.34 from 15-09-11.

    Thrashing my brains around on this. Cant find a reason that makes sense.

    Will need to get in touch with the developer support team now for this.

    Thanks for your help.
    P.

  10. #10
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: Facing issues with the Nokia In-App Purchase API.

    I get the following result for your In-app ID:
    null
    5.00 EUR
    null

    on software 13.34 and Variant 00.00

    I can only assume that this is a network related issue, since you can't retrieve your product data neither from the emulator nor from the device. Try to use an alternative network, for example 3G/GPRS connection from your phone (make sure that you can access the internet with the native Internet application) and a fixed line internet connection from your PC.

    Also if you are using NetBeans and not Eclipse, make sure to enable the "In-App Purchase API" Optional Package by right clicking on your Project Properties and selecting Platform.
    Last edited by skalogir; 2011-12-09 at 09:23.

  11. #11
    Registered User
    Join Date
    Jan 2009
    Posts
    7

    Re: Facing issues with the Nokia In-App Purchase API.

    Could you try for In-App Id: 765579

    Using eclipse.

    Thanks.
    P.
    Last edited by vishalgondal; 2011-12-09 at 12:33.

  12. #12
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: Facing issues with the Nokia In-App Purchase API.

    I get:

    null
    1.00 EUR
    Armored

    Did you manage to make it work, at least in the emulator? If you are using the emulator in a corporate environment with firewall, you might need to set a proxy server, otherwise the emulator won't have access to the internet. You can do this as follows: Tools>Preferences>Networking>HTTP Proxy Server

  13. #13
    Registered User
    Join Date
    Jan 2009
    Posts
    7

    Re: Facing issues with the Nokia In-App Purchase API.

    Hi skalogir,

    Have it running in the emulator now, but facing the same issue on the device. Even a test application that i got from the team did not work on the device.

    Also, the getTitle method always returns null for any of the in-app items that i have tried with.

    Thanks,
    P.

  14. #14
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: Facing issues with the Nokia In-App Purchase API.

    You need to modify the packet data settings from Settings>Connectivity>Packet Data>Packet Data Settings>Edit active acc. pt.>Modify or Add the Pack. data acc.pt. accordingly depending on which SIM Card/Operator you are using in order to be able to access the internet on this particular software version. Try to connect to a web site first, with the Internet application to verify that your connection is up and then test the application. If you are using Wifi, it could be again a proxy/router/firewall issue.

    I am raising the title issue as an error internally.

Similar Threads

  1. Which Nokia devices are currently supporting In-App purchase?
    By Atul Prakash in forum Mobile Java General
    Replies: 2
    Last Post: 2011-11-22, 14:21
  2. In-App Purchase
    By mstrug in forum [Closed] Publishing to Nokia Store
    Replies: 16
    Last Post: 2011-05-24, 13:15
  3. nokia 3110c facing few typical problems
    By ganna_ramu in forum General Development Questions
    Replies: 4
    Last Post: 2011-05-17, 15:59
  4. Facing issues in landscape mode
    By vicky_nits in forum Symbian
    Replies: 1
    Last Post: 2010-07-14, 07:19
  5. Where can I purchase FeliCa tags to test my nokia 6212 phone with?
    By nfcslave in forum Near Field Communication
    Replies: 0
    Last Post: 2009-10-28, 18:03

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×