52 lines
2.1 KiB
JavaScript
52 lines
2.1 KiB
JavaScript
// Metro module 6343 (f6344).
|
|
import { NativeModules, Linking } from "react-native";
|
|
import { InstallSourceAndroid } from "./Module6335";
|
|
import { checkNativeAndroidAvailable, getAndroidModule, isAndroid } from "./Module6336";
|
|
let c4043_0;
|
|
let env4041 = {};
|
|
const { RNIapModule, RNIapModule: RNIapModule2 } = NativeModules;
|
|
let c4042_0 = async (c25817_0) => {
|
|
let c25817_3;
|
|
c25817_3 = void 0;
|
|
let c29747_0 = c25817_0.sku;
|
|
await void 0;
|
|
checkNativeAndroidAvailable();
|
|
let c25817_2 = Linking;
|
|
const openURL = Linking.openURL;
|
|
return openURL.call(c25817_2, `https://play.google.com/store/account/subscriptions?package=${await RNIapModule.getPackageName()}&sku=${c29747_0}`);
|
|
};
|
|
c4043_0 = void 0;
|
|
c4043_0 = async (c25818_0) => {
|
|
let c29748_0 = c25818_0.packageName;
|
|
let c29748_1 = c25818_0.productId;
|
|
let c29748_2 = c25818_0.productToken;
|
|
let c29748_3 = c25818_0.accessToken;
|
|
let c29748_4 = c25818_0.isSub;
|
|
await void 0;
|
|
let c29748_5 = `https://androidpublisher.googleapis.com/androidpublisher/v3/applications/${c29748_0}/purchases/${c29748_4 ? "subscriptions" : "products"}/${c29748_1}/tokens/${c29748_2}?access_token=${c29748_3}`;
|
|
let c29748_6 = await fetch(c29748_5, {
|
|
method: "GET",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
}
|
|
});
|
|
if (!c29748_6.ok) {
|
|
throw Object.assign(new Error(c29748_6.statusText), {
|
|
statusCode: c29748_6.status
|
|
});
|
|
}
|
|
return c29748_6.json();
|
|
};
|
|
export { RNIapModule2 as AndroidModule };
|
|
export const getInstallSourceAndroid = () => RNIapModule ? InstallSourceAndroid.GOOGLE_PLAY : InstallSourceAndroid.AMAZON;
|
|
export function deepLinkToSubscriptionsAndroid(a0) {
|
|
const apply = c4042_0.apply;
|
|
return c4042_0.apply(this, arguments);
|
|
}
|
|
export function validateReceiptAndroid(a0) {
|
|
const apply = c4043_0.apply;
|
|
return c4043_0.apply(this, arguments);
|
|
}
|
|
export const acknowledgePurchaseAndroid = ({ token, developerPayload }) => getAndroidModule().acknowledgePurchase(token, developerPayload);
|
|
export const isFeatureSupported = (a0) => isAndroid && RNIapModule ? RNIapModule2.isFeatureSupported(a0) : Promise.reject("This is only available on Android clients");
|