32 lines
1.4 KiB
JavaScript
32 lines
1.4 KiB
JavaScript
// Metro module 6346 (f6347).
|
|
import { NativeEventEmitter } from "react-native";
|
|
import { getNativeModule, isAndroid, getAndroidModule, isIos, getIosModule } from "./Module6336";
|
|
import { isIosStorekit2 } from "./addSubscriptionPlatform";
|
|
import { transactionSk2ToPurchaseMap } from "./Module6347";
|
|
export const purchaseUpdatedListener = (a0, c15677_1) => {
|
|
let r7 = a0;
|
|
let c15677_0 = a0;
|
|
const nativeModule = getNativeModule();
|
|
const r15 = Object.create(NativeEventEmitter.prototype);
|
|
const nativeEventEmitter = new NativeEventEmitter(nativeModule);
|
|
if (isIosStorekit2()) {
|
|
r7 = (a0) => {
|
|
c15677_0(transactionSk2ToPurchaseMap(a0));
|
|
};
|
|
}
|
|
const r23 = nativeEventEmitter.addListener("purchase-updated", r7);
|
|
if (isAndroid) {
|
|
getAndroidModule().startListening().catch((error) => {
|
|
if (c15677_1) {
|
|
c15677_1(error);
|
|
return void 0;
|
|
}
|
|
throw error;
|
|
});
|
|
}
|
|
return r23;
|
|
};
|
|
export const purchaseErrorListener = (a0) => new NativeEventEmitter(getNativeModule()).addListener("purchase-error", a0);
|
|
export const promotedProductListener = (a0) => isIos ? isIosStorekit2() ? null : new NativeEventEmitter(getIosModule()).addListener("iap-promoted-product", a0) : null;
|
|
export const transactionListener = (a0) => isIos ? isIosStorekit2() ? new NativeEventEmitter(getIosModule()).addListener("iap-transaction-updated", a0) : null : null;
|