[Q] In-App-Billing

Search This thread

ueen

Member
Feb 8, 2014
5
0
Hello,
i've some issues to implement the in-app-billing system; here'S the code:

Code:
		 case R.id.item2:
		    new Thread(new Runnable() {
		        public void run() {
		        	ArrayList<String> skuList = new ArrayList<String> ();
		        	skuList.add("developersupported");
		        	Bundle querySkus = new Bundle();
		        	querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
		        	
		        	try {
						Bundle skuDetails = mService.getSkuDetails(3, 
								   getPackageName(), "inapp", querySkus);
						
						int response = skuDetails.getInt("RESPONSE_CODE");
						if (response == 0) {
						   ArrayList<String> responseList
						      = skuDetails.getStringArrayList("DETAILS_LIST");
						   
						   for (String thisResponse : responseList) {
						      JSONObject object = new JSONObject(thisResponse);
						      String sku = object.getString("productId");
						      String price = object.getString("price");
						      //if (sku.equals("sup")) mPremiumUpgradePrice = price;
						   }
						}

						
					} catch (RemoteException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					} catch (JSONException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
		        	
		        	
		        	
		        }
		    }).start();	
		   
			try {
				 Bundle buyIntentBundle = mService.getBuyIntent(3, getPackageName(),
							"developersupported", "inapp", "payed");
					
					PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
					
				startIntentSenderForResult(pendingIntent.getIntentSender(),
						   1001, new Intent(), Integer.valueOf(0), Integer.valueOf(0),
						   Integer.valueOf(0));
			} catch (SendIntentException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (RemoteException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

The code is from the documentaion "Implementing In-app Billing (IAB Version 3)".
the app conmects to google but the after loaing, theres this error like "your product wasnt found".
If the code correct? i set up an item in the developer console with the name "developersupported".
If you wanna try, the app is called "Clapperboard" in the Play Store
Thanks in advance!
ueen
 

boggartfly

Senior Member
Dec 22, 2011
60
12
Madison
www.twitter.com
Sometimes it takes a while for Google's servers to understand that you actually launched a new IAP item. What you can do is:-
1)Sign and export your apk and then upload it as draft . Using the same apk test it locally.
2)Also I recommend using the updated Billing v3 API. The previous v3 had some bugs and it hence has been fixed.
3)Wait and watch. You'll find the item in some hours....

I've had this experience with this.
Pls Give a thanks if this post helped you! :)

Sent from my Nexus 4 using XDA Premium 4 mobile app
 
  • Like
Reactions: ueen

ueen

Member
Feb 8, 2014
5
0
Sometimes it takes a while for Google's servers to understand that you actually launched a new IAP item. What you can do is:-
1)Sign and export your apk and then upload it as draft . Using the same apk test it locally.
2)Also I recommend using the updated Billing v3 API. The previous v3 had some bugs and it hence has been fixed.
3)Wait and watch. You'll find the item in some hours....

I've had this experience with this.
Pls Give a thanks if this post helped you! :)

Sent from my Nexus 4 using XDA Premium 4 mobile app

Well i waited over 12h and it still doesnt work.
whats that with the updated v3? I cant post links but if xou go to the devloper android page heres the path /google/play/billing/billing_integrate.html theres the code from.
Is the code correct?
I published the non app with the nonfunctionable in-app-billing and i really like to fix this fast! Please help!
 

boggartfly

Senior Member
Dec 22, 2011
60
12
Madison
www.twitter.com
Hello,
i've some issues to implement the in-app-billing system; here'S the code:

Code:
		 case R.id.item2:
		    new Thread(new Runnable() {
		        public void run() {
		        	ArrayList<String> skuList = new ArrayList<String> ();
		        	skuList.add("developersupported");
		        	Bundle querySkus = new Bundle();
		        	querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
		        	
		        	try {
						Bundle skuDetails = mService.getSkuDetails(3, 
								   getPackageName(), "inapp", querySkus);
						
						int response = skuDetails.getInt("RESPONSE_CODE");
						if (response == 0) {
						   ArrayList<String> responseList
						      = skuDetails.getStringArrayList("DETAILS_LIST");
						   
						   for (String thisResponse : responseList) {
						      JSONObject object = new JSONObject(thisResponse);
						      String sku = object.getString("productId");
						      String price = object.getString("price");
						      //if (sku.equals("sup")) mPremiumUpgradePrice = price;
						   }
						}

						
					} catch (RemoteException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					} catch (JSONException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
		        	
		        	
		        	
		        }
		    }).start();	
		   
			try {
				 Bundle buyIntentBundle = mService.getBuyIntent(3, getPackageName(),
							"developersupported", "inapp", "payed");
					
					PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
					
				startIntentSenderForResult(pendingIntent.getIntentSender(),
						   1001, new Intent(), Integer.valueOf(0), Integer.valueOf(0),
						   Integer.valueOf(0));
			} catch (SendIntentException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (RemoteException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

The code is from the documentaion "Implementing In-app Billing (IAB Version 3)".
the app conmects to google but the after loaing, theres this error like "your product wasnt found".
If the code correct? i set up an item in the developer console with the name "developersupported".
If you wanna try, the app is called "Clapperboard" in the Play Store
Thanks in advance!
ueen

Use the samples available for In app billing . What you can do is extract code which is suitable and port it to where you want. Also copy relevant class files. Please also give credit to the original developer who wrote the code as it is kanging someone else's code..

That's the easiest way to get up and running. Don't worry about anything else buddy. Keep coding.
 

ueen

Member
Feb 8, 2014
5
0
ok i solved the issue by de installing the debug vrsion and installing the appstore version of my app.
thanks for your support.
btw: i used the samples from the google android documentation.
 

boggartfly

Senior Member
Dec 22, 2011
60
12
Madison
www.twitter.com
Sometimes it takes a while for Google's servers to understand that you actually launched a new IAP item. What you can do is:-
1)Sign and export your apk and then upload it as draft . Using the same apk test it locally.
2)Also I recommend using the updated Billing v3 API. The previous v3 had some bugs and it hence has been fixed.
3)Wait and watch. You'll find the item in some hours....

I've had this experience with this.
Pls Give a thanks if this post helped you! 

Sent from my Nexus 4 using XDA Premium 4 mobile app
I told you. See point number 1.
Also do read the other documentation if necessary.

Please give a thanks if you think this post helped you!

Sent from my Nexus 4 using XDA Premium 4 Mobile App .
 
  • Like
Reactions: ueen

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Sometimes it takes a while for Google's servers to understand that you actually launched a new IAP item. What you can do is:-
    1)Sign and export your apk and then upload it as draft . Using the same apk test it locally.
    2)Also I recommend using the updated Billing v3 API. The previous v3 had some bugs and it hence has been fixed.
    3)Wait and watch. You'll find the item in some hours....

    I've had this experience with this.
    Pls Give a thanks if this post helped you! :)

    Sent from my Nexus 4 using XDA Premium 4 mobile app
    1
    Sometimes it takes a while for Google's servers to understand that you actually launched a new IAP item. What you can do is:-
    1)Sign and export your apk and then upload it as draft . Using the same apk test it locally.
    2)Also I recommend using the updated Billing v3 API. The previous v3 had some bugs and it hence has been fixed.
    3)Wait and watch. You'll find the item in some hours....

    I've had this experience with this.
    Pls Give a thanks if this post helped you! 

    Sent from my Nexus 4 using XDA Premium 4 mobile app
    I told you. See point number 1.
    Also do read the other documentation if necessary.

    Please give a thanks if you think this post helped you!

    Sent from my Nexus 4 using XDA Premium 4 Mobile App .