Skip to content

Commit

Permalink
8.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianojsjr committed Apr 1, 2022
1 parent 7c0e6e3 commit 1effa38
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-iap",
"version": "8.0.8",
"version": "8.0.9",
"packageManager": "yarn@3.1.1",
"description": "React Native In App Purchase Module.",
"main": "index.js",
Expand Down
3 changes: 2 additions & 1 deletion src/iap.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ export declare const requestPurchase: (sku: string, andDangerouslyFinishTransact
* @param {ProrationModesAndroid} [prorationModeAndroid] UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY, IMMEDIATE_WITH_TIME_PRORATION, IMMEDIATE_AND_CHARGE_PRORATED_PRICE, IMMEDIATE_WITHOUT_PRORATION, DEFERRED
* @param {string} [obfuscatedAccountIdAndroid] Specifies an optional obfuscated string that is uniquely associated with the user's account in your app.
* @param {string} [obfuscatedProfileIdAndroid] Specifies an optional obfuscated string that is uniquely associated with the user's profile in your app.
* @param {string} [applicationUsername] Specifies an optional obfuscated string that is uniquely associated with the user's profile in your app.
* @returns {Promise<SubscriptionPurchase | null>} Promise resolves to null when using proratioModesAndroid=DEFERRED, and to a SubscriptionPurchase otherwise
*/
export declare const requestSubscription: (sku: string, andDangerouslyFinishTransactionAutomaticallyIOS?: boolean, purchaseTokenAndroid?: string | undefined, prorationModeAndroid?: ProrationModesAndroid, obfuscatedAccountIdAndroid?: string | undefined, obfuscatedProfileIdAndroid?: string | undefined) => Promise<SubscriptionPurchase | null>;
export declare const requestSubscription: (sku: string, andDangerouslyFinishTransactionAutomaticallyIOS?: boolean, purchaseTokenAndroid?: string | undefined, prorationModeAndroid?: ProrationModesAndroid, obfuscatedAccountIdAndroid?: string | undefined, obfuscatedProfileIdAndroid?: string | undefined, applicationUsername?: string | undefined) => Promise<SubscriptionPurchase | null>;
/**
* Request a purchase for product. This will be received in `PurchaseUpdatedListener`.
* @param {string} sku The product's sku/ID
Expand Down
6 changes: 4 additions & 2 deletions src/iap.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,16 @@ export var requestPurchase = function (sku, andDangerouslyFinishTransactionAutom
* @param {ProrationModesAndroid} [prorationModeAndroid] UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY, IMMEDIATE_WITH_TIME_PRORATION, IMMEDIATE_AND_CHARGE_PRORATED_PRICE, IMMEDIATE_WITHOUT_PRORATION, DEFERRED
* @param {string} [obfuscatedAccountIdAndroid] Specifies an optional obfuscated string that is uniquely associated with the user's account in your app.
* @param {string} [obfuscatedProfileIdAndroid] Specifies an optional obfuscated string that is uniquely associated with the user's profile in your app.
* @param {string} [applicationUsername] Specifies an optional obfuscated string that is uniquely associated with the user's profile in your app.
* @returns {Promise<SubscriptionPurchase | null>} Promise resolves to null when using proratioModesAndroid=DEFERRED, and to a SubscriptionPurchase otherwise
*/
export var requestSubscription = function (sku, andDangerouslyFinishTransactionAutomaticallyIOS, purchaseTokenAndroid, prorationModeAndroid, obfuscatedAccountIdAndroid, obfuscatedProfileIdAndroid) {
export var requestSubscription = function (sku, andDangerouslyFinishTransactionAutomaticallyIOS, purchaseTokenAndroid, prorationModeAndroid, obfuscatedAccountIdAndroid, obfuscatedProfileIdAndroid, applicationUsername) {
if (andDangerouslyFinishTransactionAutomaticallyIOS === void 0) { andDangerouslyFinishTransactionAutomaticallyIOS = false; }
if (purchaseTokenAndroid === void 0) { purchaseTokenAndroid = undefined; }
if (prorationModeAndroid === void 0) { prorationModeAndroid = -1; }
if (obfuscatedAccountIdAndroid === void 0) { obfuscatedAccountIdAndroid = undefined; }
if (obfuscatedProfileIdAndroid === void 0) { obfuscatedProfileIdAndroid = undefined; }
if (applicationUsername === void 0) { applicationUsername = undefined; }
return (Platform.select({
ios: function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
Expand All @@ -310,7 +312,7 @@ export var requestSubscription = function (sku, andDangerouslyFinishTransactionA
// eslint-disable-next-line max-len
'You are dangerously allowing react-native-iap to finish your transaction automatically. You should set andDangerouslyFinishTransactionAutomatically to false when calling requestPurchase and call finishTransaction manually when you have delivered the purchased goods to the user. It defaults to true to provide backwards compatibility. Will default to false in version 4.0.0.');
}
return [2 /*return*/, getIosModule().buyProduct(sku, andDangerouslyFinishTransactionAutomaticallyIOS)];
return [2 /*return*/, getIosModule().buyProduct(sku, andDangerouslyFinishTransactionAutomaticallyIOS, applicationUsername)];
});
}); },
android: function () { return __awaiter(void 0, void 0, void 0, function () {
Expand Down
3 changes: 3 additions & 0 deletions src/iap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ export const requestPurchase = (
* @param {ProrationModesAndroid} [prorationModeAndroid] UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY, IMMEDIATE_WITH_TIME_PRORATION, IMMEDIATE_AND_CHARGE_PRORATED_PRICE, IMMEDIATE_WITHOUT_PRORATION, DEFERRED
* @param {string} [obfuscatedAccountIdAndroid] Specifies an optional obfuscated string that is uniquely associated with the user's account in your app.
* @param {string} [obfuscatedProfileIdAndroid] Specifies an optional obfuscated string that is uniquely associated with the user's profile in your app.
* @param {string} [applicationUsername] Specifies an optional obfuscated string that is uniquely associated with the user's profile in your app.
* @returns {Promise<SubscriptionPurchase | null>} Promise resolves to null when using proratioModesAndroid=DEFERRED, and to a SubscriptionPurchase otherwise
*/
export const requestSubscription = (
Expand All @@ -303,6 +304,7 @@ export const requestSubscription = (
prorationModeAndroid: ProrationModesAndroid = -1,
obfuscatedAccountIdAndroid: string | undefined = undefined,
obfuscatedProfileIdAndroid: string | undefined = undefined,
applicationUsername: string | undefined = undefined,
): Promise<SubscriptionPurchase | null> =>
(
Platform.select({
Expand All @@ -318,6 +320,7 @@ export const requestSubscription = (
return getIosModule().buyProduct(
sku,
andDangerouslyFinishTransactionAutomaticallyIOS,
applicationUsername,
);
},
android: async () => {
Expand Down

0 comments on commit 1effa38

Please sign in to comment.