react-native-iap 12.14.0 → 12.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigPlugin } from '
|
|
1
|
+
import { ConfigPlugin } from 'expo/config-plugins';
|
|
2
2
|
type PaymentProvider = 'Amazon AppStore' | 'both' | 'Play Store';
|
|
3
3
|
export declare const modifyAppBuildGradle: (buildGradle: string, paymentProvider: PaymentProvider) => string;
|
|
4
4
|
export declare const modifyProjectBuildGradle: (buildGradle: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIAP.d.ts","sourceRoot":"","sources":["../../../../plugin/src/withIAP.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"withIAP.d.ts","sourceRoot":"","sources":["../../../../plugin/src/withIAP.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AAItE,KAAK,eAAe,GAAG,iBAAiB,GAAG,MAAM,GAAG,YAAY,CAAC;AAuCjE,eAAO,MAAM,oBAAoB,gBAClB,MAAM,mBACF,eAAe,WAwBjC,CAAC;AAEF,eAAO,MAAM,wBAAwB,gBAAiB,MAAM,WAM3D,CAAC;AAyBF,UAAU,KAAK;IACb,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;;AA0BD,wBAAmE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-iap",
|
|
3
|
-
"version": "12.14.
|
|
3
|
+
"version": "12.14.1",
|
|
4
4
|
"description": "React Native In App Purchase Module.",
|
|
5
5
|
"repository": "https://github.com/dooboolab-community/react-native-iap",
|
|
6
6
|
"author": "hyochan <dooboolab@gmail.com> (https://github.com/hyochan)",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@babel/eslint-parser": "7.21.8",
|
|
83
|
-
"@firmnav/eslint-github-actions-formatter": "1.0.1",
|
|
83
|
+
"@firmnav/eslint-github-actions-formatter": "^1.0.1",
|
|
84
84
|
"@jeremybarbet/apple-api-types": "1.4.0",
|
|
85
85
|
"@jeremybarbet/google-api-types": "1.4.0",
|
|
86
86
|
"@react-native-community/eslint-config": "3.2.0",
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"eslint-plugin-jest": "27.2.2",
|
|
96
96
|
"eslint-plugin-prettier": "4.2.1",
|
|
97
97
|
"eslint-plugin-simple-import-sort": "10.0.0",
|
|
98
|
+
"expo": "^51.0.14",
|
|
98
99
|
"expo-module-scripts": "^3.0.7",
|
|
99
100
|
"jest": "29.5.0",
|
|
100
101
|
"monolinter": "1.0.4",
|
|
@@ -110,13 +111,13 @@
|
|
|
110
111
|
"typescript": "5.0.4"
|
|
111
112
|
},
|
|
112
113
|
"peerDependencies": {
|
|
114
|
+
"expo": ">=47.0.0",
|
|
113
115
|
"react": ">=16.13.1",
|
|
114
116
|
"react-native": ">=0.65.1"
|
|
115
117
|
},
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
"@expo/config-plugins": "^7.8.4"
|
|
118
|
+
"peerDependenciesMeta": {
|
|
119
|
+
"expo": {
|
|
120
|
+
"optional": true
|
|
121
|
+
}
|
|
121
122
|
}
|
|
122
123
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigPlugin } from '
|
|
1
|
+
import { ConfigPlugin } from 'expo/config-plugins';
|
|
2
2
|
type PaymentProvider = 'Amazon AppStore' | 'both' | 'Play Store';
|
|
3
3
|
export declare const modifyAppBuildGradle: (buildGradle: string, paymentProvider: PaymentProvider) => string;
|
|
4
4
|
export declare const modifyProjectBuildGradle: (buildGradle: string) => string;
|
package/plugin/build/withIAP.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.modifyProjectBuildGradle = exports.modifyAppBuildGradle = void 0;
|
|
4
|
-
const config_plugins_1 = require("
|
|
5
|
-
const config_plugins_2 = require("
|
|
4
|
+
const config_plugins_1 = require("expo/config-plugins");
|
|
5
|
+
const config_plugins_2 = require("expo/config-plugins");
|
|
6
6
|
const pkg = require('../../package.json');
|
|
7
7
|
const hasPaymentProviderProperValue = (paymentProvider) => {
|
|
8
8
|
return ['Amazon AppStore', 'Play Store', 'both'].includes(paymentProvider);
|
|
@@ -55,12 +55,12 @@ const modifyProjectBuildGradle = (buildGradle) => {
|
|
|
55
55
|
exports.modifyProjectBuildGradle = modifyProjectBuildGradle;
|
|
56
56
|
const withIAPAndroid = (config, { paymentProvider }) => {
|
|
57
57
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
58
|
-
config = (0,
|
|
58
|
+
config = (0, config_plugins_1.withAppBuildGradle)(config, (config) => {
|
|
59
59
|
config.modResults.contents = (0, exports.modifyAppBuildGradle)(config.modResults.contents, paymentProvider);
|
|
60
60
|
return config;
|
|
61
61
|
});
|
|
62
62
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
63
|
-
config = (0,
|
|
63
|
+
config = (0, config_plugins_1.withProjectBuildGradle)(config, (config) => {
|
|
64
64
|
config.modResults.contents = (0, exports.modifyProjectBuildGradle)(config.modResults.contents);
|
|
65
65
|
return config;
|
|
66
66
|
});
|
|
@@ -69,15 +69,15 @@ const withIAPAndroid = (config, { paymentProvider }) => {
|
|
|
69
69
|
const withIAP = (config, props) => {
|
|
70
70
|
const paymentProvider = props?.paymentProvider ?? 'Play Store';
|
|
71
71
|
if (!hasPaymentProviderProperValue(paymentProvider)) {
|
|
72
|
-
|
|
72
|
+
config_plugins_1.WarningAggregator.addWarningAndroid('react-native-iap', `The payment provider '${paymentProvider}' is not supported. Please update your app.json file with one of the following supported values: 'Play Store', 'Amazon AppStore', or 'both'.`);
|
|
73
73
|
return config;
|
|
74
74
|
}
|
|
75
75
|
try {
|
|
76
76
|
config = withIAPAndroid(config, { paymentProvider });
|
|
77
77
|
}
|
|
78
78
|
catch (error) {
|
|
79
|
-
|
|
79
|
+
config_plugins_1.WarningAggregator.addWarningAndroid('react-native-iap', `There was a problem configuring react-native-iap in your native Android project: ${error}`);
|
|
80
80
|
}
|
|
81
81
|
return config;
|
|
82
82
|
};
|
|
83
|
-
exports.default = (0,
|
|
83
|
+
exports.default = (0, config_plugins_2.createRunOncePlugin)(withIAP, pkg.name, pkg.version);
|