Android In App Billing DEVELOPER_PAYLOAD not coming through - android

I've been playing around the the Dungeons app and also my own billing code and pretty much have everything working except for one strangeness.
It seems that no matter what I do I can't get the DEVELOPER_PAYLOAD to show up in the JSON signed response. If I'm reading thing right, the docs seem to say that I should see the developer_payload in the JSON market response. The Dungeons app seems to think it should see the developer_payload in the json too.
I haven't gotten it to work in my code and it doesn't seem to work in the Dungeons example either on my phone.
Here are some snippets of my code:
Bundle request = makeRequestBundle("REQUEST_PURCHASE");
request.putString(C.DEVELOPER_PAYLOAD, "testing 123");
C.DEVELOPER_PAYLOAD is:
public static final String DEVELOPER_PAYLOAD = "DEVELOPER_PAYLOAD";
And here's what I'm seeing in the purchase state changed responses
05-14 20:13:08.360: INFO/BillingService(715): purchaseStateChanged got
signedData:
{"nonce":9005407554096378381,"orders":[{"notificationId":"android.test.purchased","orderId":"transactionId.android.test.purchased","packageName":"com.mypackage","productId":"android.test.purchased","purchaseTime":1305429187752,"purchaseState":0}]}
Thanks in advance!
EDIT: I finally figured this out. Turns out that the developer_payload doesn't come through if you're using any of the test android item ids. You have to be using real in app purchase items.

I finally figured this out. Turns out that the developer_payload doesn't come through if you're using any of the test android item ids. You have to be using real in app purchase items.

Related

More than one consumable items in Amazon in app purchase for android

