mobilyflow-react-native-sdk 0.7.0-alpha.2 → 0.7.0-alpha.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/android/build.gradle +10 -14
- package/android/generated/jni/CMakeLists.txt +1 -9
- package/android/generated/jni/react/renderer/components/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpecJSI.h +178 -218
- package/ios/MobilyflowReactNativeSdk.h +2 -4
- package/ios/MobilyflowReactNativeSdk.mm +4 -0
- package/ios/Utils/ParserMobilyPurchaseSDKOptions.h +1 -1
- package/ios/generated/ReactCodegen/RNMobilyflowReactNativeSdkSpecJSI.h +328 -0
- package/lib/commonjs/MobilyPurchaseSDK.js +5 -1
- package/lib/commonjs/MobilyPurchaseSDK.js.map +1 -1
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/version.js +8 -0
- package/lib/commonjs/version.js.map +1 -0
- package/lib/module/MobilyPurchaseSDK.js +5 -1
- package/lib/module/MobilyPurchaseSDK.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/module/version.js +4 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/commonjs/src/MobilyPurchaseSDK.d.ts +2 -1
- package/lib/typescript/commonjs/src/MobilyPurchaseSDK.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/object-transformer.d.ts +1 -1
- package/lib/typescript/commonjs/src/utils/object-transformer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/version.d.ts +2 -0
- package/lib/typescript/commonjs/src/version.d.ts.map +1 -0
- package/lib/typescript/module/src/MobilyPurchaseSDK.d.ts +2 -1
- package/lib/typescript/module/src/MobilyPurchaseSDK.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/object-transformer.d.ts +1 -1
- package/lib/typescript/module/src/utils/object-transformer.d.ts.map +1 -1
- package/lib/typescript/module/src/version.d.ts +2 -0
- package/lib/typescript/module/src/version.d.ts.map +1 -0
- package/package.json +8 -19
- package/src/MobilyPurchaseSDK.tsx +6 -1
- package/src/version.ts +1 -0
- package/LICENSE +0 -20
- package/README.md +0 -33
- package/android/generated/jni/react/renderer/components/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpecJSI-generated.cpp +0 -172
- package/android/gradle.properties +0 -5
- package/ios/generated/RNMobilyflowReactNativeSdkSpecJSI-generated.cpp +0 -172
- package/ios/generated/RNMobilyflowReactNativeSdkSpecJSI.h +0 -368
- /package/ios/generated/{RNMobilyflowReactNativeSdkSpec → ReactCodegen/RNMobilyflowReactNativeSdkSpec}/RNMobilyflowReactNativeSdkSpec-generated.mm +0 -0
- /package/ios/generated/{RNMobilyflowReactNativeSdkSpec → ReactCodegen/RNMobilyflowReactNativeSdkSpec}/RNMobilyflowReactNativeSdkSpec.h +0 -0
package/android/build.gradle
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
buildscript {
|
|
2
|
-
ext.
|
|
3
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) :
|
|
2
|
+
ext.safeExtGet = { name, fallback ->
|
|
3
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : fallback
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
ext.kotlin_version = safeExtGet("kotlinVersion", "2.1.20")
|
|
7
|
+
|
|
6
8
|
repositories {
|
|
7
9
|
google()
|
|
8
10
|
mavenCentral()
|
|
@@ -11,7 +13,7 @@ buildscript {
|
|
|
11
13
|
dependencies {
|
|
12
14
|
classpath "com.android.tools.build:gradle:8.7.3"
|
|
13
15
|
// noinspection DifferentKotlinGradleVersion
|
|
14
|
-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$
|
|
16
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
|
|
@@ -27,10 +29,6 @@ if (isNewArchitectureEnabled()) {
|
|
|
27
29
|
apply plugin: "com.facebook.react"
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
def getExtOrIntegerDefault(name) {
|
|
31
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["MobilyflowReactNativeSdk_" + name]).toInteger()
|
|
32
|
-
}
|
|
33
|
-
|
|
34
32
|
def supportsNamespace() {
|
|
35
33
|
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
|
|
36
34
|
def major = parsed[0].toInteger()
|
|
@@ -51,11 +49,11 @@ android {
|
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
|
|
54
|
-
compileSdkVersion
|
|
52
|
+
compileSdkVersion safeExtGet("compileSdkVersion", 35)
|
|
55
53
|
|
|
56
54
|
defaultConfig {
|
|
57
|
-
minSdkVersion
|
|
58
|
-
targetSdkVersion
|
|
55
|
+
minSdkVersion safeExtGet("minSdkVersion", 24)
|
|
56
|
+
targetSdkVersion safeExtGet("targetSdkVersion", 34)
|
|
59
57
|
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
60
58
|
}
|
|
61
59
|
|
|
@@ -95,13 +93,11 @@ repositories {
|
|
|
95
93
|
google()
|
|
96
94
|
}
|
|
97
95
|
|
|
98
|
-
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
99
|
-
|
|
100
96
|
dependencies {
|
|
101
97
|
implementation "com.facebook.react:react-android"
|
|
102
98
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
103
|
-
implementation "org.jetbrains.kotlinx:kotlinx-datetime:0.
|
|
104
|
-
implementation "com.mobilyflow:mobilyflow-android-sdk:0.7.0-alpha.
|
|
99
|
+
implementation "org.jetbrains.kotlinx:kotlinx-datetime:[0.7.0,0.8.0["
|
|
100
|
+
implementation "com.mobilyflow:mobilyflow-android-sdk:0.7.0-alpha.4"
|
|
105
101
|
implementation "org.jetbrains.kotlin:kotlin-reflect"
|
|
106
102
|
}
|
|
107
103
|
|
|
@@ -25,12 +25,4 @@ target_link_libraries(
|
|
|
25
25
|
reactnative
|
|
26
26
|
)
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
react_codegen_RNMobilyflowReactNativeSdkSpec
|
|
30
|
-
PRIVATE
|
|
31
|
-
-DLOG_TAG=\"ReactNative\"
|
|
32
|
-
-fexceptions
|
|
33
|
-
-frtti
|
|
34
|
-
-std=c++20
|
|
35
|
-
-Wall
|
|
36
|
-
)
|
|
28
|
+
target_compile_reactnative_options(react_codegen_RNMobilyflowReactNativeSdkSpec PRIVATE)
|
|
@@ -15,13 +15,12 @@
|
|
|
15
15
|
namespace facebook::react {
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
#pragma mark - NativeMobilyflowReactNativeSdkMobilyPurchaseSDKOptions
|
|
20
19
|
|
|
21
20
|
template <typename P0, typename P1, typename P2>
|
|
22
21
|
struct NativeMobilyflowReactNativeSdkMobilyPurchaseSDKOptions {
|
|
23
|
-
P0 languages;
|
|
24
|
-
P1 debug;
|
|
22
|
+
P0 languages{};
|
|
23
|
+
P1 debug{};
|
|
25
24
|
P2 apiURL;
|
|
26
25
|
bool operator==(const NativeMobilyflowReactNativeSdkMobilyPurchaseSDKOptions &other) const {
|
|
27
26
|
return languages == other.languages && debug == other.debug && apiURL == other.apiURL;
|
|
@@ -47,11 +46,9 @@ struct NativeMobilyflowReactNativeSdkMobilyPurchaseSDKOptionsBridging {
|
|
|
47
46
|
static jsi::Array languagesToJs(jsi::Runtime &rt, decltype(types.languages) value) {
|
|
48
47
|
return bridging::toJs(rt, value);
|
|
49
48
|
}
|
|
50
|
-
|
|
51
49
|
static bool debugToJs(jsi::Runtime &rt, decltype(types.debug) value) {
|
|
52
50
|
return bridging::toJs(rt, value);
|
|
53
51
|
}
|
|
54
|
-
|
|
55
52
|
static jsi::String apiURLToJs(jsi::Runtime &rt, decltype(types.apiURL) value) {
|
|
56
53
|
return bridging::toJs(rt, value);
|
|
57
54
|
}
|
|
@@ -81,7 +78,7 @@ struct NativeMobilyflowReactNativeSdkMobilyPurchaseSDKOptionsBridging {
|
|
|
81
78
|
|
|
82
79
|
template <typename P0, typename P1>
|
|
83
80
|
struct NativeMobilyflowReactNativeSdkPurchaseOptions {
|
|
84
|
-
P0 offerId;
|
|
81
|
+
P0 offerId{};
|
|
85
82
|
P1 quantity;
|
|
86
83
|
bool operator==(const NativeMobilyflowReactNativeSdkPurchaseOptions &other) const {
|
|
87
84
|
return offerId == other.offerId && quantity == other.quantity;
|
|
@@ -106,7 +103,6 @@ struct NativeMobilyflowReactNativeSdkPurchaseOptionsBridging {
|
|
|
106
103
|
static std::optional<jsi::String> offerIdToJs(jsi::Runtime &rt, decltype(types.offerId) value) {
|
|
107
104
|
return bridging::toJs(rt, value);
|
|
108
105
|
}
|
|
109
|
-
|
|
110
106
|
static std::optional<double> quantityToJs(jsi::Runtime &rt, decltype(types.quantity) value) {
|
|
111
107
|
return bridging::toJs(rt, value);
|
|
112
108
|
}
|
|
@@ -123,246 +119,210 @@ struct NativeMobilyflowReactNativeSdkPurchaseOptionsBridging {
|
|
|
123
119
|
}
|
|
124
120
|
};
|
|
125
121
|
|
|
126
|
-
class JSI_EXPORT NativeMobilyflowReactNativeSdkCxxSpecJSI : public TurboModule {
|
|
127
|
-
protected:
|
|
128
|
-
NativeMobilyflowReactNativeSdkCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
|
|
129
|
-
|
|
130
|
-
public:
|
|
131
|
-
virtual void initialize(jsi::Runtime &rt, jsi::String appId, jsi::String apiKey, jsi::String environment, std::optional<jsi::Object> options) = 0;
|
|
132
|
-
virtual void close(jsi::Runtime &rt) = 0;
|
|
133
|
-
virtual jsi::Value login(jsi::Runtime &rt, jsi::String externalRef) = 0;
|
|
134
|
-
virtual jsi::Value logout(jsi::Runtime &rt) = 0;
|
|
135
|
-
virtual jsi::Value getProducts(jsi::Runtime &rt, jsi::Array identifiers, bool onlyAvailable) = 0;
|
|
136
|
-
virtual jsi::Value getSubscriptionGroups(jsi::Runtime &rt, jsi::Array identifiers, bool onlyAvailable) = 0;
|
|
137
|
-
virtual jsi::Value getSubscriptionGroupById(jsi::Runtime &rt, jsi::String id) = 0;
|
|
138
|
-
virtual jsi::Value getEntitlementForSubscription(jsi::Runtime &rt, jsi::String subscriptionGroupId) = 0;
|
|
139
|
-
virtual jsi::Value getEntitlement(jsi::Runtime &rt, jsi::String productId) = 0;
|
|
140
|
-
virtual jsi::Value getEntitlements(jsi::Runtime &rt, std::optional<jsi::Array> productIds) = 0;
|
|
141
|
-
virtual jsi::Value getExternalEntitlements(jsi::Runtime &rt) = 0;
|
|
142
|
-
virtual jsi::Value requestTransferOwnership(jsi::Runtime &rt) = 0;
|
|
143
|
-
virtual jsi::Value openManageSubscription(jsi::Runtime &rt) = 0;
|
|
144
|
-
virtual jsi::Value openRefundDialogForProduct(jsi::Runtime &rt, jsi::String productId) = 0;
|
|
145
|
-
virtual jsi::Value openRefundDialogForTransactionId(jsi::Runtime &rt, jsi::String transactionId) = 0;
|
|
146
|
-
virtual jsi::Value purchaseProduct(jsi::Runtime &rt, jsi::String productId, std::optional<jsi::Object> options) = 0;
|
|
147
|
-
virtual jsi::Value sendDiagnostic(jsi::Runtime &rt) = 0;
|
|
148
|
-
virtual jsi::Value getStoreCountry(jsi::Runtime &rt) = 0;
|
|
149
|
-
virtual jsi::Value isBillingAvailable(jsi::Runtime &rt) = 0;
|
|
150
|
-
virtual jsi::Value isForwardingEnable(jsi::Runtime &rt, jsi::String externalRef) = 0;
|
|
151
|
-
virtual jsi::Value getCustomer(jsi::Runtime &rt) = 0;
|
|
152
|
-
virtual jsi::Value getSDKVersion(jsi::Runtime &rt) = 0;
|
|
153
|
-
|
|
154
|
-
};
|
|
155
122
|
|
|
156
123
|
template <typename T>
|
|
157
124
|
class JSI_EXPORT NativeMobilyflowReactNativeSdkCxxSpec : public TurboModule {
|
|
158
125
|
public:
|
|
159
|
-
jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
|
|
160
|
-
return delegate_.create(rt, propName);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
|
|
164
|
-
return delegate_.getPropertyNames(runtime);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
126
|
static constexpr std::string_view kModuleName = "MobilyflowReactNativeSdk";
|
|
168
127
|
|
|
169
128
|
protected:
|
|
170
|
-
NativeMobilyflowReactNativeSdkCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
129
|
+
NativeMobilyflowReactNativeSdkCxxSpec(std::shared_ptr<CallInvoker> jsInvoker) : TurboModule(std::string{NativeMobilyflowReactNativeSdkCxxSpec::kModuleName}, jsInvoker) {
|
|
130
|
+
methodMap_["initialize"] = MethodMetadata {.argCount = 4, .invoker = __initialize};
|
|
131
|
+
methodMap_["close"] = MethodMetadata {.argCount = 0, .invoker = __close};
|
|
132
|
+
methodMap_["login"] = MethodMetadata {.argCount = 1, .invoker = __login};
|
|
133
|
+
methodMap_["logout"] = MethodMetadata {.argCount = 0, .invoker = __logout};
|
|
134
|
+
methodMap_["getProducts"] = MethodMetadata {.argCount = 2, .invoker = __getProducts};
|
|
135
|
+
methodMap_["getSubscriptionGroups"] = MethodMetadata {.argCount = 2, .invoker = __getSubscriptionGroups};
|
|
136
|
+
methodMap_["getSubscriptionGroupById"] = MethodMetadata {.argCount = 1, .invoker = __getSubscriptionGroupById};
|
|
137
|
+
methodMap_["getEntitlementForSubscription"] = MethodMetadata {.argCount = 1, .invoker = __getEntitlementForSubscription};
|
|
138
|
+
methodMap_["getEntitlement"] = MethodMetadata {.argCount = 1, .invoker = __getEntitlement};
|
|
139
|
+
methodMap_["getEntitlements"] = MethodMetadata {.argCount = 1, .invoker = __getEntitlements};
|
|
140
|
+
methodMap_["getExternalEntitlements"] = MethodMetadata {.argCount = 0, .invoker = __getExternalEntitlements};
|
|
141
|
+
methodMap_["requestTransferOwnership"] = MethodMetadata {.argCount = 0, .invoker = __requestTransferOwnership};
|
|
142
|
+
methodMap_["openManageSubscription"] = MethodMetadata {.argCount = 0, .invoker = __openManageSubscription};
|
|
143
|
+
methodMap_["openRefundDialogForProduct"] = MethodMetadata {.argCount = 1, .invoker = __openRefundDialogForProduct};
|
|
144
|
+
methodMap_["openRefundDialogForTransactionId"] = MethodMetadata {.argCount = 1, .invoker = __openRefundDialogForTransactionId};
|
|
145
|
+
methodMap_["purchaseProduct"] = MethodMetadata {.argCount = 2, .invoker = __purchaseProduct};
|
|
146
|
+
methodMap_["sendDiagnostic"] = MethodMetadata {.argCount = 0, .invoker = __sendDiagnostic};
|
|
147
|
+
methodMap_["getStoreCountry"] = MethodMetadata {.argCount = 0, .invoker = __getStoreCountry};
|
|
148
|
+
methodMap_["isBillingAvailable"] = MethodMetadata {.argCount = 0, .invoker = __isBillingAvailable};
|
|
149
|
+
methodMap_["isForwardingEnable"] = MethodMetadata {.argCount = 1, .invoker = __isForwardingEnable};
|
|
150
|
+
methodMap_["getCustomer"] = MethodMetadata {.argCount = 0, .invoker = __getCustomer};
|
|
151
|
+
methodMap_["getSDKVersion"] = MethodMetadata {.argCount = 0, .invoker = __getSDKVersion};
|
|
152
|
+
}
|
|
153
|
+
|
|
175
154
|
private:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
"Expected initialize(...) to have 5 parameters");
|
|
187
|
-
|
|
188
|
-
return bridging::callFromJs<void>(
|
|
189
|
-
rt, &T::initialize, jsInvoker_, instance_, std::move(appId), std::move(apiKey), std::move(environment), std::move(options));
|
|
190
|
-
}
|
|
191
|
-
void close(jsi::Runtime &rt) override {
|
|
192
|
-
static_assert(
|
|
193
|
-
bridging::getParameterCount(&T::close) == 1,
|
|
194
|
-
"Expected close(...) to have 1 parameters");
|
|
195
|
-
|
|
196
|
-
return bridging::callFromJs<void>(
|
|
197
|
-
rt, &T::close, jsInvoker_, instance_);
|
|
198
|
-
}
|
|
199
|
-
jsi::Value login(jsi::Runtime &rt, jsi::String externalRef) override {
|
|
200
|
-
static_assert(
|
|
201
|
-
bridging::getParameterCount(&T::login) == 2,
|
|
202
|
-
"Expected login(...) to have 2 parameters");
|
|
203
|
-
|
|
204
|
-
return bridging::callFromJs<jsi::Value>(
|
|
205
|
-
rt, &T::login, jsInvoker_, instance_, std::move(externalRef));
|
|
206
|
-
}
|
|
207
|
-
jsi::Value logout(jsi::Runtime &rt) override {
|
|
208
|
-
static_assert(
|
|
209
|
-
bridging::getParameterCount(&T::logout) == 1,
|
|
210
|
-
"Expected logout(...) to have 1 parameters");
|
|
155
|
+
static jsi::Value __initialize(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
156
|
+
static_assert(
|
|
157
|
+
bridging::getParameterCount(&T::initialize) == 5,
|
|
158
|
+
"Expected initialize(...) to have 5 parameters");
|
|
159
|
+
bridging::callFromJs<void>(rt, &T::initialize, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
160
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
161
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
162
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt),
|
|
163
|
+
count <= 3 || args[3].isUndefined() ? std::nullopt : std::make_optional(args[3].asObject(rt)));return jsi::Value::undefined();
|
|
164
|
+
}
|
|
211
165
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
"Expected getProducts(...) to have 3 parameters");
|
|
166
|
+
static jsi::Value __close(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
167
|
+
static_assert(
|
|
168
|
+
bridging::getParameterCount(&T::close) == 1,
|
|
169
|
+
"Expected close(...) to have 1 parameters");
|
|
170
|
+
bridging::callFromJs<void>(rt, &T::close, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));return jsi::Value::undefined();
|
|
171
|
+
}
|
|
219
172
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
173
|
+
static jsi::Value __login(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
174
|
+
static_assert(
|
|
175
|
+
bridging::getParameterCount(&T::login) == 2,
|
|
176
|
+
"Expected login(...) to have 2 parameters");
|
|
177
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::login, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
178
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
179
|
+
}
|
|
227
180
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
"Expected getSubscriptionGroupById(...) to have 2 parameters");
|
|
181
|
+
static jsi::Value __logout(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
182
|
+
static_assert(
|
|
183
|
+
bridging::getParameterCount(&T::logout) == 1,
|
|
184
|
+
"Expected logout(...) to have 1 parameters");
|
|
185
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::logout, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
186
|
+
}
|
|
235
187
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
188
|
+
static jsi::Value __getProducts(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
189
|
+
static_assert(
|
|
190
|
+
bridging::getParameterCount(&T::getProducts) == 3,
|
|
191
|
+
"Expected getProducts(...) to have 3 parameters");
|
|
192
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::getProducts, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
193
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt),
|
|
194
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool());
|
|
195
|
+
}
|
|
243
196
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
197
|
+
static jsi::Value __getSubscriptionGroups(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
198
|
+
static_assert(
|
|
199
|
+
bridging::getParameterCount(&T::getSubscriptionGroups) == 3,
|
|
200
|
+
"Expected getSubscriptionGroups(...) to have 3 parameters");
|
|
201
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::getSubscriptionGroups, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
202
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt),
|
|
203
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool());
|
|
204
|
+
}
|
|
251
205
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
206
|
+
static jsi::Value __getSubscriptionGroupById(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
207
|
+
static_assert(
|
|
208
|
+
bridging::getParameterCount(&T::getSubscriptionGroupById) == 2,
|
|
209
|
+
"Expected getSubscriptionGroupById(...) to have 2 parameters");
|
|
210
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::getSubscriptionGroupById, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
211
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
212
|
+
}
|
|
259
213
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
214
|
+
static jsi::Value __getEntitlementForSubscription(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
215
|
+
static_assert(
|
|
216
|
+
bridging::getParameterCount(&T::getEntitlementForSubscription) == 2,
|
|
217
|
+
"Expected getEntitlementForSubscription(...) to have 2 parameters");
|
|
218
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::getEntitlementForSubscription, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
219
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
220
|
+
}
|
|
267
221
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
222
|
+
static jsi::Value __getEntitlement(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
223
|
+
static_assert(
|
|
224
|
+
bridging::getParameterCount(&T::getEntitlement) == 2,
|
|
225
|
+
"Expected getEntitlement(...) to have 2 parameters");
|
|
226
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::getEntitlement, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
227
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
228
|
+
}
|
|
275
229
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
230
|
+
static jsi::Value __getEntitlements(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
231
|
+
static_assert(
|
|
232
|
+
bridging::getParameterCount(&T::getEntitlements) == 2,
|
|
233
|
+
"Expected getEntitlements(...) to have 2 parameters");
|
|
234
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::getEntitlements, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
235
|
+
count <= 0 || args[0].isUndefined() ? std::nullopt : std::make_optional(args[0].asObject(rt).asArray(rt)));
|
|
236
|
+
}
|
|
283
237
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
"Expected openRefundDialogForProduct(...) to have 2 parameters");
|
|
238
|
+
static jsi::Value __getExternalEntitlements(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
239
|
+
static_assert(
|
|
240
|
+
bridging::getParameterCount(&T::getExternalEntitlements) == 1,
|
|
241
|
+
"Expected getExternalEntitlements(...) to have 1 parameters");
|
|
242
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::getExternalEntitlements, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
243
|
+
}
|
|
291
244
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
"Expected openRefundDialogForTransactionId(...) to have 2 parameters");
|
|
245
|
+
static jsi::Value __requestTransferOwnership(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
246
|
+
static_assert(
|
|
247
|
+
bridging::getParameterCount(&T::requestTransferOwnership) == 1,
|
|
248
|
+
"Expected requestTransferOwnership(...) to have 1 parameters");
|
|
249
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::requestTransferOwnership, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
250
|
+
}
|
|
299
251
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
"Expected purchaseProduct(...) to have 3 parameters");
|
|
252
|
+
static jsi::Value __openManageSubscription(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
253
|
+
static_assert(
|
|
254
|
+
bridging::getParameterCount(&T::openManageSubscription) == 1,
|
|
255
|
+
"Expected openManageSubscription(...) to have 1 parameters");
|
|
256
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::openManageSubscription, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
257
|
+
}
|
|
307
258
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
259
|
+
static jsi::Value __openRefundDialogForProduct(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
260
|
+
static_assert(
|
|
261
|
+
bridging::getParameterCount(&T::openRefundDialogForProduct) == 2,
|
|
262
|
+
"Expected openRefundDialogForProduct(...) to have 2 parameters");
|
|
263
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::openRefundDialogForProduct, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
264
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
265
|
+
}
|
|
315
266
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
267
|
+
static jsi::Value __openRefundDialogForTransactionId(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
268
|
+
static_assert(
|
|
269
|
+
bridging::getParameterCount(&T::openRefundDialogForTransactionId) == 2,
|
|
270
|
+
"Expected openRefundDialogForTransactionId(...) to have 2 parameters");
|
|
271
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::openRefundDialogForTransactionId, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
272
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
273
|
+
}
|
|
323
274
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
275
|
+
static jsi::Value __purchaseProduct(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
276
|
+
static_assert(
|
|
277
|
+
bridging::getParameterCount(&T::purchaseProduct) == 3,
|
|
278
|
+
"Expected purchaseProduct(...) to have 3 parameters");
|
|
279
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::purchaseProduct, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
280
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
281
|
+
count <= 1 || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asObject(rt)));
|
|
282
|
+
}
|
|
331
283
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
"Expected isForwardingEnable(...) to have 2 parameters");
|
|
284
|
+
static jsi::Value __sendDiagnostic(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
285
|
+
static_assert(
|
|
286
|
+
bridging::getParameterCount(&T::sendDiagnostic) == 1,
|
|
287
|
+
"Expected sendDiagnostic(...) to have 1 parameters");
|
|
288
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::sendDiagnostic, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
289
|
+
}
|
|
339
290
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
"Expected getCustomer(...) to have 1 parameters");
|
|
291
|
+
static jsi::Value __getStoreCountry(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
292
|
+
static_assert(
|
|
293
|
+
bridging::getParameterCount(&T::getStoreCountry) == 1,
|
|
294
|
+
"Expected getStoreCountry(...) to have 1 parameters");
|
|
295
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::getStoreCountry, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
296
|
+
}
|
|
347
297
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
"Expected getSDKVersion(...) to have 1 parameters");
|
|
298
|
+
static jsi::Value __isBillingAvailable(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
299
|
+
static_assert(
|
|
300
|
+
bridging::getParameterCount(&T::isBillingAvailable) == 1,
|
|
301
|
+
"Expected isBillingAvailable(...) to have 1 parameters");
|
|
302
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::isBillingAvailable, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
303
|
+
}
|
|
355
304
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
305
|
+
static jsi::Value __isForwardingEnable(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
306
|
+
static_assert(
|
|
307
|
+
bridging::getParameterCount(&T::isForwardingEnable) == 2,
|
|
308
|
+
"Expected isForwardingEnable(...) to have 2 parameters");
|
|
309
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::isForwardingEnable, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
310
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
311
|
+
}
|
|
359
312
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
313
|
+
static jsi::Value __getCustomer(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
314
|
+
static_assert(
|
|
315
|
+
bridging::getParameterCount(&T::getCustomer) == 1,
|
|
316
|
+
"Expected getCustomer(...) to have 1 parameters");
|
|
317
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::getCustomer, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
318
|
+
}
|
|
364
319
|
|
|
365
|
-
|
|
320
|
+
static jsi::Value __getSDKVersion(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
321
|
+
static_assert(
|
|
322
|
+
bridging::getParameterCount(&T::getSDKVersion) == 1,
|
|
323
|
+
"Expected getSDKVersion(...) to have 1 parameters");
|
|
324
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::getSDKVersion, static_cast<NativeMobilyflowReactNativeSdkCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
325
|
+
}
|
|
366
326
|
};
|
|
367
327
|
|
|
368
328
|
} // namespace facebook::react
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
#import
|
|
2
|
-
|
|
3
|
-
@interface MobilyflowReactNativeSdk : NSObject <NativeMobilyflowReactNativeSdkSpec>
|
|
4
|
-
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
5
2
|
|
|
3
|
+
@interface MobilyflowReactNativeSdk : NSObject
|
|
6
4
|
|
|
7
5
|
@end
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
#import "MobilyflowReactNativeSdk.h"
|
|
2
|
+
#import "generated/ReactCodegen/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpec.h"
|
|
2
3
|
#import <MobilyflowSDK/MobilyflowSDK.h>
|
|
3
4
|
#import <Foundation/NSUUID.h>
|
|
4
5
|
#import "Utils/ParserMobilyPurchaseSDKOptions.h"
|
|
5
6
|
#import "Utils/Utils.h"
|
|
6
7
|
|
|
8
|
+
@interface MobilyflowReactNativeSdk () <NativeMobilyflowReactNativeSdkSpec>
|
|
9
|
+
@end
|
|
10
|
+
|
|
7
11
|
@implementation MobilyflowReactNativeSdk
|
|
8
12
|
|
|
9
13
|
RCT_EXPORT_MODULE()
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
#import <Foundation/Foundation.h>
|
|
9
9
|
#import <RCTTypeSafety/RCTConvertHelpers.h>
|
|
10
|
-
#import "../generated/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpec.h"
|
|
10
|
+
#import "../generated/ReactCodegen/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpec.h"
|
|
11
11
|
#import <MobilyflowSDK/MobilyflowSDK.h>
|
|
12
12
|
|
|
13
13
|
NS_ASSUME_NONNULL_BEGIN
|