mobilyflow-react-native-sdk 0.0.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/LICENSE +20 -0
- package/MobilyflowReactNativeSdk.podspec +52 -0
- package/README.md +33 -0
- package/android/build.gradle +114 -0
- package/android/generated/java/com/mobilyflowreactnativesdk/NativeMobilyflowReactNativeSdkSpec.java +89 -0
- package/android/generated/jni/CMakeLists.txt +36 -0
- package/android/generated/jni/RNMobilyflowReactNativeSdkSpec-generated.cpp +104 -0
- package/android/generated/jni/RNMobilyflowReactNativeSdkSpec.h +31 -0
- package/android/generated/jni/react/renderer/components/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpecJSI-generated.cpp +124 -0
- package/android/generated/jni/react/renderer/components/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpecJSI.h +287 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/mobilyflowreactnativesdk/MobilyflowReactNativeSdkModule.kt +183 -0
- package/android/src/main/java/com/mobilyflowreactnativesdk/MobilyflowReactNativeSdkPackage.kt +32 -0
- package/android/src/main/java/com/mobilyflowreactnativesdk/ParserUtils.kt +149 -0
- package/ios/MobilyflowReactNativeSdk.h +7 -0
- package/ios/MobilyflowReactNativeSdk.mm +204 -0
- package/ios/Utils/ParserMobilyPurchaseSDKOptions.h +21 -0
- package/ios/Utils/ParserMobilyPurchaseSDKOptions.mm +25 -0
- package/ios/Utils/Utils.h +18 -0
- package/ios/Utils/Utils.m +22 -0
- package/ios/generated/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpec-generated.mm +134 -0
- package/ios/generated/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpec.h +161 -0
- package/ios/generated/RNMobilyflowReactNativeSdkSpecJSI-generated.cpp +124 -0
- package/ios/generated/RNMobilyflowReactNativeSdkSpecJSI.h +287 -0
- package/package.json +183 -0
- package/react-native.config.js +12 -0
- package/src/NativeMobilyflowReactNativeSdk.ts +46 -0
- package/src/entities/mobily-customer-entitlement.ts +37 -0
- package/src/entities/mobily-one-time-product.ts +11 -0
- package/src/entities/mobily-product.ts +34 -0
- package/src/entities/mobily-subscription-group.ts +20 -0
- package/src/entities/mobily-subscription-offer.ts +16 -0
- package/src/entities/mobily-subscription-product.ts +14 -0
- package/src/enums/mobily-environment.ts +5 -0
- package/src/enums/period-unit.ts +5 -0
- package/src/enums/platform.ts +4 -0
- package/src/enums/product-status.ts +5 -0
- package/src/enums/product-type.ts +4 -0
- package/src/enums/webhook-status.ts +5 -0
- package/src/errors/mobily-error.ts +18 -0
- package/src/errors/mobily-purchase-error.ts +30 -0
- package/src/errors/mobily-transfer-ownership-error.ts +20 -0
- package/src/index.tsx +153 -0
- package/src/utils/object-transformer.ts +60 -0
package/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 MobilyFlow
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
12
|
+
copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
+
SOFTWARE.
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require "json"
|
2
|
+
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
4
|
+
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
5
|
+
|
6
|
+
Pod::Spec.new do |s|
|
7
|
+
s.name = "MobilyflowReactNativeSdk"
|
8
|
+
s.version = package["version"]
|
9
|
+
s.summary = package["description"]
|
10
|
+
s.homepage = package["homepage"]
|
11
|
+
s.license = package["license"]
|
12
|
+
s.authors = package["author"]
|
13
|
+
|
14
|
+
s.platforms = { :ios => min_ios_version_supported }
|
15
|
+
s.source = { :git => "https://github.com/MobilyFlow/mobilyflow-react-native-sdk.git", :tag => "#{s.version}" }
|
16
|
+
|
17
|
+
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
18
|
+
s.private_header_files = "ios/generated/**/*.h"
|
19
|
+
|
20
|
+
s.ios.deployment_target = '15.0'
|
21
|
+
s.swift_versions = '5.0'
|
22
|
+
|
23
|
+
# Install MobilyFlow SDK
|
24
|
+
s.dependency 'MobilyflowSDK', '~> 0.0.7'
|
25
|
+
|
26
|
+
#s.subspec 'MobilyflowSDK' do |ss|
|
27
|
+
# ss.source_files = '../mobilyflow-ios-sdk/Sources/MobilyflowSDK/**/*'
|
28
|
+
#end
|
29
|
+
|
30
|
+
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
31
|
+
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
32
|
+
if respond_to?(:install_modules_dependencies, true)
|
33
|
+
install_modules_dependencies(s)
|
34
|
+
else
|
35
|
+
s.dependency "React-Core"
|
36
|
+
|
37
|
+
# Don't install the dependencies when we run `pod install` in the old architecture.
|
38
|
+
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
39
|
+
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
40
|
+
s.pod_target_xcconfig = {
|
41
|
+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
42
|
+
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
43
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
44
|
+
}
|
45
|
+
s.dependency "React-Codegen"
|
46
|
+
s.dependency "RCT-Folly"
|
47
|
+
s.dependency "RCTRequired"
|
48
|
+
s.dependency "RCTTypeSafety"
|
49
|
+
s.dependency "ReactCommon/turbomodule/core"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
package/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# mobilyflow-react-native-sdk
|
2
|
+
|
3
|
+
MobilyFlow React Native SDK
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```sh
|
8
|
+
npm install mobilyflow-react-native-sdk
|
9
|
+
```
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
|
14
|
+
```js
|
15
|
+
import { multiply } from 'mobilyflow-react-native-sdk';
|
16
|
+
|
17
|
+
// ...
|
18
|
+
|
19
|
+
const result = multiply(3, 7);
|
20
|
+
```
|
21
|
+
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
26
|
+
|
27
|
+
## License
|
28
|
+
|
29
|
+
MIT
|
30
|
+
|
31
|
+
---
|
32
|
+
|
33
|
+
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
@@ -0,0 +1,114 @@
|
|
1
|
+
buildscript {
|
2
|
+
ext.getExtOrDefault = {name ->
|
3
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['MobilyflowReactNativeSdk_' + name]
|
4
|
+
}
|
5
|
+
|
6
|
+
repositories {
|
7
|
+
google()
|
8
|
+
mavenCentral()
|
9
|
+
}
|
10
|
+
|
11
|
+
dependencies {
|
12
|
+
classpath "com.android.tools.build:gradle:8.7.3"
|
13
|
+
// noinspection DifferentKotlinGradleVersion
|
14
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
|
19
|
+
def isNewArchitectureEnabled() {
|
20
|
+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
21
|
+
}
|
22
|
+
|
23
|
+
apply plugin: "com.android.library"
|
24
|
+
apply plugin: "kotlin-android"
|
25
|
+
|
26
|
+
if (isNewArchitectureEnabled()) {
|
27
|
+
apply plugin: "com.facebook.react"
|
28
|
+
}
|
29
|
+
|
30
|
+
def getExtOrIntegerDefault(name) {
|
31
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["MobilyflowReactNativeSdk_" + name]).toInteger()
|
32
|
+
}
|
33
|
+
|
34
|
+
def supportsNamespace() {
|
35
|
+
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
|
36
|
+
def major = parsed[0].toInteger()
|
37
|
+
def minor = parsed[1].toInteger()
|
38
|
+
|
39
|
+
// Namespace support was added in 7.3.0
|
40
|
+
return (major == 7 && minor >= 3) || major >= 8
|
41
|
+
}
|
42
|
+
|
43
|
+
android {
|
44
|
+
if (supportsNamespace()) {
|
45
|
+
namespace "com.mobilyflowreactnativesdk"
|
46
|
+
|
47
|
+
sourceSets {
|
48
|
+
main {
|
49
|
+
manifest.srcFile "src/main/AndroidManifestNew.xml"
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
55
|
+
|
56
|
+
defaultConfig {
|
57
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
58
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
59
|
+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
60
|
+
}
|
61
|
+
|
62
|
+
buildFeatures {
|
63
|
+
buildConfig true
|
64
|
+
}
|
65
|
+
|
66
|
+
buildTypes {
|
67
|
+
release {
|
68
|
+
minifyEnabled false
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
lintOptions {
|
73
|
+
disable "GradleCompatible"
|
74
|
+
}
|
75
|
+
|
76
|
+
compileOptions {
|
77
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
78
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
79
|
+
}
|
80
|
+
|
81
|
+
sourceSets {
|
82
|
+
main {
|
83
|
+
if (isNewArchitectureEnabled()) {
|
84
|
+
java.srcDirs += [
|
85
|
+
"generated/java",
|
86
|
+
"generated/jni"
|
87
|
+
]
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
repositories {
|
94
|
+
mavenCentral()
|
95
|
+
google()
|
96
|
+
}
|
97
|
+
|
98
|
+
def kotlin_version = getExtOrDefault("kotlinVersion")
|
99
|
+
|
100
|
+
dependencies {
|
101
|
+
implementation "com.facebook.react:react-android"
|
102
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
103
|
+
implementation "com.mobilyflow:mobilyflow-android-sdk:0.0.3-beta3"
|
104
|
+
implementation "org.jetbrains.kotlinx:kotlinx-datetime:0.6.2"
|
105
|
+
implementation "org.jetbrains.kotlin:kotlin-reflect"
|
106
|
+
}
|
107
|
+
|
108
|
+
if (isNewArchitectureEnabled()) {
|
109
|
+
react {
|
110
|
+
jsRootDir = file("../src/")
|
111
|
+
libraryName = "MobilyflowReactNativeSdk"
|
112
|
+
codegenJavaPackageName = "com.mobilyflowreactnativesdk"
|
113
|
+
}
|
114
|
+
}
|
package/android/generated/java/com/mobilyflowreactnativesdk/NativeMobilyflowReactNativeSdkSpec.java
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
|
2
|
+
/**
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
4
|
+
*
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
6
|
+
* once the code is regenerated.
|
7
|
+
*
|
8
|
+
* @generated by codegen project: GenerateModuleJavaSpec.js
|
9
|
+
*
|
10
|
+
* @nolint
|
11
|
+
*/
|
12
|
+
|
13
|
+
package com.mobilyflowreactnativesdk;
|
14
|
+
|
15
|
+
import com.facebook.proguard.annotations.DoNotStrip;
|
16
|
+
import com.facebook.react.bridge.Promise;
|
17
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
18
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
19
|
+
import com.facebook.react.bridge.ReactMethod;
|
20
|
+
import com.facebook.react.bridge.ReadableArray;
|
21
|
+
import com.facebook.react.bridge.ReadableMap;
|
22
|
+
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
23
|
+
import javax.annotation.Nonnull;
|
24
|
+
import javax.annotation.Nullable;
|
25
|
+
|
26
|
+
public abstract class NativeMobilyflowReactNativeSdkSpec extends ReactContextBaseJavaModule implements TurboModule {
|
27
|
+
public static final String NAME = "MobilyflowReactNativeSdk";
|
28
|
+
|
29
|
+
public NativeMobilyflowReactNativeSdkSpec(ReactApplicationContext reactContext) {
|
30
|
+
super(reactContext);
|
31
|
+
}
|
32
|
+
|
33
|
+
@Override
|
34
|
+
public @Nonnull String getName() {
|
35
|
+
return NAME;
|
36
|
+
}
|
37
|
+
|
38
|
+
@ReactMethod(isBlockingSynchronousMethod = true)
|
39
|
+
@DoNotStrip
|
40
|
+
public abstract String instantiate(String appId, String apiKey, double environment, @Nullable ReadableMap options);
|
41
|
+
|
42
|
+
@ReactMethod
|
43
|
+
@DoNotStrip
|
44
|
+
public abstract void close(String uuid);
|
45
|
+
|
46
|
+
@ReactMethod
|
47
|
+
@DoNotStrip
|
48
|
+
public abstract void login(String uuid, String externalId, Promise promise);
|
49
|
+
|
50
|
+
@ReactMethod
|
51
|
+
@DoNotStrip
|
52
|
+
public abstract void getProducts(String uuid, @Nullable ReadableArray identifiers, Promise promise);
|
53
|
+
|
54
|
+
@ReactMethod
|
55
|
+
@DoNotStrip
|
56
|
+
public abstract void getSubscriptionGroups(String uuid, @Nullable ReadableArray identifiers, Promise promise);
|
57
|
+
|
58
|
+
@ReactMethod
|
59
|
+
@DoNotStrip
|
60
|
+
public abstract void getEntitlementForSubscription(String uuid, String subscriptionGroupId, Promise promise);
|
61
|
+
|
62
|
+
@ReactMethod
|
63
|
+
@DoNotStrip
|
64
|
+
public abstract void getEntitlement(String uuid, String productId, Promise promise);
|
65
|
+
|
66
|
+
@ReactMethod
|
67
|
+
@DoNotStrip
|
68
|
+
public abstract void getEntitlements(String uuid, ReadableArray productIds, Promise promise);
|
69
|
+
|
70
|
+
@ReactMethod
|
71
|
+
@DoNotStrip
|
72
|
+
public abstract void requestTransferOwnership(String uuid, Promise promise);
|
73
|
+
|
74
|
+
@ReactMethod
|
75
|
+
@DoNotStrip
|
76
|
+
public abstract void openManageSubscription(String uuid, Promise promise);
|
77
|
+
|
78
|
+
@ReactMethod
|
79
|
+
@DoNotStrip
|
80
|
+
public abstract void purchaseProduct(String uuid, String productId, @Nullable ReadableMap options, Promise promise);
|
81
|
+
|
82
|
+
@ReactMethod
|
83
|
+
@DoNotStrip
|
84
|
+
public abstract void sendDiagnotic(String uuid);
|
85
|
+
|
86
|
+
@ReactMethod
|
87
|
+
@DoNotStrip
|
88
|
+
public abstract void getStoreCountry(String uuid, Promise promise);
|
89
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
2
|
+
#
|
3
|
+
# This source code is licensed under the MIT license found in the
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
5
|
+
|
6
|
+
cmake_minimum_required(VERSION 3.13)
|
7
|
+
set(CMAKE_VERBOSE_MAKEFILE on)
|
8
|
+
|
9
|
+
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNMobilyflowReactNativeSdkSpec/*.cpp)
|
10
|
+
|
11
|
+
add_library(
|
12
|
+
react_codegen_RNMobilyflowReactNativeSdkSpec
|
13
|
+
OBJECT
|
14
|
+
${react_codegen_SRCS}
|
15
|
+
)
|
16
|
+
|
17
|
+
target_include_directories(react_codegen_RNMobilyflowReactNativeSdkSpec PUBLIC . react/renderer/components/RNMobilyflowReactNativeSdkSpec)
|
18
|
+
|
19
|
+
target_link_libraries(
|
20
|
+
react_codegen_RNMobilyflowReactNativeSdkSpec
|
21
|
+
fbjni
|
22
|
+
jsi
|
23
|
+
# We need to link different libraries based on whether we are building rncore or not, that's necessary
|
24
|
+
# because we want to break a circular dependency between react_codegen_rncore and reactnative
|
25
|
+
reactnative
|
26
|
+
)
|
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
|
+
)
|
@@ -0,0 +1,104 @@
|
|
1
|
+
|
2
|
+
/**
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
4
|
+
*
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
6
|
+
* once the code is regenerated.
|
7
|
+
*
|
8
|
+
* @generated by codegen project: GenerateModuleJniCpp.js
|
9
|
+
*/
|
10
|
+
|
11
|
+
#include "RNMobilyflowReactNativeSdkSpec.h"
|
12
|
+
|
13
|
+
namespace facebook::react {
|
14
|
+
|
15
|
+
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_instantiate(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
16
|
+
static jmethodID cachedMethodId = nullptr;
|
17
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, StringKind, "instantiate", "(Ljava/lang/String;Ljava/lang/String;DLcom/facebook/react/bridge/ReadableMap;)Ljava/lang/String;", args, count, cachedMethodId);
|
18
|
+
}
|
19
|
+
|
20
|
+
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_close(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
21
|
+
static jmethodID cachedMethodId = nullptr;
|
22
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "close", "(Ljava/lang/String;)V", args, count, cachedMethodId);
|
23
|
+
}
|
24
|
+
|
25
|
+
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_login(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
26
|
+
static jmethodID cachedMethodId = nullptr;
|
27
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "login", "(Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
28
|
+
}
|
29
|
+
|
30
|
+
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_getProducts(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
31
|
+
static jmethodID cachedMethodId = nullptr;
|
32
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "getProducts", "(Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
33
|
+
}
|
34
|
+
|
35
|
+
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_getSubscriptionGroups(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
36
|
+
static jmethodID cachedMethodId = nullptr;
|
37
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "getSubscriptionGroups", "(Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
38
|
+
}
|
39
|
+
|
40
|
+
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_getEntitlementForSubscription(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
41
|
+
static jmethodID cachedMethodId = nullptr;
|
42
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "getEntitlementForSubscription", "(Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
43
|
+
}
|
44
|
+
|
45
|
+
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_getEntitlement(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
46
|
+
static jmethodID cachedMethodId = nullptr;
|
47
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "getEntitlement", "(Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
48
|
+
}
|
49
|
+
|
50
|
+
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_getEntitlements(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
51
|
+
static jmethodID cachedMethodId = nullptr;
|
52
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "getEntitlements", "(Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
53
|
+
}
|
54
|
+
|
55
|
+
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_requestTransferOwnership(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
56
|
+
static jmethodID cachedMethodId = nullptr;
|
57
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "requestTransferOwnership", "(Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
58
|
+
}
|
59
|
+
|
60
|
+
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_openManageSubscription(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
61
|
+
static jmethodID cachedMethodId = nullptr;
|
62
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "openManageSubscription", "(Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
63
|
+
}
|
64
|
+
|
65
|
+
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_purchaseProduct(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
66
|
+
static jmethodID cachedMethodId = nullptr;
|
67
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "purchaseProduct", "(Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
68
|
+
}
|
69
|
+
|
70
|
+
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_sendDiagnotic(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
71
|
+
static jmethodID cachedMethodId = nullptr;
|
72
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "sendDiagnotic", "(Ljava/lang/String;)V", args, count, cachedMethodId);
|
73
|
+
}
|
74
|
+
|
75
|
+
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_getStoreCountry(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
76
|
+
static jmethodID cachedMethodId = nullptr;
|
77
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "getStoreCountry", "(Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
78
|
+
}
|
79
|
+
|
80
|
+
NativeMobilyflowReactNativeSdkSpecJSI::NativeMobilyflowReactNativeSdkSpecJSI(const JavaTurboModule::InitParams ¶ms)
|
81
|
+
: JavaTurboModule(params) {
|
82
|
+
methodMap_["instantiate"] = MethodMetadata {4, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_instantiate};
|
83
|
+
methodMap_["close"] = MethodMetadata {1, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_close};
|
84
|
+
methodMap_["login"] = MethodMetadata {2, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_login};
|
85
|
+
methodMap_["getProducts"] = MethodMetadata {2, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_getProducts};
|
86
|
+
methodMap_["getSubscriptionGroups"] = MethodMetadata {2, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_getSubscriptionGroups};
|
87
|
+
methodMap_["getEntitlementForSubscription"] = MethodMetadata {2, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_getEntitlementForSubscription};
|
88
|
+
methodMap_["getEntitlement"] = MethodMetadata {2, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_getEntitlement};
|
89
|
+
methodMap_["getEntitlements"] = MethodMetadata {2, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_getEntitlements};
|
90
|
+
methodMap_["requestTransferOwnership"] = MethodMetadata {1, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_requestTransferOwnership};
|
91
|
+
methodMap_["openManageSubscription"] = MethodMetadata {1, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_openManageSubscription};
|
92
|
+
methodMap_["purchaseProduct"] = MethodMetadata {3, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_purchaseProduct};
|
93
|
+
methodMap_["sendDiagnotic"] = MethodMetadata {1, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_sendDiagnotic};
|
94
|
+
methodMap_["getStoreCountry"] = MethodMetadata {1, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_getStoreCountry};
|
95
|
+
}
|
96
|
+
|
97
|
+
std::shared_ptr<TurboModule> RNMobilyflowReactNativeSdkSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) {
|
98
|
+
if (moduleName == "MobilyflowReactNativeSdk") {
|
99
|
+
return std::make_shared<NativeMobilyflowReactNativeSdkSpecJSI>(params);
|
100
|
+
}
|
101
|
+
return nullptr;
|
102
|
+
}
|
103
|
+
|
104
|
+
} // namespace facebook::react
|
@@ -0,0 +1,31 @@
|
|
1
|
+
|
2
|
+
/**
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
4
|
+
*
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
6
|
+
* once the code is regenerated.
|
7
|
+
*
|
8
|
+
* @generated by codegen project: GenerateModuleJniH.js
|
9
|
+
*/
|
10
|
+
|
11
|
+
#pragma once
|
12
|
+
|
13
|
+
#include <ReactCommon/JavaTurboModule.h>
|
14
|
+
#include <ReactCommon/TurboModule.h>
|
15
|
+
#include <jsi/jsi.h>
|
16
|
+
|
17
|
+
namespace facebook::react {
|
18
|
+
|
19
|
+
/**
|
20
|
+
* JNI C++ class for module 'NativeMobilyflowReactNativeSdk'
|
21
|
+
*/
|
22
|
+
class JSI_EXPORT NativeMobilyflowReactNativeSdkSpecJSI : public JavaTurboModule {
|
23
|
+
public:
|
24
|
+
NativeMobilyflowReactNativeSdkSpecJSI(const JavaTurboModule::InitParams ¶ms);
|
25
|
+
};
|
26
|
+
|
27
|
+
|
28
|
+
JSI_EXPORT
|
29
|
+
std::shared_ptr<TurboModule> RNMobilyflowReactNativeSdkSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms);
|
30
|
+
|
31
|
+
} // namespace facebook::react
|
@@ -0,0 +1,124 @@
|
|
1
|
+
/**
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
3
|
+
*
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
5
|
+
* once the code is regenerated.
|
6
|
+
*
|
7
|
+
* @generated by codegen project: GenerateModuleCpp.js
|
8
|
+
*/
|
9
|
+
|
10
|
+
#include "RNMobilyflowReactNativeSdkSpecJSI.h"
|
11
|
+
|
12
|
+
namespace facebook::react {
|
13
|
+
|
14
|
+
static jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_instantiate(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
15
|
+
return static_cast<NativeMobilyflowReactNativeSdkCxxSpecJSI *>(&turboModule)->instantiate(
|
16
|
+
rt,
|
17
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
18
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
19
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
|
20
|
+
count <= 3 || args[3].isUndefined() ? std::nullopt : std::make_optional(args[3].asObject(rt))
|
21
|
+
);
|
22
|
+
}
|
23
|
+
static jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_close(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
24
|
+
static_cast<NativeMobilyflowReactNativeSdkCxxSpecJSI *>(&turboModule)->close(
|
25
|
+
rt,
|
26
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
27
|
+
);
|
28
|
+
return jsi::Value::undefined();
|
29
|
+
}
|
30
|
+
static jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_login(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
31
|
+
return static_cast<NativeMobilyflowReactNativeSdkCxxSpecJSI *>(&turboModule)->login(
|
32
|
+
rt,
|
33
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
34
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt)
|
35
|
+
);
|
36
|
+
}
|
37
|
+
static jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_getProducts(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
38
|
+
return static_cast<NativeMobilyflowReactNativeSdkCxxSpecJSI *>(&turboModule)->getProducts(
|
39
|
+
rt,
|
40
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
41
|
+
count <= 1 || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asObject(rt).asArray(rt))
|
42
|
+
);
|
43
|
+
}
|
44
|
+
static jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_getSubscriptionGroups(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
45
|
+
return static_cast<NativeMobilyflowReactNativeSdkCxxSpecJSI *>(&turboModule)->getSubscriptionGroups(
|
46
|
+
rt,
|
47
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
48
|
+
count <= 1 || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asObject(rt).asArray(rt))
|
49
|
+
);
|
50
|
+
}
|
51
|
+
static jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_getEntitlementForSubscription(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
52
|
+
return static_cast<NativeMobilyflowReactNativeSdkCxxSpecJSI *>(&turboModule)->getEntitlementForSubscription(
|
53
|
+
rt,
|
54
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
55
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt)
|
56
|
+
);
|
57
|
+
}
|
58
|
+
static jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_getEntitlement(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
59
|
+
return static_cast<NativeMobilyflowReactNativeSdkCxxSpecJSI *>(&turboModule)->getEntitlement(
|
60
|
+
rt,
|
61
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
62
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt)
|
63
|
+
);
|
64
|
+
}
|
65
|
+
static jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_getEntitlements(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
66
|
+
return static_cast<NativeMobilyflowReactNativeSdkCxxSpecJSI *>(&turboModule)->getEntitlements(
|
67
|
+
rt,
|
68
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
69
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt).asArray(rt)
|
70
|
+
);
|
71
|
+
}
|
72
|
+
static jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_requestTransferOwnership(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
73
|
+
return static_cast<NativeMobilyflowReactNativeSdkCxxSpecJSI *>(&turboModule)->requestTransferOwnership(
|
74
|
+
rt,
|
75
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
76
|
+
);
|
77
|
+
}
|
78
|
+
static jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_openManageSubscription(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
79
|
+
return static_cast<NativeMobilyflowReactNativeSdkCxxSpecJSI *>(&turboModule)->openManageSubscription(
|
80
|
+
rt,
|
81
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
82
|
+
);
|
83
|
+
}
|
84
|
+
static jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_purchaseProduct(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
85
|
+
return static_cast<NativeMobilyflowReactNativeSdkCxxSpecJSI *>(&turboModule)->purchaseProduct(
|
86
|
+
rt,
|
87
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
88
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
89
|
+
count <= 2 || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asObject(rt))
|
90
|
+
);
|
91
|
+
}
|
92
|
+
static jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_sendDiagnotic(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
93
|
+
static_cast<NativeMobilyflowReactNativeSdkCxxSpecJSI *>(&turboModule)->sendDiagnotic(
|
94
|
+
rt,
|
95
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
96
|
+
);
|
97
|
+
return jsi::Value::undefined();
|
98
|
+
}
|
99
|
+
static jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_getStoreCountry(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
100
|
+
return static_cast<NativeMobilyflowReactNativeSdkCxxSpecJSI *>(&turboModule)->getStoreCountry(
|
101
|
+
rt,
|
102
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
103
|
+
);
|
104
|
+
}
|
105
|
+
|
106
|
+
NativeMobilyflowReactNativeSdkCxxSpecJSI::NativeMobilyflowReactNativeSdkCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
|
107
|
+
: TurboModule("MobilyflowReactNativeSdk", jsInvoker) {
|
108
|
+
methodMap_["instantiate"] = MethodMetadata {4, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_instantiate};
|
109
|
+
methodMap_["close"] = MethodMetadata {1, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_close};
|
110
|
+
methodMap_["login"] = MethodMetadata {2, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_login};
|
111
|
+
methodMap_["getProducts"] = MethodMetadata {2, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_getProducts};
|
112
|
+
methodMap_["getSubscriptionGroups"] = MethodMetadata {2, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_getSubscriptionGroups};
|
113
|
+
methodMap_["getEntitlementForSubscription"] = MethodMetadata {2, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_getEntitlementForSubscription};
|
114
|
+
methodMap_["getEntitlement"] = MethodMetadata {2, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_getEntitlement};
|
115
|
+
methodMap_["getEntitlements"] = MethodMetadata {2, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_getEntitlements};
|
116
|
+
methodMap_["requestTransferOwnership"] = MethodMetadata {1, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_requestTransferOwnership};
|
117
|
+
methodMap_["openManageSubscription"] = MethodMetadata {1, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_openManageSubscription};
|
118
|
+
methodMap_["purchaseProduct"] = MethodMetadata {3, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_purchaseProduct};
|
119
|
+
methodMap_["sendDiagnotic"] = MethodMetadata {1, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_sendDiagnotic};
|
120
|
+
methodMap_["getStoreCountry"] = MethodMetadata {1, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_getStoreCountry};
|
121
|
+
}
|
122
|
+
|
123
|
+
|
124
|
+
} // namespace facebook::react
|