I'm implementing amazon in app purchase in my android application. I've downloaded their sdk and get sample project for in app purchase from that sdk. I've created two items to purchase in my amazon account and got json file from there.
Now json file has two items in it. its json is like that json(I've removed some real values from amazon).
{"com.remove.adis.snt":{
"smallIconUrl":"",
"title":"Remove Ads",
"price":1.49,
"itemType":"CONSUMABLE",
"description":"Are you annoyed of ads!!!\r\nHere is the solution.Please buy this feature to remove ads from your app."},
"com.premium.doofun.snt":{
"smallIconUrl":"",
"title":"Premium Sounds",
"price":1.99,
"itemType":"CONSUMABLE",
"description":"Get More Sounds of interesting Categories like Action, TV, Entertainment, Love, Movies etc. to have more fun!"}
}
Now the problem is that its in app is working for one item only. If i continue by keeping both items in my json file it won't work. I need to remove one of these two to make it work. I'm stuck here,I couldn't get the idea from api too. Please help,any help would be much appreciated. Thanks :)
The JSON you posted is invalid. It has an extra comma after the last sub-object. If this is just a posting error, then no idea.

Android IAB: "Error refreshing inventory (querying prices of items)" Developer Error

I've been setting up Android in app billing v3, using the IABHelper class, and following the example code provided by Google. I have it mostly working all the way through purchase (with signed apk and real credit card charge).
However, in the course of testing today I started to get a new error in my QueryInventoryFinishedListener from the queryInventoryAsync() method:
IABResult message: "Error refreshing inventory (querying prices of items)"
IABResult response: 5:Developer Error
Weird thing #1 is that this occurs after the onIabSetupFinished() callback returns (with the customary "Hooray" message). Weird thing #2 is that I can subsequently & successfully process an in app purchase (using the launchPurchaseFlow() method).
I found a patch here that addresses the same symptoms I'm experiencing, but it didn't work for me.
I've tried using different devices, using different gmail accounts, and building a new product from scratch. I even getting the error on earlier versions of my app that ran correctly (what?!).
My question is: Why can't I query the product inventory, even after IABHelper has confirmed the set up was successful? What could be causing this error, and how can I fix it?
Thank you for any insight.
UPDATE
I was able to get the inventory query transactions to work again by ditching the account I was testing with, and switching to a new account. No code change.
My tentative conclusion is that something got corrupted in the user account I was using (?). During testing, I had hit it pretty hard with a lot of purchases of different in-app products -- but I still need to find out what happened, and make sure this doesn't happen to any of my users.
Please let me know if you have any experience with this. Thanks!
We had the same problem in one of our apps under test mode. Later, we figured out that, we had to clear the Cache of the Google Play Store app.
So you can try this -
Go your device's Settings menu.
Go to Applications (may also be labeled Application Manager).
Tab over to All Applications.
Search for and open the Google Play Store app. Tap on it, application settings will show
Tap on Clear Data and Clear Cache.
Now go back to your app and try to load inventory. It solved our problem.
I found by trial and error that if you query more than 20 items at once, it will fail with this error.
I submitted a patch for IabHelper.java that splits the list of SKUs into packets of 20 items each and does the query.
You can grab it there: https://code.google.com/p/marketbilling/issues/detail?id=123
I have the same issue with this log :
"InAppBillingManager.getSkuDetails: Input Error: skusBundle array associated with key ITEM_ID_LIST cannot contain more than 20 items."
this note had mentioned in IInAppBillingService.aidl file, see the documentation of the method getSkuDetails(..) .
So you should make the same process for each 20 items every time
I face same error but my issue is Date Time change
Go to setting and check your date time is accurate

IAB consumePurchase() no longer works for static response android.test.purchased

Our beta app uses android.test.purchased so customers can test for free. But recently something broke with consuming these test products. The purchase process still works fine but when we try to consume:
int response = ms.consumePurchase(3, mContext.getPackageName(), token);
This now always returns RESULT_DEVELOPER_ERROR == 5. The data passed appears valid, token is inapp:com.lootworks.swords:android.test.purchased which I think is correct for the static test products.
Simultaneously all our earlier app versions also stopped working and we did not change our code, so it sure seems like something changed with IAB itself.
I also tested purchase/consume of the real (for $) products and it succeeds with the same code. So the consume problem seems to affect only the static response test item.
With Sean's help and some additional testing this appears to be a google play IAB regression. Have opened a bug https://code.google.com/p/android/issues/detail?id=53077
My team and I are experiencing this same issue. Nothing has changed with the app consume code, so it is very strange. The app is not release-ready yet, so we have plenty else to work on, but this throws a monkey wrench into testing for sure.
This may not be an option for you, but you could change the namespace, delete the app entry in the dev console and go through the process of making a new one, and splitting the key up again, etc.
I only suggest this because this problem does not seem to be happening for all apps. Anyway, if the consume in our app does not start magically working again soon, this is what we will try.

HTTP response code -1 on android phone - using appinventor

I am building a simple search app through MIT AppInventor. I have had no problems in querying my spreadsheet shared as public on the cloud.
Suddenly, for no reason, my GET request to the HTTP fails with a response code of -1. I have looked everywhere but can't find an explanation for this -1 code.
Let me repeat that the same block of codes was working perfectly fine until this happened. Now I can't figure out what is going wrong. Any help will be much appreciated.
I solved this problem when I found out that my target spreadsheet link, which used to start with http:// was changed to https://. I found that my browser redirected me to https:// when I tried to run my query directly on the web. So changing that in my code fixed the issue.
I came across a similar issue recently. It used to work and I found out that my get request was being redirected to a login page being the session had expired.
I suggest you open the get request using the webviewer component (or activitystarter) to give you a better understanding of where the error is coming from.

other requirements for developer payload in android in-app billing

For some odd reasons, I am unable to get the developerPayload. I'm using the Dungeons Example. I have seen this work before, I think the payload string should appear in the Recent Activity. As far as I know, it should work if I'm using an actual product ID (like, potion_001). The whole purchasing works very well, but alas, the developerPayload is not there. I have barely made an edit with the Dungeons sample apart from renaming the package name. I did try to edit the intent actions, though:
public static final String ACTION_CONFIRM_NOTIFICATION =
"com.blah.something.dungeons.en.CONFIRM_NOTIFICATION";
public static final String ACTION_GET_PURCHASE_INFORMATION =
"com.blah.something.dungeons.en.GET_PURCHASE_INFORMATION";
public static final String ACTION_RESTORE_TRANSACTIONS =
"com.blah.something.dungeons.en.RESTORE_TRANSACTIONS";
It still didn't work. I have been re-reading the in-app billing docs, but I'm not sure if I'm missing something here. Is there something that I may have missed, or misconfigured in the android market options and/or the dungeons sample?
You are not receiving the developerPayload in DEBUG MODE. You need to sign your application to RELEASE MODE to receive developerPayload.
It works now. For some odd reasons, the developerPayload just came back. There was also someone in the net who had the same problems as I am, and it also happened just last weekend (http://www.google.com/support/forum/p/androidmarket/thread?tid=197b77d86cbb09ff&hl=ja). It's in japanese, though, but basically he also had problems with developerPayload being null, and then it also came back again a few days later. I also live in japan, so I guess this might have happened only in our area. I guess it really was true, that transferring payload is quite a heavy workload for google.

Categories

Resources