mobilyflow-react-native-sdk 0.6.1 → 0.7.0-alpha.4

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.
Files changed (72) hide show
  1. package/MobilyflowReactNativeSdk.podspec +1 -1
  2. package/android/build.gradle +12 -16
  3. package/android/generated/jni/CMakeLists.txt +1 -9
  4. package/android/generated/jni/react/renderer/components/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpecJSI.h +178 -218
  5. package/ios/MobilyflowReactNativeSdk.h +2 -4
  6. package/ios/MobilyflowReactNativeSdk.mm +4 -0
  7. package/ios/generated/Package.swift +66 -0
  8. package/ios/generated/ReactAppDependencyProvider/RCTAppDependencyProvider.h +25 -0
  9. package/ios/generated/ReactAppDependencyProvider/RCTAppDependencyProvider.mm +40 -0
  10. package/ios/generated/ReactAppDependencyProvider/ReactAppDependencyProvider.podspec +34 -0
  11. package/ios/generated/ReactCodegen/RCTModuleProviders.h +16 -0
  12. package/ios/generated/ReactCodegen/RCTModuleProviders.mm +51 -0
  13. package/ios/generated/ReactCodegen/RCTModulesConformingToProtocolsProvider.h +18 -0
  14. package/ios/generated/ReactCodegen/RCTModulesConformingToProtocolsProvider.mm +54 -0
  15. package/ios/generated/ReactCodegen/RCTThirdPartyComponentsProvider.h +16 -0
  16. package/ios/generated/ReactCodegen/RCTThirdPartyComponentsProvider.mm +30 -0
  17. package/ios/generated/ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.h +14 -0
  18. package/ios/generated/ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.mm +19 -0
  19. package/ios/generated/ReactCodegen/RNMobilyflowReactNativeSdkSpecJSI.h +328 -0
  20. package/ios/generated/ReactCodegen/ReactCodegen.podspec +110 -0
  21. package/lib/commonjs/enums/mobily-event-type.js +15 -15
  22. package/lib/commonjs/enums/mobily-product-status.js +3 -3
  23. package/lib/commonjs/enums/mobily-product-type.js +2 -2
  24. package/lib/commonjs/enums/mobily-refund-dialog-result.js +3 -3
  25. package/lib/commonjs/enums/mobily-transaction-status.js +3 -3
  26. package/lib/commonjs/enums/mobily-transfer-ownership-status.js +5 -4
  27. package/lib/commonjs/enums/mobily-transfer-ownership-status.js.map +1 -1
  28. package/lib/commonjs/enums/mobily-webhook-status.js +4 -3
  29. package/lib/commonjs/enums/mobily-webhook-status.js.map +1 -1
  30. package/lib/module/enums/mobily-event-type.js +15 -15
  31. package/lib/module/enums/mobily-product-status.js +3 -3
  32. package/lib/module/enums/mobily-product-type.js +2 -2
  33. package/lib/module/enums/mobily-refund-dialog-result.js +3 -3
  34. package/lib/module/enums/mobily-transaction-status.js +3 -3
  35. package/lib/module/enums/mobily-transfer-ownership-status.js +5 -4
  36. package/lib/module/enums/mobily-transfer-ownership-status.js.map +1 -1
  37. package/lib/module/enums/mobily-webhook-status.js +4 -3
  38. package/lib/module/enums/mobily-webhook-status.js.map +1 -1
  39. package/lib/typescript/commonjs/src/enums/mobily-event-type.d.ts +15 -15
  40. package/lib/typescript/commonjs/src/enums/mobily-event-type.d.ts.map +1 -1
  41. package/lib/typescript/commonjs/src/enums/mobily-product-status.d.ts +3 -3
  42. package/lib/typescript/commonjs/src/enums/mobily-product-type.d.ts +2 -2
  43. package/lib/typescript/commonjs/src/enums/mobily-refund-dialog-result.d.ts +3 -3
  44. package/lib/typescript/commonjs/src/enums/mobily-transaction-status.d.ts +3 -3
  45. package/lib/typescript/commonjs/src/enums/mobily-transfer-ownership-status.d.ts +5 -4
  46. package/lib/typescript/commonjs/src/enums/mobily-transfer-ownership-status.d.ts.map +1 -1
  47. package/lib/typescript/commonjs/src/enums/mobily-webhook-status.d.ts +4 -3
  48. package/lib/typescript/commonjs/src/enums/mobily-webhook-status.d.ts.map +1 -1
  49. package/lib/typescript/module/src/enums/mobily-event-type.d.ts +15 -15
  50. package/lib/typescript/module/src/enums/mobily-event-type.d.ts.map +1 -1
  51. package/lib/typescript/module/src/enums/mobily-product-status.d.ts +3 -3
  52. package/lib/typescript/module/src/enums/mobily-product-type.d.ts +2 -2
  53. package/lib/typescript/module/src/enums/mobily-refund-dialog-result.d.ts +3 -3
  54. package/lib/typescript/module/src/enums/mobily-transaction-status.d.ts +3 -3
  55. package/lib/typescript/module/src/enums/mobily-transfer-ownership-status.d.ts +5 -4
  56. package/lib/typescript/module/src/enums/mobily-transfer-ownership-status.d.ts.map +1 -1
  57. package/lib/typescript/module/src/enums/mobily-webhook-status.d.ts +4 -3
  58. package/lib/typescript/module/src/enums/mobily-webhook-status.d.ts.map +1 -1
  59. package/package.json +3 -3
  60. package/src/enums/mobily-event-type.ts +15 -15
  61. package/src/enums/mobily-product-status.ts +3 -3
  62. package/src/enums/mobily-product-type.ts +2 -2
  63. package/src/enums/mobily-refund-dialog-result.ts +3 -3
  64. package/src/enums/mobily-transaction-status.ts +3 -3
  65. package/src/enums/mobily-transfer-ownership-status.ts +5 -4
  66. package/src/enums/mobily-webhook-status.ts +4 -3
  67. package/android/generated/jni/react/renderer/components/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpecJSI-generated.cpp +0 -172
  68. package/android/gradle.properties +0 -5
  69. package/ios/generated/RNMobilyflowReactNativeSdkSpecJSI-generated.cpp +0 -172
  70. package/ios/generated/RNMobilyflowReactNativeSdkSpecJSI.h +0 -368
  71. /package/ios/generated/{RNMobilyflowReactNativeSdkSpec → ReactCodegen/RNMobilyflowReactNativeSdkSpec}/RNMobilyflowReactNativeSdkSpec-generated.mm +0 -0
  72. /package/ios/generated/{RNMobilyflowReactNativeSdkSpec → ReactCodegen/RNMobilyflowReactNativeSdkSpec}/RNMobilyflowReactNativeSdkSpec.h +0 -0
@@ -21,7 +21,7 @@ Pod::Spec.new do |s|
21
21
  s.swift_versions = '5.0'
22
22
 
23
23
  # Install MobilyFlow SDK
24
- s.dependency 'MobilyflowSDK', '0.6.0'
24
+ s.dependency 'MobilyflowSDK', '0.7.0-alpha.2'
25
25
 
26
26
  #s.subspec 'MobilyflowSDK' do |ss|
27
27
  # ss.source_files = '../mobilyflow-ios-sdk/Sources/MobilyflowSDK/**/*'
@@ -1,8 +1,10 @@
1
- buildscript {
2
- ext.getExtOrDefault = { name ->
3
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['MobilyflowReactNativeSdk_' + name]
4
- }
1
+ def safeExtGet(name, fallback) {
2
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : fallback
3
+ }
4
+
5
+ def kotlin_version = getExtOrDefault("kotlinVersion", "2.1.20")
5
6
 
7
+ buildscript {
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:${getExtOrDefault('kotlinVersion')}"
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 getExtOrIntegerDefault("compileSdkVersion")
52
+ compileSdkVersion safeExtGet("compileSdkVersion", 35)
55
53
 
56
54
  defaultConfig {
57
- minSdkVersion getExtOrIntegerDefault("minSdkVersion")
58
- targetSdkVersion getExtOrIntegerDefault("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.6.2"
104
- implementation "com.mobilyflow:mobilyflow-android-sdk:0.6.0"
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
- target_compile_options(
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
- : TurboModule(std::string{NativeMobilyflowReactNativeSdkCxxSpec::kModuleName}, jsInvoker),
172
- delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
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
- class Delegate : public NativeMobilyflowReactNativeSdkCxxSpecJSI {
177
- public:
178
- Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
179
- NativeMobilyflowReactNativeSdkCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
180
-
181
- }
182
-
183
- void initialize(jsi::Runtime &rt, jsi::String appId, jsi::String apiKey, jsi::String environment, std::optional<jsi::Object> options) override {
184
- static_assert(
185
- bridging::getParameterCount(&T::initialize) == 5,
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
- return bridging::callFromJs<jsi::Value>(
213
- rt, &T::logout, jsInvoker_, instance_);
214
- }
215
- jsi::Value getProducts(jsi::Runtime &rt, jsi::Array identifiers, bool onlyAvailable) override {
216
- static_assert(
217
- bridging::getParameterCount(&T::getProducts) == 3,
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
- return bridging::callFromJs<jsi::Value>(
221
- rt, &T::getProducts, jsInvoker_, instance_, std::move(identifiers), std::move(onlyAvailable));
222
- }
223
- jsi::Value getSubscriptionGroups(jsi::Runtime &rt, jsi::Array identifiers, bool onlyAvailable) override {
224
- static_assert(
225
- bridging::getParameterCount(&T::getSubscriptionGroups) == 3,
226
- "Expected getSubscriptionGroups(...) to have 3 parameters");
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
- return bridging::callFromJs<jsi::Value>(
229
- rt, &T::getSubscriptionGroups, jsInvoker_, instance_, std::move(identifiers), std::move(onlyAvailable));
230
- }
231
- jsi::Value getSubscriptionGroupById(jsi::Runtime &rt, jsi::String id) override {
232
- static_assert(
233
- bridging::getParameterCount(&T::getSubscriptionGroupById) == 2,
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
- return bridging::callFromJs<jsi::Value>(
237
- rt, &T::getSubscriptionGroupById, jsInvoker_, instance_, std::move(id));
238
- }
239
- jsi::Value getEntitlementForSubscription(jsi::Runtime &rt, jsi::String subscriptionGroupId) override {
240
- static_assert(
241
- bridging::getParameterCount(&T::getEntitlementForSubscription) == 2,
242
- "Expected getEntitlementForSubscription(...) to have 2 parameters");
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
- return bridging::callFromJs<jsi::Value>(
245
- rt, &T::getEntitlementForSubscription, jsInvoker_, instance_, std::move(subscriptionGroupId));
246
- }
247
- jsi::Value getEntitlement(jsi::Runtime &rt, jsi::String productId) override {
248
- static_assert(
249
- bridging::getParameterCount(&T::getEntitlement) == 2,
250
- "Expected getEntitlement(...) to have 2 parameters");
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
- return bridging::callFromJs<jsi::Value>(
253
- rt, &T::getEntitlement, jsInvoker_, instance_, std::move(productId));
254
- }
255
- jsi::Value getEntitlements(jsi::Runtime &rt, std::optional<jsi::Array> productIds) override {
256
- static_assert(
257
- bridging::getParameterCount(&T::getEntitlements) == 2,
258
- "Expected getEntitlements(...) to have 2 parameters");
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
- return bridging::callFromJs<jsi::Value>(
261
- rt, &T::getEntitlements, jsInvoker_, instance_, std::move(productIds));
262
- }
263
- jsi::Value getExternalEntitlements(jsi::Runtime &rt) override {
264
- static_assert(
265
- bridging::getParameterCount(&T::getExternalEntitlements) == 1,
266
- "Expected getExternalEntitlements(...) to have 1 parameters");
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
- return bridging::callFromJs<jsi::Value>(
269
- rt, &T::getExternalEntitlements, jsInvoker_, instance_);
270
- }
271
- jsi::Value requestTransferOwnership(jsi::Runtime &rt) override {
272
- static_assert(
273
- bridging::getParameterCount(&T::requestTransferOwnership) == 1,
274
- "Expected requestTransferOwnership(...) to have 1 parameters");
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
- return bridging::callFromJs<jsi::Value>(
277
- rt, &T::requestTransferOwnership, jsInvoker_, instance_);
278
- }
279
- jsi::Value openManageSubscription(jsi::Runtime &rt) override {
280
- static_assert(
281
- bridging::getParameterCount(&T::openManageSubscription) == 1,
282
- "Expected openManageSubscription(...) to have 1 parameters");
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
- return bridging::callFromJs<jsi::Value>(
285
- rt, &T::openManageSubscription, jsInvoker_, instance_);
286
- }
287
- jsi::Value openRefundDialogForProduct(jsi::Runtime &rt, jsi::String productId) override {
288
- static_assert(
289
- bridging::getParameterCount(&T::openRefundDialogForProduct) == 2,
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
- return bridging::callFromJs<jsi::Value>(
293
- rt, &T::openRefundDialogForProduct, jsInvoker_, instance_, std::move(productId));
294
- }
295
- jsi::Value openRefundDialogForTransactionId(jsi::Runtime &rt, jsi::String transactionId) override {
296
- static_assert(
297
- bridging::getParameterCount(&T::openRefundDialogForTransactionId) == 2,
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
- return bridging::callFromJs<jsi::Value>(
301
- rt, &T::openRefundDialogForTransactionId, jsInvoker_, instance_, std::move(transactionId));
302
- }
303
- jsi::Value purchaseProduct(jsi::Runtime &rt, jsi::String productId, std::optional<jsi::Object> options) override {
304
- static_assert(
305
- bridging::getParameterCount(&T::purchaseProduct) == 3,
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
- return bridging::callFromJs<jsi::Value>(
309
- rt, &T::purchaseProduct, jsInvoker_, instance_, std::move(productId), std::move(options));
310
- }
311
- jsi::Value sendDiagnostic(jsi::Runtime &rt) override {
312
- static_assert(
313
- bridging::getParameterCount(&T::sendDiagnostic) == 1,
314
- "Expected sendDiagnostic(...) to have 1 parameters");
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
- return bridging::callFromJs<jsi::Value>(
317
- rt, &T::sendDiagnostic, jsInvoker_, instance_);
318
- }
319
- jsi::Value getStoreCountry(jsi::Runtime &rt) override {
320
- static_assert(
321
- bridging::getParameterCount(&T::getStoreCountry) == 1,
322
- "Expected getStoreCountry(...) to have 1 parameters");
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
- return bridging::callFromJs<jsi::Value>(
325
- rt, &T::getStoreCountry, jsInvoker_, instance_);
326
- }
327
- jsi::Value isBillingAvailable(jsi::Runtime &rt) override {
328
- static_assert(
329
- bridging::getParameterCount(&T::isBillingAvailable) == 1,
330
- "Expected isBillingAvailable(...) to have 1 parameters");
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
- return bridging::callFromJs<jsi::Value>(
333
- rt, &T::isBillingAvailable, jsInvoker_, instance_);
334
- }
335
- jsi::Value isForwardingEnable(jsi::Runtime &rt, jsi::String externalRef) override {
336
- static_assert(
337
- bridging::getParameterCount(&T::isForwardingEnable) == 2,
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
- return bridging::callFromJs<jsi::Value>(
341
- rt, &T::isForwardingEnable, jsInvoker_, instance_, std::move(externalRef));
342
- }
343
- jsi::Value getCustomer(jsi::Runtime &rt) override {
344
- static_assert(
345
- bridging::getParameterCount(&T::getCustomer) == 1,
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
- return bridging::callFromJs<jsi::Value>(
349
- rt, &T::getCustomer, jsInvoker_, instance_);
350
- }
351
- jsi::Value getSDKVersion(jsi::Runtime &rt) override {
352
- static_assert(
353
- bridging::getParameterCount(&T::getSDKVersion) == 1,
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
- return bridging::callFromJs<jsi::Value>(
357
- rt, &T::getSDKVersion, jsInvoker_, instance_);
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
- private:
361
- friend class NativeMobilyflowReactNativeSdkCxxSpec;
362
- T *instance_;
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
- Delegate delegate_;
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 "generated/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpec.h"
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()