-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retain productsRequest #48
base: master
Are you sure you want to change the base?
Conversation
…thing needs to be done on a real device.
are you sure this is a problem only for loadProducts? my guess is it could happen for purchaseProduct. Not sure if this is the right fix. |
It could happen for purchaseProduct on tvOS, but without this fix, loadProducts will silently fail with no response, so we don't have a chance to know what happen next. PS: this fix is for tvOS specifically, iOS just don't need it. |
initWithProductIdentifiers:[NSSet setWithArray:productIdentifiers]]; | ||
productsRequest.delegate = self; | ||
_callbacks[RCTKeyForInstance(productsRequest)] = callback; | ||
[productsRequest start]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will break when we have multiple requests happening. can you make it a map and in the delegate remove from the map?
Needs improvement; see chirag04#48
On tvOS, productsRequest got released at end of the loadProducts func, and the following callbacks won't be fired. Declare it as a class level variable fix the problem.