react-native-qonversion
Version:
Qonversion provides full in-app purchases infrastructure, so you do not need to build your own server for receipt validation. Implement in-app subscriptions, validate user receipts, check subscription status, and provide access to your app features and co
40 lines • 1.84 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const QonversionInternal_1 = __importDefault(require("./internal/QonversionInternal"));
class Qonversion {
constructor() { }
static backingInstance;
/**
* Use this variable to get a current initialized instance of the Qonversion SDK.
* Please, use the property only after calling {@link Qonversion.initialize}.
* Otherwise, trying to access the variable will cause an exception.
*
* @return Current initialized instance of the Qonversion SDK.
* @throws error if the instance has not been initialized
*/
static getSharedInstance() {
if (!this.backingInstance) {
throw "Qonversion has not been initialized. You should call " +
"the initialize method before accessing the shared instance of Qonversion.";
}
return this.backingInstance;
}
/**
* An entry point to use Qonversion SDK. Call to initialize Qonversion SDK with required and extra configs.
* The function is the best way to set additional configs you need to use Qonversion SDK.
* You still have an option to set a part of additional configs later via calling separate setters.
*
* @param config a config that contains key SDK settings.
* Call {@link QonversionConfigBuilder.build} to configure and create a QonversionConfig instance.
* @return Initialized instance of the Qonversion SDK.
*/
static initialize(config) {
this.backingInstance = new QonversionInternal_1.default(config);
return this.backingInstance;
}
}
exports.default = Qonversion;
//# sourceMappingURL=Qonversion.js.map