Comments (8)
So, you have subscriptions as well? As I have never tested them.
IABHelper.java is a file written by Google employee, and I believe it has many bugs.
from androidinapppurchase.
You can deem this issue as invalid or whatever. What actually happened was that I had two restore
entering a race condition and invalidating each other. Sorry I bothered you.
(and I don't use subscriptions either, at least not at the moment)
from androidinapppurchase.
I have checked a code like: instance.restore([MY_ITEM_ID]); and it works fine for me, but I don't have any subscriptions.
Also, this line of code doesn't restore any subscriptions and have to work without problems anyway.
You should be more clear, if you want me to fix the problem
from androidinapppurchase.
The issue was actually somewhere else in my code. I had something like:
public class FirstCommand
{
// injected somehow
public var instance:InAppPurchase;
public function execute():void
{
instance.addEventListener(InAppPurchaseEvent.RESTORE_SUCCESS, onRestoreSuccess);
instance.restore([MY_ITEM_ID]); // needless to say I've checked that the ID indeed exists
}
private function onRestoreSuccess(event:InAppPurchaseEvent):void
{
var detail:InAppSkuDetails = instance.getSkuDetails(MY_ITEM_ID);
// detail is null
}
}
public class SecondCommand
{
public var instance:InAppPurchase;
public function execute():void
{
instance.addEventListener(InAppPurchaseEvent.RESTORE_SUCCESS, onRestoreSuccess);
instance.restore();
}
private function onRestoreSuccess(event:InAppPurchaseEvent):void
{
// do something
}
}
As you can now guess, SecondCommand's restore call took less time than FirstCommand's one...
from androidinapppurchase.
It took less time, so?
from androidinapppurchase.
So, since MY_ITEM_ID is a currently not owned sku, restore([MY_ITEM_ID])
fills the Inventory with MY_ITEM_ID's details, but restore()
(without specifying moreItemsSkus
) creates a new Inventory where MY_ITEM_ID's details are not available.
Like I said, the mistake was actually on my side.
from androidinapppurchase.
yeah...
from androidinapppurchase.
lol
from androidinapppurchase.
Related Issues (20)
- Problems rebuilding the ane HOT 1
- No events fired after purchase. HOT 8
- Application crashes after fold/unfold when extension android activity is active
- Suspned/Resume make the system dialog appears twice HOT 2
- getPurchaseDetails returning NULL HOT 3
- How to get a login page to appear if the account hasn't been logged in? HOT 2
- Small typo in the readme
- Item you are attempting to purchase could not be found HOT 1
- TypeError #1009 at InAppPurchase/onStatus() : 171 HOT 1
- Error #3500 HOT 6
- Var _iap was reading as undefined property HOT 1
- InAppPurchaseDetails._time overflows
- Error Refreshing Inventory HOT 1
- Inventory Is Returning Null For Purchases & SkuDetails HOT 4
- x86 Arch Support?
- isSupported()? HOT 2
- Error : Authentication required. HOT 1
- App crashes after successful purchase
- Can someone please help me figure out how to correctly set up ANE?
- in app purchase with test
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 androidinapppurchase.