Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created December 23, 2018 16:26
Show Gist options
  • Save amandeepmittal/01fe42d07b59d44aea08813b57e88665 to your computer and use it in GitHub Desktop.
Save amandeepmittal/01fe42d07b59d44aea08813b57e88665 to your computer and use it in GitHub Desktop.
import InAppBilling from "react-native-billing";
async purchase() {
try {
await InAppBilling.open();
const details = await InAppBilling.purchase("android.test.purchased");
console.log("You purchased: ", details);
} catch (err) {
console.log(err);
} finally {
await InAppBilling.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment