javascript - Getting an error when trying to use react-native-billing library for making test purchase -


i want test buying using react-native-billing library. way:

 buy() {     const inappbilling = require("react-native-billing");     inappbilling.open()       .then(() => inappbilling.purchase('android.test.purchased'))       .then((details) => {         console.log("you purchased: ", details)         return inappbilling.close()       })       .catch((err) => {         console.log(err);       });   } 

and error this: "undefined not object (evaluating 'inappbillingbridge.open')"

in library there code this:

"use strict";  const inappbillingbridge = require("react-native").nativemodules.inappbillingbridge;  class inappbilling {     static open() {       return inappbillingbridge.open();  // error here     } } 

i.e. inappbillingbridge undefined don't understand why. did face problem?


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -