react-native-iap 12.15.3 → 12.15.5

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017-2021 dooboolab
3
+ Copyright (c) 2024 hyochan
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -6,17 +6,17 @@
6
6
  [![Next Version](https://img.shields.io/npm/v/react-native-iap/next)](https://npmjs.org/package/react-native-iap)
7
7
  [![Download](http://img.shields.io/npm/dm/react-native-iap.svg?style=flat-square)](https://npmjs.org/package/react-native-iap)
8
8
  [![Backers and Sponsors](https://img.shields.io/opencollective/all/react-native-iap.svg)](https://opencollective.com/react-native-iap)
9
- [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fdooboolab%2Freact-native-iap.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fdooboolab%2Freact-native-iap?ref=badge_shield)
9
+ [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%hyochan%2Freact-native-iap.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%hyochan%2Freact-native-iap?ref=badge_shield)
10
10
 
11
11
  ---
12
12
 
13
13
  ## Announcement
14
14
 
15
- Announcing the Migration of react-native-iap to an Expo Module for Improved Maintenance and Compatibility in [discussion #2754](https://github.com/dooboolab-community/react-native-iap/discussions/2754).
15
+ Announcing the Migration of react-native-iap to an Expo Module for Improved Maintenance and Compatibility in [discussion #2754](https://github.com/hyochan/react-native-iap/discussions/2754).
16
16
 
17
17
  ## Documentation
18
18
 
19
- Read the [documentation](https://react-native-iap.dooboolab.com). See the [troubleshooting](https://react-native-iap.dooboolab.com/docs/guides/troubleshooting#common-issues) for the common issues to avoid.
19
+ Read the [documentation](https://react-native-iap.hyochan.dev). See the [troubleshooting](https://react-native-iap.hyochan.dev/docs/guides/troubleshooting#common-issues) for the common issues to avoid.
20
20
 
21
21
  ## Logs
22
22
 
@@ -36,11 +36,11 @@ Read the [documentation](https://react-native-iap.dooboolab.com). See the [troub
36
36
 
37
37
  - Version `8.0.0` is currently in release candidate. The module is completely rewritten with `Kotlin` and `Swift` for maintenenance issue by [andresesfm](https://github.com/andresesfm) 🔆. You may install this for early preview.
38
38
 
39
- - React Native IAP hook is out. You can see [medium post](https://medium.com/dooboolab-community/announcing-react-native-iap-hooks-96c7ffd3f19a) on how to use it.
39
+ - React Native IAP hook is out. You can see [medium post](https://medium.com/hyochan/announcing-react-native-iap-hooks-96c7ffd3f19a) on how to use it.
40
40
 
41
- - The `react-native-iap` module hasn't been maintained well recently. We are thinking of participating again and make the module healthier. Please refer to [2021 Maintenance plan](https://github.com/dooboolab-community/react-native-iap/issues/1241) and share with us how you or your organization is using it. Happy new year 🎉
41
+ - The `react-native-iap` module hasn't been maintained well recently. We are thinking of participating again and make the module healthier. Please refer to [2021 Maintenance plan](https://github.com/hyochan/react-native-iap/issues/1241) and share with us how you or your organization is using it. Happy new year 🎉
42
42
 
43
- - The sample code is out in [Sponsor page](https://github.com/hyochan/dooboolab.com/blob/main/src/components/pages/Sponsor.tsx) in [dooboolab.com](https://github.com/hyochan/dooboolab.com) repository which sadly is rejected by Apple because of lacking product features. I will work on another example project to support this module. More information in [#1241 commment](https://github.com/dooboolab-community/react-native-iap/issues/1241#issuecomment-798540785).
43
+ - The sample code is out in [crossplatformkorea/CPK/pull/12](https://github.com/crossplatformkorea/CPK/pull/12). More information in [#1241 commment](https://github.com/hyochan/react-native-iap/issues/1241#issuecomment-798540785).
44
44
 
45
45
  ## Configuration of Play Store & App Store Connect
46
46
 
@@ -54,16 +54,16 @@ Follow [this guide](./IapExample/README.md) to get the example running.
54
54
 
55
55
  ### <p style="color: gold;">Gold Tier</p>
56
56
 
57
- | [NAMI](https://namiml.com) |
58
- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
59
- | <a href="https://namiml.com"><img src="https://github.com/dooboolab-community/react-native-iap/assets/27461460/89d71f61-bb73-400a-83bd-fe0f96eb726e" width="450"/></a> |
57
+ | [NAMI](https://namiml.com) |
58
+ | :--------------------------------------------------------------------------------------------------------------------------------------------------------: |
59
+ | <a href="https://namiml.com"><img src="https://github.com/hyochan/react-native-iap/assets/27461460/89d71f61-bb73-400a-83bd-fe0f96eb726e" width="450"/></a> |
60
60
 
61
61
  ## Past Sponsors
62
62
 
63
- <a href="https://www.revenuecat.com"><img src="https://github.com/dooboolab-community/react-native-iap/assets/27461460/1e387a47-afe0-4b85-ad78-1064ca6623fa" width="200"/></a>
63
+ <a href="https://www.revenuecat.com"><img src="https://github.com/hyochan/react-native-iap/assets/27461460/1e387a47-afe0-4b85-ad78-1064ca6623fa" width="200"/></a>
64
64
 
65
65
  Support this project by becoming a sponsor. Your logo will show up here with
66
- a link to your website. [Buy me a coffee](https://www.buymeacoffee.com/dooboolab) or
66
+ a link to your website. [Buy me a coffee](https://www.buymeacoffee.com/hyochan) or
67
67
  [Become a sponsor](https://opencollective.com/react-native-iap#sponsor).
68
68
  <a href="https://opencollective.com/react-native-iap#sponsors" target="_blank"><img src="https://opencollective.com/react-native-iap/sponsors.svg?width=890" /></a>
69
69
 
@@ -71,7 +71,7 @@ a link to your website. [Buy me a coffee](https://www.buymeacoffee.com/dooboolab
71
71
 
72
72
  Please take a look at [iap.dev/consulting](https://iap.dev/consulting). At iap.dev, we offer IAP consulting services for all platforms. Please [Contact Us](https://console.iap.dev/contact-us).
73
73
 
74
- Note: This service is not affiliated with dooboolab. It was created by [andresesfm](https://github.com/andresesfm) who has contributed and provided support for this project
74
+ Note: This service is not affiliated with hyochan. It was created by [andresesfm](https://github.com/andresesfm) who has contributed and provided support for this project
75
75
 
76
76
  ### Backers
77
77
 
@@ -80,11 +80,11 @@ Please be our [Backers](https://opencollective.com/react-native-iap#backer).
80
80
 
81
81
  ### Contributing
82
82
 
83
- Please make sure to read the [Contributing Guide](https://github.com/dooboolab-community/react-native-iap/blob/main/CONTRIBUTING.md) before making a pull request.
83
+ Please make sure to read the [Contributing Guide](https://github.com/hyochan/react-native-iap/blob/main/CONTRIBUTING.md) before making a pull request.
84
84
  Thank you to all the people who helped to maintain and upgrade this project!
85
85
 
86
86
  <a href="graphs/contributors"><img src="https://opencollective.com/react-native-iap/contributors.svg?width=890" /></a>
87
87
 
88
88
  ---
89
89
 
90
- [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fdooboolab%2Freact-native-iap.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fdooboolab%2Freact-native-iap?ref=badge_large)
90
+ [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%hyochan%2Freact-native-iap.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%hyochan%2Freact-native-iap?ref=badge_large)
package/RNIap.podspec CHANGED
@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
12
12
  s.authors = package["author"]
13
13
 
14
14
  s.platforms = { :ios => "10.0" , :tvos => "10.0", :visionos => "1.0" }
15
- s.source = { :git => "https://github.com/dooboolab-community/react-native-iap.git", :tag => "#{s.version}" }
15
+ s.source = { :git => "https://github.com/hyochan/react-native-iap.git", :tag => "#{s.version}" }
16
16
 
17
17
  s.source_files = "ios/*.{h,m,mm,swift}"
18
18
 
@@ -39,6 +39,7 @@ android {
39
39
  minSdkVersion getExtOrIntegerDefault("minSdkVersion")
40
40
  targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
41
41
  buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
42
+ buildConfigField "boolean", "IS_AMAZON_DRM_ENABLED", getExtOrDefault("isAmazonDrmEnabled")
42
43
  }
43
44
 
44
45
  buildTypes {
@@ -5,8 +5,9 @@ RNIap_compileSdkVersion=33
5
5
  RNIap_buildToolsVersion=33.0.0
6
6
  RNIap_ndkversion=23.1.7779620
7
7
  RNIap_playServicesVersion=18.1.0
8
- RNIap_amazonSdkVersion=3.0.4
8
+ RNIap_amazonSdkVersion=3.0.5
9
9
  RNIap_playBillingSdkVersion=7.0.0
10
+ RNIap_isAmazonDrmEnabled=true
10
11
 
11
12
  android.useAndroidX=true
12
13
  android.enableJetifier=true
@@ -57,40 +57,46 @@ class RNIapAmazonModule(
57
57
 
58
58
  @ReactMethod
59
59
  fun verifyLicense(promise: Promise) {
60
- try {
61
- LicensingService.verifyLicense(reactApplicationContext) { licenseResponse ->
62
- when (
63
- val status: LicenseResponse.RequestStatus =
64
- licenseResponse.requestStatus
65
- ) {
66
- LicenseResponse.RequestStatus.LICENSED -> {
67
- Log.d(TAG, "LicenseResponse status: $status")
68
- promise.resolve("LICENSED")
69
- }
70
- LicenseResponse.RequestStatus.NOT_LICENSED -> {
71
- Log.d(TAG, "LicenseResponse status: $status")
72
- promise.resolve("NOT_LICENSED")
73
- }
74
- LicenseResponse.RequestStatus.EXPIRED -> {
75
- Log.d(TAG, "LicenseResponse status: $status")
76
- promise.resolve("EXPIRED")
77
- }
78
- LicenseResponse.RequestStatus.ERROR_VERIFICATION -> {
79
- Log.d(TAG, "LicenseResponse status: $status")
80
- promise.resolve("ERROR_VERIFICATION")
81
- }
82
- LicenseResponse.RequestStatus.ERROR_INVALID_LICENSING_KEYS -> {
83
- Log.d(TAG, "LicenseResponse status: $status")
84
- promise.resolve("ERROR_INVALID_LICENSING_KEYS")
85
- }
86
- LicenseResponse.RequestStatus.UNKNOWN_ERROR -> {
87
- Log.d(TAG, "LicenseResponse status: $status")
88
- promise.resolve("UNKNOWN_ERROR")
60
+ if (BuildConfig.IS_AMAZON_DRM_ENABLED) {
61
+ Log.d(TAG, "Amazon's DRM is enabled")
62
+ try {
63
+ LicensingService.verifyLicense(reactApplicationContext) { licenseResponse ->
64
+ when (
65
+ val status: LicenseResponse.RequestStatus =
66
+ licenseResponse.requestStatus
67
+ ) {
68
+ LicenseResponse.RequestStatus.LICENSED -> {
69
+ Log.d(TAG, "LicenseResponse status: $status")
70
+ promise.resolve("LICENSED")
71
+ }
72
+ LicenseResponse.RequestStatus.NOT_LICENSED -> {
73
+ Log.d(TAG, "LicenseResponse status: $status")
74
+ promise.resolve("NOT_LICENSED")
75
+ }
76
+ LicenseResponse.RequestStatus.EXPIRED -> {
77
+ Log.d(TAG, "LicenseResponse status: $status")
78
+ promise.resolve("EXPIRED")
79
+ }
80
+ LicenseResponse.RequestStatus.ERROR_VERIFICATION -> {
81
+ Log.d(TAG, "LicenseResponse status: $status")
82
+ promise.resolve("ERROR_VERIFICATION")
83
+ }
84
+ LicenseResponse.RequestStatus.ERROR_INVALID_LICENSING_KEYS -> {
85
+ Log.d(TAG, "LicenseResponse status: $status")
86
+ promise.resolve("ERROR_INVALID_LICENSING_KEYS")
87
+ }
88
+ LicenseResponse.RequestStatus.UNKNOWN_ERROR -> {
89
+ Log.d(TAG, "LicenseResponse status: $status")
90
+ promise.resolve("UNKNOWN_ERROR")
91
+ }
89
92
  }
90
93
  }
94
+ } catch (exception: Exception) {
95
+ promise.reject("Error while attempting to check for License", exception)
91
96
  }
92
- } catch (exception: Exception) {
93
- promise.reject("Error while attempting to check for License", exception)
97
+ } else {
98
+ Log.d(TAG, "Amazon's DRM is disabled")
99
+ promise.resolve("NOT_LICENSED")
94
100
  }
95
101
  }
96
102
 
@@ -718,6 +718,7 @@ class RNIapIosSk2iOS15: Sk2Delegate {
718
718
 
719
719
  var result: Product.PurchaseResult?
720
720
 
721
+ #if swift(>=5.9)
721
722
  if #available(iOS 17.0, tvOS 17.0, *) {
722
723
  result = try await product.purchase(confirmIn: windowScene, options: options)
723
724
  } else {
@@ -725,6 +726,10 @@ class RNIapIosSk2iOS15: Sk2Delegate {
725
726
  result = try await product.purchase(options: options)
726
727
  #endif
727
728
  }
729
+ #elseif !os(visionOS)
730
+ result = try await product.purchase(options: options)
731
+ #endif
732
+
728
733
  switch result {
729
734
  case .success(let verification):
730
735
  debugMessage("Purchase Successful")
@@ -140,8 +140,8 @@ const validateReceiptIos = async ({
140
140
  /**
141
141
  * Clear Transaction (iOS only)
142
142
  * Finish remaining transactions. Related to issue #257 and #801
143
- * link : https://github.com/dooboolab-community/react-native-iap/issues/257
144
- * https://github.com/dooboolab-community/react-native-iap/issues/801
143
+ * link : https://github.com/hyochan/react-native-iap/issues/257
144
+ * https://github.com/hyochan/react-native-iap/issues/801
145
145
  * @returns {Promise<void>}
146
146
  */
147
147
  exports.validateReceiptIos = validateReceiptIos;
@@ -129,8 +129,8 @@ export const validateReceiptIos = async ({
129
129
  /**
130
130
  * Clear Transaction (iOS only)
131
131
  * Finish remaining transactions. Related to issue #257 and #801
132
- * link : https://github.com/dooboolab-community/react-native-iap/issues/257
133
- * https://github.com/dooboolab-community/react-native-iap/issues/801
132
+ * link : https://github.com/hyochan/react-native-iap/issues/257
133
+ * https://github.com/hyochan/react-native-iap/issues/801
134
134
  * @returns {Promise<void>}
135
135
  */
136
136
  export const clearTransactionIOS = () => getIosModule().clearTransaction();
@@ -101,8 +101,8 @@ export declare const validateReceiptIos: ({ receiptBody, isTest, }: {
101
101
  /**
102
102
  * Clear Transaction (iOS only)
103
103
  * Finish remaining transactions. Related to issue #257 and #801
104
- * link : https://github.com/dooboolab-community/react-native-iap/issues/257
105
- * https://github.com/dooboolab-community/react-native-iap/issues/801
104
+ * link : https://github.com/hyochan/react-native-iap/issues/257
105
+ * https://github.com/hyochan/react-native-iap/issues/801
106
106
  * @returns {Promise<void>}
107
107
  */
108
108
  export declare const clearTransactionIOS: () => Promise<void>;
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "react-native-iap",
3
- "version": "12.15.3",
3
+ "version": "12.15.5",
4
4
  "description": "React Native In App Purchase Module.",
5
- "repository": "https://github.com/dooboolab-community/react-native-iap",
6
- "author": "hyochan <dooboolab@gmail.com> (https://github.com/hyochan)",
5
+ "repository": "https://github.com/hyochan/react-native-iap",
6
+ "author": "hyochan <hyochan.dev@gmail.com> (https://github.com/hyochan)",
7
7
  "license": "MIT",
8
8
  "bugs": {
9
- "url": "https://github.com/dooboolab-community/react-native-iap/issues"
9
+ "url": "https://github.com/hyochan/react-native-iap/issues"
10
10
  },
11
- "homepage": "https://github.com/dooboolab-community/react-native-iap#readme",
11
+ "homepage": "https://github.com/hyochan/react-native-iap#readme",
12
12
  "publishConfig": {
13
13
  "registry": "https://registry.npmjs.org/"
14
14
  },
@@ -210,8 +210,8 @@ export const validateReceiptIos = async ({
210
210
  /**
211
211
  * Clear Transaction (iOS only)
212
212
  * Finish remaining transactions. Related to issue #257 and #801
213
- * link : https://github.com/dooboolab-community/react-native-iap/issues/257
214
- * https://github.com/dooboolab-community/react-native-iap/issues/801
213
+ * link : https://github.com/hyochan/react-native-iap/issues/257
214
+ * https://github.com/hyochan/react-native-iap/issues/801
215
215
  * @returns {Promise<void>}
216
216
  */
217
217
  export const clearTransactionIOS = (): Promise<void> =>