chirag04 / react-native-in-app-utils

A react-native wrapper for handling in-app payments
MIT License
890 stars 185 forks source link

Retain productsRequest #48

Open tarkus opened 8 years ago

tarkus commented 8 years ago

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.

chirag04 commented 8 years ago

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.

tarkus commented 8 years ago

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.

tarkus commented 8 years ago

Credit goes to Will http://stackoverflow.com/questions/33842304/swift-tvos-in-app-purchase-doesnt-respond