You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you use the beta virtual currency features, you’ll need to annotate your function/class with the `@OptIn(ExperimentalPreviewRevenueCatPurchasesAPI::class)` annotation:
Virtual currency functionality is available in the native Android SDK in versions 9.1.0 and above.
75
54
76
55
### React Native
77
56
@@ -152,9 +131,11 @@ import content5 from "@site/code_blocks/virtual-currency/balance-response.json?r
152
131
153
132
#### From the SDK
154
133
155
-
##### iOS
134
+
##### iOS and Android
156
135
157
136
import fetchVCBalancesSwift from "@site/code_blocks/virtual-currency/vc-balance-sdk-ios.swift?raw";
137
+
import fetchVCBalancesKotlin from "@site/code_blocks/virtual-currency/vc-balance-sdk-android.kt?raw";
138
+
import fetchVCBalancesJava from "@site/code_blocks/virtual-currency/vc-balance-sdk-android.java?raw";
158
139
159
140
You can use the `virtualCurrencies()` function to retrieve a customer's balance. The function returns a `VirtualCurrencies` object, which includes the customer's balances along with each virtual currency's metadata.
160
141
@@ -165,6 +146,16 @@ You can use the `virtualCurrencies()` function to retrieve a customer's balance.
165
146
content: fetchVCBalancesSwift,
166
147
name: "Swift",
167
148
},
149
+
{
150
+
type: "kotlin",
151
+
content: fetchVCBalancesKotlin,
152
+
name: "Kotlin",
153
+
},
154
+
{
155
+
type: "java",
156
+
content: fetchVCBalancesJava,
157
+
name: "Java",
158
+
},
168
159
]}
169
160
/>
170
161
@@ -186,21 +177,15 @@ import cachedVirtualCurrenciesSwift from "@site/code_blocks/virtual-currency/cac
186
177
]}
187
178
/>
188
179
189
-
##### Android, React Native, and Flutter
180
+
##### React Native and Flutter
190
181
191
-
If you're using the virtual currency SDK betas for Android, React Native, and Flutter, you can fetch the virtual currency balances from the [CustomerInfo](https://www.revenuecat.com/docs/customers/customer-info) object in the SDK:
182
+
If you're using the virtual currency SDK betas for React Native or Flutter, you can fetch the virtual currency balances from the [CustomerInfo](https://www.revenuecat.com/docs/customers/customer-info) object in the SDK:
192
183
193
-
import fetchVCBalancesKotlin from "@site/code_blocks/virtual-currency/vc-balance-sdk-android.kt?raw";
194
184
import fetchVCBalancesReactNative from "@site/code_blocks/virtual-currency/vc-balance-sdk-react-native.ts.txt?raw";
195
185
import fetchVCBalancesFlutter from "@site/code_blocks/virtual-currency/vc-balance-sdk-flutter.dart?raw";
0 commit comments