Comments (14)
Btw, I also have the following code now:
@Override
public byte[] getObfuscationSalt() {
return null;
}
@Override
public String getPublicKey() {
return "here is my key copied from market publish page";
}
from androidbillinglibrary.
Btw, I also see the following record at LogCat:
07-08 13:54:03.636: DEBUG/BillingController(29306): Request 5419304117851015224 received response RESULT_OK
But
PurchaseManager.isPurchased(getApplicationContext(), ANDROID_MARKET_ITEM)
returns false.
from androidbillinglibrary.
By debugging the code I've observed the following:
onReceive#BillingReceiver
callsresponseCode(context, intent)
, notpurchaseStateChanged(context, intent)
. Is that correct (http://developer.android.com/guide/market/billing/billing_overview.html#billing-action-notify)? Looks like it happens so, since I've already purchased this item before while testing another application.
Probably, it will not work correctly with unmanaged items (http://developer.android.com/guide/market/billing/billing_admin.html#billing_purchase_type) also.onPurchaseStateChanged#BillingController
receives emptysignedData
. Probably it happens so because data received for test items is not signed?
from androidbillinglibrary.
Are you using BillingController.setDebug(true)
?
from androidbillinglibrary.
Yes. See no other errors in the LogCat.
from androidbillinglibrary.
If I use restoreTransactions, then onPurchaseStateChanged is never called, in result purchases are not saved in database.
from androidbillinglibrary.
robotmedia, will you be able to help me with this?
from androidbillinglibrary.
Re: question 1
After a purchase request BillingReceiver
should receive both a RESPONSE_CODE
and then an IN_APP_NOTIFY
action. BillingReceiver
will respectively call BillingController.onResponseCode
and BillingController.onNotify
.
The RESPONSE_CODE
is simply to indicate if the request was successfully received by the Android Market server. From the Android documentation:
This response contains an Android Market server response code, and is sent after you make an in-app billing request. A server response code can indicate that a billing request was successfully sent to Android Market or it can indicate that some error occurred during a billing request. This response is not used to report any purchase state changes (such as refund or purchase information).
PURCHASE_STATE_CHANGED
comes after the IN_APP_NOTIFY
. This is the typical flow:
The behavior here is the same if the item is managed or unmanaged.
Re: question 2
It seems from this that you're eventually received PURCHASE_STATE_CHANGED
. If signedData
is null
, well, there's not much that our library can do. It can be null
for many reasons. This might help: http://developer.android.com/guide/market/billing/billing_testing.html
Re: restoreTransactions question
Most likely the same thing that was giving you a null signedData before is at play here.
Hope this helps. Please let us know what was the issue when you solve it.
from androidbillinglibrary.
Thanks for your reply.
Re: question 1
I've tested that with requestPurchase
.
IN_APP_NOTIFY
is not received.
Re: question 2
I've tested that with restoreTransactions
. Will try to understand why data received is not signed.
from androidbillinglibrary.
IN_APP_NOTIFY is not received.
Are you sure? Then how are you reaching
BillingController.onPurchaseStateChanged
afterwards? Bear in mind theBillingReceiver
receives asynchronous messages.
onPurchaseStateChanged
is reached with restoreTransactions
, not with requestPurchase
.
from androidbillinglibrary.
Hmm, looks like the problem is caused by usage of test account on the device, not developer's account (however, test account is added to the list of test accounts).
from androidbillinglibrary.
OK, when I've started to use developer's account on the device, it is started to work better.
Now I see that purchase of android.test.purchased is reflected in the database. But purchase status there is 0. Hence isPurchased
returns false.
I've checked possible states
public enum PurchaseState {
// Responses to requestPurchase or restoreTransactions.
PURCHASED, // 0: The charge failed on the server.
CANCELLED, // 1: User was charged for the order.
REFUNDED; // 2: User received a refund for the order.
Is everything correct here?
from androidbillinglibrary.
And it is still work incorrectly with restoreTransactions
. Looks like it can not be used with reserved items - http://stackoverflow.com/questions/6640480/why-restore-transactions-in-app-billing-returns-not-signed-data.
Btw, could you please provide me with example how public byte[] getObfuscationSalt() {
can look like?
from androidbillinglibrary.
Can you open separate issues for both the PurchaseState and salt questions?
If you do we will reply ASAP. Thanks.
from androidbillinglibrary.
Related Issues (20)
- DungeonsRedux android.test.refunded
- DungeonsRedux android.test.canceled
- onPurchaseStateChanged() not called HOT 3
- Compile problem in new Android Eclipse platform release 4.2 / 21.0.0.vxxx HOT 3
- How to handle refunds? HOT 6
- onBillingChecked() not called when BillingService "Could not bind to MarketBillingService"
- Response code of BillingController.restoreTransactions() in case of errors HOT 1
- Cancelled purchase, getTransactions is still returning a value in one mobile but not the other with the same google account HOT 1
- Validation of transaction doesn't work ?
- Issue with onPurchaseStateChanged
- DeadObjectException HOT 1
- API Version 3 HOT 5
- Handling Developer Payload and OrderId HOT 3
- onPurchaseStateChange does not gets called when purchase is successful. HOT 1
- BadTokenException in BillingReceiver
- Transaction doesn't include subscription "purchaseToken" HOT 1
- "Item unavailable" error HOT 5
- How to handle manual confirmations and Google Play status bar notifications? HOT 2
- Publish Maven artifact to Central HOT 5
- onBillingChecked HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from androidbillinglibrary.