-
-
Notifications
You must be signed in to change notification settings - Fork 655
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
consumeAllItems doesn't work with android.test.purchased #497
Comments
Try |
@hyochan Yes. |
i'm same problem. async componentDidMount() {
try {
const result = await RNIap.initConnection();
await RNIap.consumeAllItems();
console.log("result", result);
} catch (error) {
alert(error);
}
...
//결제테스트
getItems = async itemSkus => {
try {
const products = await RNIap.getProducts(itemSkus);
// const products = await RNIap.getSubscriptions(itemSkus);
console.log("Products", products);
this.setState({ productlist: products });
} catch (err) {
console.warn(err.code, err.message);
}
};
buyItem = async sku => {
console.info("buyItem: " + sku);
try {
const purchase = await RNIap.consumePurchase(sku);
this.setState({ receipt: purchase.transactionReceipt }, () =>
);
} catch (err) {
if (err.code === "E_USER_CANCELLED") {
console.log("##################################");
console.log(err.message);
console.log(err.code);
// code = { resultCode: "S900" };
// this.webview.postMessage(JSON.stringify(code));
console.log("-----------------------------------------------");
}
const subscription = RNIap.addAdditionalSuccessPurchaseListenerIOS(
async purchase => {
this.setState({ receipt: purchase.transactionReceipt }, () =>
console.log("ios sucess")
);
subscription.remove();
}
);
}
};
} this is did not work. |
There seems to be an issue with |
I believe #510 will fix this. |
Version of react-native-iap
2.5.4
Version of react-native
0.55.4
Platforms you faced the error (IOS or Android or both?)
Android
Expected behavior
consumeAllItems
should be consume all items, alsoandroid.test.purchased
test product idActual behavior
consumeAllItems
doesn't consume'android.test.purchased'
So I have to use
RNIap.consumePurchase("inapp:com.learnary:android.test.purchased")
to consume the test product.Tested environment (Emulator? Real Device?)
Real Device
Steps to reproduce the behavior
Then error occurs "Already own this"
The text was updated successfully, but these errors were encountered: