@revenuecat/purchases-capacitor 7.6.1 → 7.7.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.
- package/README.md +1 -0
- package/RevenueCatPurchasesCapacitor.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/revenuecat/purchases/capacitor/PurchasesPlugin.kt +9 -5
- package/dist/docs.json +6 -0
- package/ios/Plugin/PurchasesPlugin.swift +8 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1562,6 +1562,7 @@ Listener used to receive log messages from the SDK.
|
|
|
1562
1562
|
| **`IMMEDIATE_WITH_TIME_PRORATION`** | <code>1</code> | Replacement takes effect immediately, and the remaining time will be prorated and credited to the user. This is the current default behavior. |
|
|
1563
1563
|
| **`IMMEDIATE_AND_CHARGE_PRORATED_PRICE`** | <code>2</code> | Replacement takes effect immediately, and the billing cycle remains the same. The price for the remaining period will be charged. This option is only available for subscription upgrade. |
|
|
1564
1564
|
| **`IMMEDIATE_WITHOUT_PRORATION`** | <code>3</code> | Replacement takes effect immediately, and the new price will be charged on next recurrence time. The billing cycle stays the same. |
|
|
1565
|
+
| **`DEFERRED`** | <code>4</code> | Replacement takes effect when the old plan expires, and the new price will be charged at the same time. |
|
|
1565
1566
|
| **`IMMEDIATE_AND_CHARGE_FULL_PRICE`** | <code>5</code> | Replacement takes effect immediately, and the user is charged full price of new plan and is given a full billing cycle of subscription, plus remaining prorated time from the old plan. |
|
|
1566
1567
|
|
|
1567
1568
|
|
|
@@ -13,6 +13,6 @@ Pod::Spec.new do |s|
|
|
|
13
13
|
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
14
|
s.ios.deployment_target = '13.0'
|
|
15
15
|
s.dependency 'Capacitor'
|
|
16
|
-
s.dependency 'PurchasesHybridCommon', '
|
|
16
|
+
s.dependency 'PurchasesHybridCommon', '11.1.1'
|
|
17
17
|
s.swift_version = '5.1'
|
|
18
18
|
end
|
package/android/build.gradle
CHANGED
|
@@ -53,7 +53,7 @@ dependencies {
|
|
|
53
53
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
54
54
|
implementation project(':capacitor-android')
|
|
55
55
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
56
|
-
implementation 'com.revenuecat.purchases:purchases-hybrid-common:
|
|
56
|
+
implementation 'com.revenuecat.purchases:purchases-hybrid-common:11.1.1'
|
|
57
57
|
testImplementation "junit:junit:$junitVersion"
|
|
58
58
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
59
59
|
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
@@ -11,6 +11,7 @@ import com.getcapacitor.annotation.CapacitorPlugin
|
|
|
11
11
|
import com.revenuecat.purchases.CustomerInfo
|
|
12
12
|
import com.revenuecat.purchases.Purchases
|
|
13
13
|
import com.revenuecat.purchases.Store
|
|
14
|
+
import com.revenuecat.purchases.PurchasesAreCompletedBy
|
|
14
15
|
import com.revenuecat.purchases.common.PlatformInfo
|
|
15
16
|
import com.revenuecat.purchases.hybridcommon.ErrorContainer
|
|
16
17
|
import com.revenuecat.purchases.hybridcommon.OnNullableResult
|
|
@@ -22,6 +23,7 @@ import com.revenuecat.purchases.hybridcommon.getProductInfo
|
|
|
22
23
|
import com.revenuecat.purchases.hybridcommon.mappers.convertToMap
|
|
23
24
|
import com.revenuecat.purchases.hybridcommon.mappers.map
|
|
24
25
|
import com.revenuecat.purchases.hybridcommon.purchaseProduct
|
|
26
|
+
import com.revenuecat.purchases.hybridcommon.setPurchasesAreCompletedBy
|
|
25
27
|
import com.revenuecat.purchases.hybridcommon.showInAppMessagesIfNeeded
|
|
26
28
|
import com.revenuecat.purchases.interfaces.UpdatedCustomerInfoListener
|
|
27
29
|
import com.revenuecat.purchases.models.InAppMessageType
|
|
@@ -52,7 +54,6 @@ import com.revenuecat.purchases.hybridcommon.setCreative as setCreativeCommon
|
|
|
52
54
|
import com.revenuecat.purchases.hybridcommon.setDisplayName as setDisplayNameCommon
|
|
53
55
|
import com.revenuecat.purchases.hybridcommon.setEmail as setEmailCommon
|
|
54
56
|
import com.revenuecat.purchases.hybridcommon.setFBAnonymousID as setFBAnonymousIDCommon
|
|
55
|
-
import com.revenuecat.purchases.hybridcommon.setFinishTransactions as setFinishTransactionsCommon
|
|
56
57
|
import com.revenuecat.purchases.hybridcommon.setFirebaseAppInstanceID as setFirebaseAppInstanceIDCommon
|
|
57
58
|
import com.revenuecat.purchases.hybridcommon.setKeyword as setKeywordCommon
|
|
58
59
|
import com.revenuecat.purchases.hybridcommon.setLogHandler as setLogHandlerCommon
|
|
@@ -77,7 +78,7 @@ class PurchasesPlugin : Plugin() {
|
|
|
77
78
|
|
|
78
79
|
companion object {
|
|
79
80
|
private const val PLATFORM_NAME = "capacitor"
|
|
80
|
-
private const val PLUGIN_VERSION = "7.
|
|
81
|
+
private const val PLUGIN_VERSION = "7.7.1"
|
|
81
82
|
|
|
82
83
|
private const val CUSTOMER_INFO_KEY = "customerInfo"
|
|
83
84
|
}
|
|
@@ -96,7 +97,8 @@ class PurchasesPlugin : Plugin() {
|
|
|
96
97
|
context.applicationContext,
|
|
97
98
|
apiKey,
|
|
98
99
|
appUserID,
|
|
99
|
-
observerMode
|
|
100
|
+
if (observerMode == true) PurchasesAreCompletedBy.MY_APP
|
|
101
|
+
else PurchasesAreCompletedBy.REVENUECAT,
|
|
100
102
|
platformInfo,
|
|
101
103
|
store,
|
|
102
104
|
shouldShowInAppMessagesAutomatically = shouldShowInAppMessages,
|
|
@@ -123,7 +125,10 @@ class PurchasesPlugin : Plugin() {
|
|
|
123
125
|
fun setFinishTransactions(call: PluginCall) {
|
|
124
126
|
if (rejectIfNotConfigured(call)) return
|
|
125
127
|
val finishTransactions = call.getBooleanOrReject("finishTransactions") ?: return
|
|
126
|
-
|
|
128
|
+
setPurchasesAreCompletedBy(
|
|
129
|
+
if (finishTransactions) PurchasesAreCompletedBy.REVENUECAT
|
|
130
|
+
else PurchasesAreCompletedBy.MY_APP
|
|
131
|
+
)
|
|
127
132
|
call.resolve()
|
|
128
133
|
}
|
|
129
134
|
|
|
@@ -411,7 +416,6 @@ class PurchasesPlugin : Plugin() {
|
|
|
411
416
|
|
|
412
417
|
@PluginMethod(returnType = PluginMethod.RETURN_NONE)
|
|
413
418
|
fun setProxyURL(call: PluginCall) {
|
|
414
|
-
if (rejectIfNotConfigured(call)) return
|
|
415
419
|
val urlString = call.getString("url")
|
|
416
420
|
setProxyURLStringCommon(urlString)
|
|
417
421
|
call.resolve()
|
package/dist/docs.json
CHANGED
|
@@ -3202,6 +3202,12 @@
|
|
|
3202
3202
|
"tags": [],
|
|
3203
3203
|
"docs": "Replacement takes effect immediately, and the new price will be charged on\nnext recurrence time. The billing cycle stays the same."
|
|
3204
3204
|
},
|
|
3205
|
+
{
|
|
3206
|
+
"name": "DEFERRED",
|
|
3207
|
+
"value": "4",
|
|
3208
|
+
"tags": [],
|
|
3209
|
+
"docs": "Replacement takes effect when the old plan expires, and the new price will\nbe charged at the same time."
|
|
3210
|
+
},
|
|
3205
3211
|
{
|
|
3206
3212
|
"name": "IMMEDIATE_AND_CHARGE_FULL_PRICE",
|
|
3207
3213
|
"value": "5",
|
|
@@ -12,7 +12,7 @@ import RevenueCat
|
|
|
12
12
|
@objc(PurchasesPlugin)
|
|
13
13
|
public class PurchasesPlugin: CAPPlugin, PurchasesDelegate {
|
|
14
14
|
private let platformFlavor = "capacitor"
|
|
15
|
-
private let platformVersion = "7.
|
|
15
|
+
private let platformVersion = "7.7.1"
|
|
16
16
|
|
|
17
17
|
private let customerInfoKey = "customerInfo"
|
|
18
18
|
|
|
@@ -36,7 +36,8 @@ public class PurchasesPlugin: CAPPlugin, PurchasesDelegate {
|
|
|
36
36
|
let entitlementVerificationMode = call.getString("entitlementVerificationMode")
|
|
37
37
|
let purchases = Purchases.configure(apiKey: apiKey,
|
|
38
38
|
appUserID: appUserID,
|
|
39
|
-
|
|
39
|
+
purchasesAreCompletedBy: observerMode ? PurchasesAreCompletedBy.myApp:
|
|
40
|
+
PurchasesAreCompletedBy.revenueCat,
|
|
40
41
|
userDefaultsSuiteName: userDefaultsSuiteName,
|
|
41
42
|
platformFlavor: self.platformFlavor,
|
|
42
43
|
platformFlavorVersion: self.platformVersion,
|
|
@@ -55,7 +56,11 @@ public class PurchasesPlugin: CAPPlugin, PurchasesDelegate {
|
|
|
55
56
|
@objc func setFinishTransactions(_ call: CAPPluginCall) {
|
|
56
57
|
guard self.rejectIfPurchasesNotConfigured(call) else { return }
|
|
57
58
|
guard let finishTransactions = call.getOrRejectBool("finishTransactions") else { return }
|
|
58
|
-
|
|
59
|
+
if (finishTransactions) {
|
|
60
|
+
CommonFunctionality.setPurchasesAreCompletedBy(.revenueCat)
|
|
61
|
+
} else {
|
|
62
|
+
CommonFunctionality.setPurchasesAreCompletedBy(.myApp)
|
|
63
|
+
}
|
|
59
64
|
call.resolve()
|
|
60
65
|
}
|
|
61
66
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revenuecat/purchases-capacitor",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.7.1",
|
|
4
4
|
"description": "Capacitor in-app purchases and subscriptions made easy. Support for iOS and Android.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -72,6 +72,6 @@
|
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@revenuecat/purchases-typescript-internal-esm": "
|
|
75
|
+
"@revenuecat/purchases-typescript-internal-esm": "11.1.1"
|
|
76
76
|
}
|
|
77
77
|
}
|