expo-iap 3.2.1 → 3.2.2
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.
- package/CLAUDE.md +10 -4
- package/README.md +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +24 -0
- package/build/index.js.map +1 -1
- package/coverage/clover.xml +21 -14
- package/coverage/coverage-final.json +1 -1
- package/coverage/lcov-report/index.html +19 -19
- package/coverage/lcov-report/src/index.html +19 -19
- package/coverage/lcov-report/src/index.ts.html +91 -10
- package/coverage/lcov-report/src/modules/android.ts.html +1 -1
- package/coverage/lcov-report/src/modules/index.html +1 -1
- package/coverage/lcov-report/src/modules/ios.ts.html +1 -1
- package/coverage/lcov-report/src/utils/debug.ts.html +1 -1
- package/coverage/lcov-report/src/utils/errorMapping.ts.html +1 -1
- package/coverage/lcov-report/src/utils/index.html +1 -1
- package/coverage/lcov.info +107 -93
- package/ios/ExpoIap.podspec +7 -5
- package/ios/ExpoIapHelper.swift +1 -1
- package/package.json +1 -1
- package/src/index.ts +27 -0
package/src/index.ts
CHANGED
|
@@ -808,6 +808,33 @@ export const verifyPurchaseWithProvider: MutationField<
|
|
|
808
808
|
'verifyPurchaseWithProvider'
|
|
809
809
|
> = async (options) => {
|
|
810
810
|
if (Platform.OS === 'ios' || Platform.OS === 'android') {
|
|
811
|
+
// Auto-fill apiKey from config if not provided and provider is iapkit
|
|
812
|
+
if (
|
|
813
|
+
options.provider === 'iapkit' &&
|
|
814
|
+
options.iapkit &&
|
|
815
|
+
!options.iapkit.apiKey
|
|
816
|
+
) {
|
|
817
|
+
try {
|
|
818
|
+
// Dynamically import expo-constants to avoid hard dependency
|
|
819
|
+
const {default: Constants} = await import('expo-constants');
|
|
820
|
+
const configApiKey = Constants.expoConfig?.extra?.iapkitApiKey;
|
|
821
|
+
if (configApiKey) {
|
|
822
|
+
options = {
|
|
823
|
+
...options,
|
|
824
|
+
iapkit: {
|
|
825
|
+
...options.iapkit,
|
|
826
|
+
apiKey: configApiKey,
|
|
827
|
+
},
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
} catch {
|
|
831
|
+
throw new Error(
|
|
832
|
+
'expo-constants is required for auto-filling iapkitApiKey from config. ' +
|
|
833
|
+
'Please install it: npx expo install expo-constants\n' +
|
|
834
|
+
'Or provide apiKey directly in verifyPurchaseWithProvider options.',
|
|
835
|
+
);
|
|
836
|
+
}
|
|
837
|
+
}
|
|
811
838
|
return ExpoIapModule.verifyPurchaseWithProvider(options);
|
|
812
839
|
}
|
|
813
840
|
|