mobilyflow-react-native-sdk 0.1.1-alpha.1 → 0.1.1-alpha.12
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/MobilyflowReactNativeSdk.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/generated/java/com/mobilyflowreactnativesdk/NativeMobilyflowReactNativeSdkSpec.java +3 -3
- package/android/generated/jni/RNMobilyflowReactNativeSdkSpec-generated.cpp +2 -2
- package/android/generated/jni/react/renderer/components/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpecJSI-generated.cpp +3 -2
- package/android/generated/jni/react/renderer/components/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpecJSI.h +11 -11
- package/android/src/main/java/com/mobilyflowreactnativesdk/MobilyflowReactNativeSdkModule.kt +7 -7
- package/ios/MobilyflowReactNativeSdk.mm +45 -50
- package/ios/Utils/ParserMobilyPurchaseSDKOptions.mm +1 -1
- package/ios/generated/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpec-generated.mm +4 -4
- package/ios/generated/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpec.h +3 -2
- package/ios/generated/RNMobilyflowReactNativeSdkSpecJSI-generated.cpp +3 -2
- package/ios/generated/RNMobilyflowReactNativeSdkSpecJSI.h +11 -11
- package/lib/commonjs/MobilyPurchaseSDK.js +8 -6
- package/lib/commonjs/MobilyPurchaseSDK.js.map +1 -1
- package/lib/commonjs/NativeMobilyflowReactNativeSdk.js.map +1 -1
- package/lib/commonjs/entities/mobily-customer.js +16 -0
- package/lib/commonjs/entities/mobily-customer.js.map +1 -0
- package/lib/commonjs/entities/mobily-product.js.map +1 -1
- package/lib/commonjs/entities/mobily-subscription-offer.js.map +1 -1
- package/lib/commonjs/errors/mobily-purchase-error.js +10 -8
- package/lib/commonjs/errors/mobily-purchase-error.js.map +1 -1
- package/lib/module/MobilyPurchaseSDK.js +8 -6
- package/lib/module/MobilyPurchaseSDK.js.map +1 -1
- package/lib/module/NativeMobilyflowReactNativeSdk.js.map +1 -1
- package/lib/module/entities/mobily-customer.js +11 -0
- package/lib/module/entities/mobily-customer.js.map +1 -0
- package/lib/module/entities/mobily-product.js.map +1 -1
- package/lib/module/errors/mobily-purchase-error.js +10 -8
- package/lib/module/errors/mobily-purchase-error.js.map +1 -1
- package/lib/typescript/commonjs/src/MobilyPurchaseSDK.d.ts +4 -3
- package/lib/typescript/commonjs/src/MobilyPurchaseSDK.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/NativeMobilyflowReactNativeSdk.d.ts +4 -3
- package/lib/typescript/commonjs/src/NativeMobilyflowReactNativeSdk.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/entities/mobily-customer.d.ts +9 -0
- package/lib/typescript/commonjs/src/entities/mobily-customer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/entities/mobily-product.d.ts +1 -0
- package/lib/typescript/commonjs/src/entities/mobily-product.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/entities/mobily-subscription-offer.d.ts +4 -1
- package/lib/typescript/commonjs/src/entities/mobily-subscription-offer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/errors/mobily-purchase-error.d.ts +10 -8
- package/lib/typescript/commonjs/src/errors/mobily-purchase-error.d.ts.map +1 -1
- package/lib/typescript/module/src/MobilyPurchaseSDK.d.ts +4 -3
- package/lib/typescript/module/src/MobilyPurchaseSDK.d.ts.map +1 -1
- package/lib/typescript/module/src/NativeMobilyflowReactNativeSdk.d.ts +4 -3
- package/lib/typescript/module/src/NativeMobilyflowReactNativeSdk.d.ts.map +1 -1
- package/lib/typescript/module/src/entities/mobily-customer.d.ts +9 -0
- package/lib/typescript/module/src/entities/mobily-customer.d.ts.map +1 -0
- package/lib/typescript/module/src/entities/mobily-product.d.ts +1 -0
- package/lib/typescript/module/src/entities/mobily-product.d.ts.map +1 -1
- package/lib/typescript/module/src/entities/mobily-subscription-offer.d.ts +4 -1
- package/lib/typescript/module/src/entities/mobily-subscription-offer.d.ts.map +1 -1
- package/lib/typescript/module/src/errors/mobily-purchase-error.d.ts +10 -8
- package/lib/typescript/module/src/errors/mobily-purchase-error.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/MobilyPurchaseSDK.tsx +8 -6
- package/src/NativeMobilyflowReactNativeSdk.ts +4 -3
- package/src/entities/mobily-customer.ts +13 -0
- package/src/entities/mobily-product.ts +1 -0
- package/src/entities/mobily-subscription-offer.ts +4 -1
- package/src/errors/mobily-purchase-error.ts +4 -2
@@ -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.1.1-alpha.
|
24
|
+
s.dependency 'MobilyflowSDK', '0.1.1-alpha.11'
|
25
25
|
|
26
26
|
#s.subspec 'MobilyflowSDK' do |ss|
|
27
27
|
# ss.source_files = '../mobilyflow-ios-sdk/Sources/MobilyflowSDK/**/*'
|
package/android/build.gradle
CHANGED
@@ -100,7 +100,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
100
100
|
dependencies {
|
101
101
|
implementation "com.facebook.react:react-android"
|
102
102
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
103
|
-
implementation "com.mobilyflow:mobilyflow-android-sdk:0.1.1-alpha.
|
103
|
+
implementation "com.mobilyflow:mobilyflow-android-sdk:0.1.1-alpha.12"
|
104
104
|
implementation "org.jetbrains.kotlinx:kotlinx-datetime:0.6.2"
|
105
105
|
implementation "org.jetbrains.kotlin:kotlin-reflect"
|
106
106
|
}
|
package/android/generated/java/com/mobilyflowreactnativesdk/NativeMobilyflowReactNativeSdkSpec.java
CHANGED
@@ -45,7 +45,7 @@ public abstract class NativeMobilyflowReactNativeSdkSpec extends ReactContextBas
|
|
45
45
|
|
46
46
|
@ReactMethod
|
47
47
|
@DoNotStrip
|
48
|
-
public abstract void login(String uuid, String
|
48
|
+
public abstract void login(String uuid, String externalRef, Promise promise);
|
49
49
|
|
50
50
|
@ReactMethod
|
51
51
|
@DoNotStrip
|
@@ -77,7 +77,7 @@ public abstract class NativeMobilyflowReactNativeSdkSpec extends ReactContextBas
|
|
77
77
|
|
78
78
|
@ReactMethod
|
79
79
|
@DoNotStrip
|
80
|
-
public abstract void openRefundDialog(String uuid, String
|
80
|
+
public abstract void openRefundDialog(String uuid, String productId, Promise promise);
|
81
81
|
|
82
82
|
@ReactMethod
|
83
83
|
@DoNotStrip
|
@@ -93,5 +93,5 @@ public abstract class NativeMobilyflowReactNativeSdkSpec extends ReactContextBas
|
|
93
93
|
|
94
94
|
@ReactMethod
|
95
95
|
@DoNotStrip
|
96
|
-
public abstract void isForwardingEnable(String uuid, Promise promise);
|
96
|
+
public abstract void isForwardingEnable(String uuid, String externalRef, Promise promise);
|
97
97
|
}
|
@@ -84,7 +84,7 @@ static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI
|
|
84
84
|
|
85
85
|
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_isForwardingEnable(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
86
86
|
static jmethodID cachedMethodId = nullptr;
|
87
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "isForwardingEnable", "(Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
87
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "isForwardingEnable", "(Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
88
88
|
}
|
89
89
|
|
90
90
|
NativeMobilyflowReactNativeSdkSpecJSI::NativeMobilyflowReactNativeSdkSpecJSI(const JavaTurboModule::InitParams ¶ms)
|
@@ -103,7 +103,7 @@ NativeMobilyflowReactNativeSdkSpecJSI::NativeMobilyflowReactNativeSdkSpecJSI(con
|
|
103
103
|
methodMap_["purchaseProduct"] = MethodMetadata {3, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_purchaseProduct};
|
104
104
|
methodMap_["sendDiagnotic"] = MethodMetadata {1, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_sendDiagnotic};
|
105
105
|
methodMap_["getStoreCountry"] = MethodMetadata {1, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_getStoreCountry};
|
106
|
-
methodMap_["isForwardingEnable"] = MethodMetadata {
|
106
|
+
methodMap_["isForwardingEnable"] = MethodMetadata {2, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_isForwardingEnable};
|
107
107
|
}
|
108
108
|
|
109
109
|
std::shared_ptr<TurboModule> RNMobilyflowReactNativeSdkSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) {
|
@@ -114,7 +114,8 @@ static jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_getSto
|
|
114
114
|
static jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_isForwardingEnable(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
115
115
|
return static_cast<NativeMobilyflowReactNativeSdkCxxSpecJSI *>(&turboModule)->isForwardingEnable(
|
116
116
|
rt,
|
117
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
117
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
118
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt)
|
118
119
|
);
|
119
120
|
}
|
120
121
|
|
@@ -134,7 +135,7 @@ NativeMobilyflowReactNativeSdkCxxSpecJSI::NativeMobilyflowReactNativeSdkCxxSpecJ
|
|
134
135
|
methodMap_["purchaseProduct"] = MethodMetadata {3, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_purchaseProduct};
|
135
136
|
methodMap_["sendDiagnotic"] = MethodMetadata {1, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_sendDiagnotic};
|
136
137
|
methodMap_["getStoreCountry"] = MethodMetadata {1, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_getStoreCountry};
|
137
|
-
methodMap_["isForwardingEnable"] = MethodMetadata {
|
138
|
+
methodMap_["isForwardingEnable"] = MethodMetadata {2, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_isForwardingEnable};
|
138
139
|
}
|
139
140
|
|
140
141
|
|
@@ -130,7 +130,7 @@ protected:
|
|
130
130
|
public:
|
131
131
|
virtual jsi::String instantiate(jsi::Runtime &rt, jsi::String appId, jsi::String apiKey, double environment, std::optional<jsi::Object> options) = 0;
|
132
132
|
virtual void close(jsi::Runtime &rt, jsi::String uuid) = 0;
|
133
|
-
virtual jsi::Value login(jsi::Runtime &rt, jsi::String uuid, jsi::String
|
133
|
+
virtual jsi::Value login(jsi::Runtime &rt, jsi::String uuid, jsi::String externalRef) = 0;
|
134
134
|
virtual jsi::Value getProducts(jsi::Runtime &rt, jsi::String uuid, jsi::Array identifiers, bool onlyAvailable) = 0;
|
135
135
|
virtual jsi::Value getSubscriptionGroups(jsi::Runtime &rt, jsi::String uuid, jsi::Array identifiers, bool onlyAvailable) = 0;
|
136
136
|
virtual jsi::Value getEntitlementForSubscription(jsi::Runtime &rt, jsi::String uuid, jsi::String subscriptionGroupId) = 0;
|
@@ -138,11 +138,11 @@ public:
|
|
138
138
|
virtual jsi::Value getEntitlements(jsi::Runtime &rt, jsi::String uuid, jsi::Array productIds) = 0;
|
139
139
|
virtual jsi::Value requestTransferOwnership(jsi::Runtime &rt, jsi::String uuid) = 0;
|
140
140
|
virtual jsi::Value openManageSubscription(jsi::Runtime &rt, jsi::String uuid) = 0;
|
141
|
-
virtual jsi::Value openRefundDialog(jsi::Runtime &rt, jsi::String uuid, jsi::String
|
141
|
+
virtual jsi::Value openRefundDialog(jsi::Runtime &rt, jsi::String uuid, jsi::String productId) = 0;
|
142
142
|
virtual jsi::Value purchaseProduct(jsi::Runtime &rt, jsi::String uuid, jsi::String productId, std::optional<jsi::Object> options) = 0;
|
143
143
|
virtual void sendDiagnotic(jsi::Runtime &rt, jsi::String uuid) = 0;
|
144
144
|
virtual jsi::Value getStoreCountry(jsi::Runtime &rt, jsi::String uuid) = 0;
|
145
|
-
virtual jsi::Value isForwardingEnable(jsi::Runtime &rt, jsi::String uuid) = 0;
|
145
|
+
virtual jsi::Value isForwardingEnable(jsi::Runtime &rt, jsi::String uuid, jsi::String externalRef) = 0;
|
146
146
|
|
147
147
|
};
|
148
148
|
|
@@ -189,13 +189,13 @@ private:
|
|
189
189
|
return bridging::callFromJs<void>(
|
190
190
|
rt, &T::close, jsInvoker_, instance_, std::move(uuid));
|
191
191
|
}
|
192
|
-
jsi::Value login(jsi::Runtime &rt, jsi::String uuid, jsi::String
|
192
|
+
jsi::Value login(jsi::Runtime &rt, jsi::String uuid, jsi::String externalRef) override {
|
193
193
|
static_assert(
|
194
194
|
bridging::getParameterCount(&T::login) == 3,
|
195
195
|
"Expected login(...) to have 3 parameters");
|
196
196
|
|
197
197
|
return bridging::callFromJs<jsi::Value>(
|
198
|
-
rt, &T::login, jsInvoker_, instance_, std::move(uuid), std::move(
|
198
|
+
rt, &T::login, jsInvoker_, instance_, std::move(uuid), std::move(externalRef));
|
199
199
|
}
|
200
200
|
jsi::Value getProducts(jsi::Runtime &rt, jsi::String uuid, jsi::Array identifiers, bool onlyAvailable) override {
|
201
201
|
static_assert(
|
@@ -253,13 +253,13 @@ private:
|
|
253
253
|
return bridging::callFromJs<jsi::Value>(
|
254
254
|
rt, &T::openManageSubscription, jsInvoker_, instance_, std::move(uuid));
|
255
255
|
}
|
256
|
-
jsi::Value openRefundDialog(jsi::Runtime &rt, jsi::String uuid, jsi::String
|
256
|
+
jsi::Value openRefundDialog(jsi::Runtime &rt, jsi::String uuid, jsi::String productId) override {
|
257
257
|
static_assert(
|
258
258
|
bridging::getParameterCount(&T::openRefundDialog) == 3,
|
259
259
|
"Expected openRefundDialog(...) to have 3 parameters");
|
260
260
|
|
261
261
|
return bridging::callFromJs<jsi::Value>(
|
262
|
-
rt, &T::openRefundDialog, jsInvoker_, instance_, std::move(uuid), std::move(
|
262
|
+
rt, &T::openRefundDialog, jsInvoker_, instance_, std::move(uuid), std::move(productId));
|
263
263
|
}
|
264
264
|
jsi::Value purchaseProduct(jsi::Runtime &rt, jsi::String uuid, jsi::String productId, std::optional<jsi::Object> options) override {
|
265
265
|
static_assert(
|
@@ -285,13 +285,13 @@ private:
|
|
285
285
|
return bridging::callFromJs<jsi::Value>(
|
286
286
|
rt, &T::getStoreCountry, jsInvoker_, instance_, std::move(uuid));
|
287
287
|
}
|
288
|
-
jsi::Value isForwardingEnable(jsi::Runtime &rt, jsi::String uuid) override {
|
288
|
+
jsi::Value isForwardingEnable(jsi::Runtime &rt, jsi::String uuid, jsi::String externalRef) override {
|
289
289
|
static_assert(
|
290
|
-
bridging::getParameterCount(&T::isForwardingEnable) ==
|
291
|
-
"Expected isForwardingEnable(...) to have
|
290
|
+
bridging::getParameterCount(&T::isForwardingEnable) == 3,
|
291
|
+
"Expected isForwardingEnable(...) to have 3 parameters");
|
292
292
|
|
293
293
|
return bridging::callFromJs<jsi::Value>(
|
294
|
-
rt, &T::isForwardingEnable, jsInvoker_, instance_, std::move(uuid));
|
294
|
+
rt, &T::isForwardingEnable, jsInvoker_, instance_, std::move(uuid), std::move(externalRef));
|
295
295
|
}
|
296
296
|
|
297
297
|
private:
|
package/android/src/main/java/com/mobilyflowreactnativesdk/MobilyflowReactNativeSdkModule.kt
CHANGED
@@ -54,10 +54,10 @@ class MobilyflowReactNativeSdkModule(reactContext: ReactApplicationContext) : Na
|
|
54
54
|
_sdkInstances[uuid]!!.close()
|
55
55
|
}
|
56
56
|
|
57
|
-
override fun login(uuid: String,
|
57
|
+
override fun login(uuid: String, externalRef: String, promise: Promise) {
|
58
58
|
try {
|
59
|
-
_sdkInstances[uuid]!!.login(
|
60
|
-
promise.resolve(
|
59
|
+
val customer = _sdkInstances[uuid]!!.login(externalRef)
|
60
|
+
promise.resolve(customer.toReadableMap())
|
61
61
|
} catch (error: Exception) {
|
62
62
|
throwError(error, promise)
|
63
63
|
}
|
@@ -126,7 +126,7 @@ class MobilyflowReactNativeSdkModule(reactContext: ReactApplicationContext) : Na
|
|
126
126
|
}
|
127
127
|
}
|
128
128
|
|
129
|
-
override fun openRefundDialog(uuid: String,
|
129
|
+
override fun openRefundDialog(uuid: String, productId: String, promise: Promise) {
|
130
130
|
promise.reject("-1", "Not implemented")
|
131
131
|
}
|
132
132
|
|
@@ -141,7 +141,7 @@ class MobilyflowReactNativeSdkModule(reactContext: ReactApplicationContext) : Na
|
|
141
141
|
val purchaseOptions = PurchaseOptions()
|
142
142
|
val offerId = options?.getString("offerId")
|
143
143
|
|
144
|
-
val product = sdk.
|
144
|
+
val product = sdk.getProductFromCacheWithId(productId)
|
145
145
|
if (product == null) {
|
146
146
|
throw MobilyPurchaseException(MobilyPurchaseException.Type.PRODUCT_UNAVAILABLE)
|
147
147
|
}
|
@@ -174,8 +174,8 @@ class MobilyflowReactNativeSdkModule(reactContext: ReactApplicationContext) : Na
|
|
174
174
|
promise.reject("-1", "Not implemented")
|
175
175
|
}
|
176
176
|
|
177
|
-
override fun isForwardingEnable(uuid: String, promise: Promise) {
|
178
|
-
promise.resolve(_sdkInstances[uuid]!!.isForwardingEnable())
|
177
|
+
override fun isForwardingEnable(uuid: String, externalRef: String, promise: Promise) {
|
178
|
+
promise.resolve(_sdkInstances[uuid]!!.isForwardingEnable(externalRef))
|
179
179
|
}
|
180
180
|
|
181
181
|
companion object {
|
@@ -45,12 +45,12 @@ RCT_EXPORT_MODULE()
|
|
45
45
|
return [[self getInstance:uuid] close];
|
46
46
|
}
|
47
47
|
|
48
|
-
- (void)login:(NSString *)uuid
|
49
|
-
[[self getInstance:uuid]
|
48
|
+
- (void)login:(NSString *)uuid externalRef:(NSString *)externalRef resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
49
|
+
[[self getInstance:uuid] loginWithExternalRef:externalRef completionHandler:^(MobilyCustomer * _Nullable customer, NSError * _Nullable error) {
|
50
50
|
if (error) {
|
51
51
|
reject([NSString stringWithFormat:@"%ld", error.code], error.description, error);
|
52
52
|
} else {
|
53
|
-
resolve(
|
53
|
+
resolve([customer toDictionary]);
|
54
54
|
}
|
55
55
|
}];
|
56
56
|
}
|
@@ -133,9 +133,14 @@ RCT_EXPORT_MODULE()
|
|
133
133
|
}];
|
134
134
|
}
|
135
135
|
|
136
|
-
- (void)openRefundDialog:(NSString *)uuid
|
137
|
-
|
138
|
-
|
136
|
+
- (void)openRefundDialog:(NSString *)uuid productId:(NSString *)productId resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
137
|
+
MobilyProduct* product = [[self getInstance:uuid] getProductFromCacheWithIdWithId:productId];
|
138
|
+
if (product == nil) {
|
139
|
+
reject(@"3", @"MobilyflowSDK.MobilyError.unknown_error", [NSError errorWithDomain:@"MobilyflowSDK.MobilyError" code:3 userInfo:nil]);
|
140
|
+
return;
|
141
|
+
}
|
142
|
+
|
143
|
+
[[self getInstance:uuid] openRefundDialogWithProduct:product completionHandler:^(enum RefundDialogResult result) {
|
139
144
|
resolve([NSNumber numberWithBool:result]);
|
140
145
|
}];
|
141
146
|
}
|
@@ -143,56 +148,41 @@ RCT_EXPORT_MODULE()
|
|
143
148
|
- (void)purchaseProduct:(NSString *)uuid productId:(NSString *)productId options:(JS::NativeMobilyflowReactNativeSdk::PurchaseOptions &)options resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
144
149
|
|
145
150
|
MobilyPurchaseSDK* sdk = [self getInstance:uuid];
|
151
|
+
|
152
|
+
MobilyProduct* product = [[self getInstance:uuid] getProductFromCacheWithIdWithId:productId];
|
153
|
+
if (product == nil) {
|
154
|
+
reject(@"1", @"MobilyflowSDK.MobilyPurchaseError.product_unavailable", [NSError errorWithDomain:@"MobilyflowSDK.MobilyPurchaseError" code:1 userInfo:nil]);
|
155
|
+
return;
|
156
|
+
}
|
146
157
|
|
147
158
|
NSString *offerId = options.offerId();
|
148
159
|
int quantity = (int)options.quantity();
|
149
|
-
|
150
|
-
[sdk getProductsWithIdentifiers:nil onlyAvailable:NO completionHandler:^(NSArray<MobilyProduct *> * _Nullable products, NSError * _Nullable error) {
|
151
|
-
if (error) {
|
152
|
-
reject([NSString stringWithFormat:@"%ld", error.code], error.description, error);
|
153
|
-
} else {
|
154
|
-
PurchaseOptions *purchaseOptions = [[PurchaseOptions alloc] init];
|
155
|
-
if (quantity > 1) {
|
156
|
-
purchaseOptions = [purchaseOptions setQuantity:quantity];
|
157
|
-
}
|
158
160
|
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
product = it;
|
164
|
-
|
165
|
-
if (offerId != nil) {
|
166
|
-
if ([it.subscriptionProduct.baseOffer.id isEqualToString:offerId]) {
|
167
|
-
purchaseOptions = [purchaseOptions setOffer:it.subscriptionProduct.baseOffer];
|
168
|
-
} else if (it.subscriptionProduct.freeTrial != nil && [it.subscriptionProduct.freeTrial.id isEqualToString:offerId]) {
|
169
|
-
purchaseOptions = [purchaseOptions setOffer:it.subscriptionProduct.freeTrial];
|
170
|
-
} else {
|
171
|
-
for (MobilySubscriptionOffer *off in it.subscriptionProduct.promotionalOffers) {
|
172
|
-
if ([off.id isEqualToString:offerId]) {
|
173
|
-
purchaseOptions = [purchaseOptions setOffer:off];
|
174
|
-
break;
|
175
|
-
}
|
176
|
-
}
|
177
|
-
}
|
178
|
-
}
|
161
|
+
PurchaseOptions *purchaseOptions = [[PurchaseOptions alloc] init];
|
162
|
+
if (quantity > 1) {
|
163
|
+
purchaseOptions = [purchaseOptions setQuantity:quantity];
|
164
|
+
}
|
179
165
|
|
166
|
+
if (offerId != nil) {
|
167
|
+
if ([product.subscriptionProduct.baseOffer.id isEqualToString:offerId]) {
|
168
|
+
purchaseOptions = [purchaseOptions setOffer:product.subscriptionProduct.baseOffer];
|
169
|
+
} else if (product.subscriptionProduct.freeTrial != nil && [product.subscriptionProduct.freeTrial.id isEqualToString:offerId]) {
|
170
|
+
purchaseOptions = [purchaseOptions setOffer:product.subscriptionProduct.freeTrial];
|
171
|
+
} else {
|
172
|
+
for (MobilySubscriptionOffer *off in product.subscriptionProduct.promotionalOffers) {
|
173
|
+
if ([off.id isEqualToString:offerId]) {
|
174
|
+
purchaseOptions = [purchaseOptions setOffer:off];
|
180
175
|
break;
|
181
176
|
}
|
182
177
|
}
|
178
|
+
}
|
179
|
+
}
|
183
180
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
[sdk purchaseProduct:product options:purchaseOptions completionHandler:^(enum WebhookStatus status, NSError * _Nullable error) {
|
190
|
-
if (error) {
|
191
|
-
reject([NSString stringWithFormat:@"%ld", error.code], error.description, error);
|
192
|
-
} else {
|
193
|
-
resolve([NSNumber numberWithInt:status]);
|
194
|
-
}
|
195
|
-
}];
|
181
|
+
[sdk purchaseProduct:product options:purchaseOptions completionHandler:^(enum WebhookStatus status, NSError * _Nullable error) {
|
182
|
+
if (error) {
|
183
|
+
reject([NSString stringWithFormat:@"%ld", error.code], error.description, error);
|
184
|
+
} else {
|
185
|
+
resolve([NSNumber numberWithInt:status]);
|
196
186
|
}
|
197
187
|
}];
|
198
188
|
}
|
@@ -207,9 +197,14 @@ RCT_EXPORT_MODULE()
|
|
207
197
|
}];
|
208
198
|
}
|
209
199
|
|
210
|
-
- (void)isForwardingEnable:(NSString *)uuid resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
211
|
-
|
212
|
-
|
200
|
+
- (void)isForwardingEnable:(NSString *)uuid externalRef:(NSString *)externalRef resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
201
|
+
|
202
|
+
[[self getInstance:uuid] isForwardingEnableWithExternalRef:externalRef completionHandler:^(BOOL result, NSError * _Nullable error) {
|
203
|
+
if (error) {
|
204
|
+
reject([NSString stringWithFormat:@"%ld", error.code], error.description, error);
|
205
|
+
} else {
|
206
|
+
resolve([NSNumber numberWithBool:result]);
|
207
|
+
}
|
213
208
|
}];
|
214
209
|
}
|
215
210
|
|
@@ -19,7 +19,7 @@
|
|
19
19
|
|
20
20
|
NSString* apiURL = jsi.apiURL().length > 0 ? jsi.apiURL() : nil;
|
21
21
|
|
22
|
-
return [[MobilyPurchaseSDKOptions alloc]
|
22
|
+
return [[MobilyPurchaseSDKOptions alloc] initWithLocales:languages debug:debug apiURL:apiURL];
|
23
23
|
}
|
24
24
|
|
25
25
|
@end
|
package/ios/generated/RNMobilyflowReactNativeSdkSpec/RNMobilyflowReactNativeSdkSpec-generated.mm
CHANGED
@@ -46,7 +46,7 @@ namespace facebook::react {
|
|
46
46
|
}
|
47
47
|
|
48
48
|
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_login(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
49
|
-
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "login", @selector(login:
|
49
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "login", @selector(login:externalRef:resolve:reject:), args, count);
|
50
50
|
}
|
51
51
|
|
52
52
|
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_getProducts(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
@@ -78,7 +78,7 @@ namespace facebook::react {
|
|
78
78
|
}
|
79
79
|
|
80
80
|
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_openRefundDialog(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
81
|
-
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "openRefundDialog", @selector(openRefundDialog:
|
81
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "openRefundDialog", @selector(openRefundDialog:productId:resolve:reject:), args, count);
|
82
82
|
}
|
83
83
|
|
84
84
|
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_purchaseProduct(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
@@ -94,7 +94,7 @@ namespace facebook::react {
|
|
94
94
|
}
|
95
95
|
|
96
96
|
static facebook::jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_isForwardingEnable(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
97
|
-
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "isForwardingEnable", @selector(isForwardingEnable:resolve:reject:), args, count);
|
97
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "isForwardingEnable", @selector(isForwardingEnable:externalRef:resolve:reject:), args, count);
|
98
98
|
}
|
99
99
|
|
100
100
|
NativeMobilyflowReactNativeSdkSpecJSI::NativeMobilyflowReactNativeSdkSpecJSI(const ObjCTurboModule::InitParams ¶ms)
|
@@ -142,7 +142,7 @@ namespace facebook::react {
|
|
142
142
|
methodMap_["getStoreCountry"] = MethodMetadata {1, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_getStoreCountry};
|
143
143
|
|
144
144
|
|
145
|
-
methodMap_["isForwardingEnable"] = MethodMetadata {
|
145
|
+
methodMap_["isForwardingEnable"] = MethodMetadata {2, __hostFunction_NativeMobilyflowReactNativeSdkSpecJSI_isForwardingEnable};
|
146
146
|
|
147
147
|
}
|
148
148
|
} // namespace facebook::react
|
@@ -73,7 +73,7 @@ namespace JS {
|
|
73
73
|
options:(JS::NativeMobilyflowReactNativeSdk::MobilyPurchaseSDKOptions &)options;
|
74
74
|
- (void)close:(NSString *)uuid;
|
75
75
|
- (void)login:(NSString *)uuid
|
76
|
-
|
76
|
+
externalRef:(NSString *)externalRef
|
77
77
|
resolve:(RCTPromiseResolveBlock)resolve
|
78
78
|
reject:(RCTPromiseRejectBlock)reject;
|
79
79
|
- (void)getProducts:(NSString *)uuid
|
@@ -105,7 +105,7 @@ namespace JS {
|
|
105
105
|
resolve:(RCTPromiseResolveBlock)resolve
|
106
106
|
reject:(RCTPromiseRejectBlock)reject;
|
107
107
|
- (void)openRefundDialog:(NSString *)uuid
|
108
|
-
|
108
|
+
productId:(NSString *)productId
|
109
109
|
resolve:(RCTPromiseResolveBlock)resolve
|
110
110
|
reject:(RCTPromiseRejectBlock)reject;
|
111
111
|
- (void)purchaseProduct:(NSString *)uuid
|
@@ -118,6 +118,7 @@ namespace JS {
|
|
118
118
|
resolve:(RCTPromiseResolveBlock)resolve
|
119
119
|
reject:(RCTPromiseRejectBlock)reject;
|
120
120
|
- (void)isForwardingEnable:(NSString *)uuid
|
121
|
+
externalRef:(NSString *)externalRef
|
121
122
|
resolve:(RCTPromiseResolveBlock)resolve
|
122
123
|
reject:(RCTPromiseRejectBlock)reject;
|
123
124
|
|
@@ -114,7 +114,8 @@ static jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_getSto
|
|
114
114
|
static jsi::Value __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_isForwardingEnable(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
115
115
|
return static_cast<NativeMobilyflowReactNativeSdkCxxSpecJSI *>(&turboModule)->isForwardingEnable(
|
116
116
|
rt,
|
117
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
117
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
118
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt)
|
118
119
|
);
|
119
120
|
}
|
120
121
|
|
@@ -134,7 +135,7 @@ NativeMobilyflowReactNativeSdkCxxSpecJSI::NativeMobilyflowReactNativeSdkCxxSpecJ
|
|
134
135
|
methodMap_["purchaseProduct"] = MethodMetadata {3, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_purchaseProduct};
|
135
136
|
methodMap_["sendDiagnotic"] = MethodMetadata {1, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_sendDiagnotic};
|
136
137
|
methodMap_["getStoreCountry"] = MethodMetadata {1, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_getStoreCountry};
|
137
|
-
methodMap_["isForwardingEnable"] = MethodMetadata {
|
138
|
+
methodMap_["isForwardingEnable"] = MethodMetadata {2, __hostFunction_NativeMobilyflowReactNativeSdkCxxSpecJSI_isForwardingEnable};
|
138
139
|
}
|
139
140
|
|
140
141
|
|
@@ -130,7 +130,7 @@ protected:
|
|
130
130
|
public:
|
131
131
|
virtual jsi::String instantiate(jsi::Runtime &rt, jsi::String appId, jsi::String apiKey, double environment, std::optional<jsi::Object> options) = 0;
|
132
132
|
virtual void close(jsi::Runtime &rt, jsi::String uuid) = 0;
|
133
|
-
virtual jsi::Value login(jsi::Runtime &rt, jsi::String uuid, jsi::String
|
133
|
+
virtual jsi::Value login(jsi::Runtime &rt, jsi::String uuid, jsi::String externalRef) = 0;
|
134
134
|
virtual jsi::Value getProducts(jsi::Runtime &rt, jsi::String uuid, jsi::Array identifiers, bool onlyAvailable) = 0;
|
135
135
|
virtual jsi::Value getSubscriptionGroups(jsi::Runtime &rt, jsi::String uuid, jsi::Array identifiers, bool onlyAvailable) = 0;
|
136
136
|
virtual jsi::Value getEntitlementForSubscription(jsi::Runtime &rt, jsi::String uuid, jsi::String subscriptionGroupId) = 0;
|
@@ -138,11 +138,11 @@ public:
|
|
138
138
|
virtual jsi::Value getEntitlements(jsi::Runtime &rt, jsi::String uuid, jsi::Array productIds) = 0;
|
139
139
|
virtual jsi::Value requestTransferOwnership(jsi::Runtime &rt, jsi::String uuid) = 0;
|
140
140
|
virtual jsi::Value openManageSubscription(jsi::Runtime &rt, jsi::String uuid) = 0;
|
141
|
-
virtual jsi::Value openRefundDialog(jsi::Runtime &rt, jsi::String uuid, jsi::String
|
141
|
+
virtual jsi::Value openRefundDialog(jsi::Runtime &rt, jsi::String uuid, jsi::String productId) = 0;
|
142
142
|
virtual jsi::Value purchaseProduct(jsi::Runtime &rt, jsi::String uuid, jsi::String productId, std::optional<jsi::Object> options) = 0;
|
143
143
|
virtual void sendDiagnotic(jsi::Runtime &rt, jsi::String uuid) = 0;
|
144
144
|
virtual jsi::Value getStoreCountry(jsi::Runtime &rt, jsi::String uuid) = 0;
|
145
|
-
virtual jsi::Value isForwardingEnable(jsi::Runtime &rt, jsi::String uuid) = 0;
|
145
|
+
virtual jsi::Value isForwardingEnable(jsi::Runtime &rt, jsi::String uuid, jsi::String externalRef) = 0;
|
146
146
|
|
147
147
|
};
|
148
148
|
|
@@ -189,13 +189,13 @@ private:
|
|
189
189
|
return bridging::callFromJs<void>(
|
190
190
|
rt, &T::close, jsInvoker_, instance_, std::move(uuid));
|
191
191
|
}
|
192
|
-
jsi::Value login(jsi::Runtime &rt, jsi::String uuid, jsi::String
|
192
|
+
jsi::Value login(jsi::Runtime &rt, jsi::String uuid, jsi::String externalRef) override {
|
193
193
|
static_assert(
|
194
194
|
bridging::getParameterCount(&T::login) == 3,
|
195
195
|
"Expected login(...) to have 3 parameters");
|
196
196
|
|
197
197
|
return bridging::callFromJs<jsi::Value>(
|
198
|
-
rt, &T::login, jsInvoker_, instance_, std::move(uuid), std::move(
|
198
|
+
rt, &T::login, jsInvoker_, instance_, std::move(uuid), std::move(externalRef));
|
199
199
|
}
|
200
200
|
jsi::Value getProducts(jsi::Runtime &rt, jsi::String uuid, jsi::Array identifiers, bool onlyAvailable) override {
|
201
201
|
static_assert(
|
@@ -253,13 +253,13 @@ private:
|
|
253
253
|
return bridging::callFromJs<jsi::Value>(
|
254
254
|
rt, &T::openManageSubscription, jsInvoker_, instance_, std::move(uuid));
|
255
255
|
}
|
256
|
-
jsi::Value openRefundDialog(jsi::Runtime &rt, jsi::String uuid, jsi::String
|
256
|
+
jsi::Value openRefundDialog(jsi::Runtime &rt, jsi::String uuid, jsi::String productId) override {
|
257
257
|
static_assert(
|
258
258
|
bridging::getParameterCount(&T::openRefundDialog) == 3,
|
259
259
|
"Expected openRefundDialog(...) to have 3 parameters");
|
260
260
|
|
261
261
|
return bridging::callFromJs<jsi::Value>(
|
262
|
-
rt, &T::openRefundDialog, jsInvoker_, instance_, std::move(uuid), std::move(
|
262
|
+
rt, &T::openRefundDialog, jsInvoker_, instance_, std::move(uuid), std::move(productId));
|
263
263
|
}
|
264
264
|
jsi::Value purchaseProduct(jsi::Runtime &rt, jsi::String uuid, jsi::String productId, std::optional<jsi::Object> options) override {
|
265
265
|
static_assert(
|
@@ -285,13 +285,13 @@ private:
|
|
285
285
|
return bridging::callFromJs<jsi::Value>(
|
286
286
|
rt, &T::getStoreCountry, jsInvoker_, instance_, std::move(uuid));
|
287
287
|
}
|
288
|
-
jsi::Value isForwardingEnable(jsi::Runtime &rt, jsi::String uuid) override {
|
288
|
+
jsi::Value isForwardingEnable(jsi::Runtime &rt, jsi::String uuid, jsi::String externalRef) override {
|
289
289
|
static_assert(
|
290
|
-
bridging::getParameterCount(&T::isForwardingEnable) ==
|
291
|
-
"Expected isForwardingEnable(...) to have
|
290
|
+
bridging::getParameterCount(&T::isForwardingEnable) == 3,
|
291
|
+
"Expected isForwardingEnable(...) to have 3 parameters");
|
292
292
|
|
293
293
|
return bridging::callFromJs<jsi::Value>(
|
294
|
-
rt, &T::isForwardingEnable, jsInvoker_, instance_, std::move(uuid));
|
294
|
+
rt, &T::isForwardingEnable, jsInvoker_, instance_, std::move(uuid), std::move(externalRef));
|
295
295
|
}
|
296
296
|
|
297
297
|
private:
|
@@ -12,6 +12,7 @@ var _reactNative = require("react-native");
|
|
12
12
|
var _mobilyError = require("./errors/mobily-error.js");
|
13
13
|
var _mobilyPurchaseError = require("./errors/mobily-purchase-error.js");
|
14
14
|
var _mobilyTransferOwnershipError = require("./errors/mobily-transfer-ownership-error.js");
|
15
|
+
var _mobilyCustomer = require("./entities/mobily-customer.js");
|
15
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
16
17
|
class MobilyPurchaseSDK {
|
17
18
|
constructor(appId, apiKey, environment, options) {
|
@@ -46,9 +47,10 @@ class MobilyPurchaseSDK {
|
|
46
47
|
throw this.throwError(error);
|
47
48
|
}
|
48
49
|
}
|
49
|
-
async login(
|
50
|
+
async login(externalRef) {
|
50
51
|
try {
|
51
|
-
await _NativeMobilyflowReactNativeSdk.default.login(this._uuid,
|
52
|
+
const customer = await _NativeMobilyflowReactNativeSdk.default.login(this._uuid, externalRef);
|
53
|
+
return _mobilyCustomer.MobilyCustomer.parseFromAPI(customer);
|
52
54
|
} catch (error) {
|
53
55
|
throw this.throwError(error);
|
54
56
|
}
|
@@ -107,12 +109,12 @@ class MobilyPurchaseSDK {
|
|
107
109
|
throw this.throwError(error);
|
108
110
|
}
|
109
111
|
}
|
110
|
-
async openRefundDialog(
|
112
|
+
async openRefundDialog(productId) {
|
111
113
|
if (_reactNative.Platform.OS === 'android') {
|
112
114
|
throw new Error('openRefundDialog not implemented on Android');
|
113
115
|
} else {
|
114
116
|
try {
|
115
|
-
return await _NativeMobilyflowReactNativeSdk.default.openRefundDialog(this._uuid,
|
117
|
+
return await _NativeMobilyflowReactNativeSdk.default.openRefundDialog(this._uuid, productId);
|
116
118
|
} catch (error) {
|
117
119
|
throw this.throwError(error);
|
118
120
|
}
|
@@ -146,9 +148,9 @@ class MobilyPurchaseSDK {
|
|
146
148
|
}
|
147
149
|
}
|
148
150
|
}
|
149
|
-
async isForwardingEnable() {
|
151
|
+
async isForwardingEnable(externalRef) {
|
150
152
|
try {
|
151
|
-
return await _NativeMobilyflowReactNativeSdk.default.isForwardingEnable(this._uuid);
|
153
|
+
return await _NativeMobilyflowReactNativeSdk.default.isForwardingEnable(this._uuid, externalRef);
|
152
154
|
} catch (error) {
|
153
155
|
throw this.throwError(error);
|
154
156
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_NativeMobilyflowReactNativeSdk","_interopRequireDefault","require","_mobilyProduct","_mobilySubscriptionGroup","_mobilyCustomerEntitlement","_reactNative","_mobilyError","_mobilyPurchaseError","_mobilyTransferOwnershipError","e","__esModule","default","MobilyPurchaseSDK","constructor","appId","apiKey","environment","options","_uuid","MobilyflowReactNativeSdk","instantiate","throwError","error","RNPlatform","OS","name","MobilyError","parseInt","code","message","nativeStackAndroid","MobilyPurchaseError","MobilyTransferOwnershipError","domain","nativeStackIOS","close","login","
|
1
|
+
{"version":3,"names":["_NativeMobilyflowReactNativeSdk","_interopRequireDefault","require","_mobilyProduct","_mobilySubscriptionGroup","_mobilyCustomerEntitlement","_reactNative","_mobilyError","_mobilyPurchaseError","_mobilyTransferOwnershipError","_mobilyCustomer","e","__esModule","default","MobilyPurchaseSDK","constructor","appId","apiKey","environment","options","_uuid","MobilyflowReactNativeSdk","instantiate","throwError","error","RNPlatform","OS","name","MobilyError","parseInt","code","message","nativeStackAndroid","MobilyPurchaseError","MobilyTransferOwnershipError","domain","nativeStackIOS","close","login","externalRef","customer","MobilyCustomer","parseFromAPI","getProducts","identifiers","onlyAvailable","products","map","MobilyProduct","getSubscriptionGroups","groups","MobilySubscriptionGroup","getEntitlementForSubscription","subscriptionGroupId","entitlement","MobilyCustomerEntitlement","getEntitlement","productId","getEntitlements","productIds","entitlements","requestTransferOwnership","openManageSubscription","openRefundDialog","Error","purchaseProduct","product","id","offerId","offer","quantity","sendDiagnotic","getStoreCountry","isForwardingEnable","exports"],"sourceRoot":"../../src","sources":["MobilyPurchaseSDK.tsx"],"mappings":";;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e,CAAC,IAAI,CAAC7C,KAAK,EAAE8C,OAAO,CAACC,EAAE,EAAE;QAC5EC,OAAO,EAAEjD,OAAO,EAAEkD,KAAK,EAAEF,EAAE,IAAI,IAAI;QACnCG,QAAQ,EAAEnD,OAAO,EAAEmD,QAAQ,IAAI;MACjC,CAAC,CAAC;IACJ,CAAC,CAAC,OAAO9C,KAAU,EAAE;MACnB,MAAM,IAAI,CAACD,UAAU,CAACC,KAAK,CAAC;IAC9B;EACF;EAEA+C,aAAaA,CAAA,EAAG;IACd,IAAI;MACF,OAAOlD,uCAAwB,CAACkD,aAAa,CAAC,IAAI,CAACnD,KAAK,CAAC;IAC3D,CAAC,CAAC,OAAOI,KAAU,EAAE;MACnB,MAAM,IAAI,CAACD,UAAU,CAACC,KAAK,CAAC;IAC9B;EACF;EAEA,MAAMgD,eAAeA,CAAA,EAAG;IACtB,IAAI/C,qBAAU,CAACC,EAAE,KAAK,SAAS,EAAE;MAC/B,MAAM,IAAIsC,KAAK,CAAC,4CAA4C,CAAC;IAC/D,CAAC,MAAM;MACL,IAAI;QACF,OAAO,MAAM3C,uCAAwB,CAACmD,eAAe,CAAC,IAAI,CAACpD,KAAK,CAAC;MACnE,CAAC,CAAC,OAAOI,KAAU,EAAE;QACnB,MAAM,IAAI,CAACD,UAAU,CAACC,KAAK,CAAC;MAC9B;IACF;EACF;EAEA,MAAMiD,kBAAkBA,CAAClC,WAAmB,EAAE;IAC5C,IAAI;MACF,OAAO,MAAMlB,uCAAwB,CAACoD,kBAAkB,CAAC,IAAI,CAACrD,KAAK,EAAEmB,WAAW,CAAC;IACnF,CAAC,CAAC,OAAOf,KAAU,EAAE;MACnB,MAAM,IAAI,CAACD,UAAU,CAACC,KAAK,CAAC;IAC9B;EACF;AACF;AAACkD,OAAA,CAAA5D,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeMobilyflowReactNativeSdk.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,
|
1
|
+
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeMobilyflowReactNativeSdk.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAAmD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GA6CpCC,gCAAmB,CAACC,YAAY,CAAO,0BAA0B,CAAC","ignoreList":[]}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.MobilyCustomer = void 0;
|
7
|
+
var _objectTransformer = require("../utils/object-transformer.js");
|
8
|
+
class MobilyCustomer {
|
9
|
+
static parseFromAPI(obj) {
|
10
|
+
return (0, _objectTransformer.objectTransformer)(obj, {
|
11
|
+
dates: ['createdAt', 'updatedAt']
|
12
|
+
});
|
13
|
+
}
|
14
|
+
}
|
15
|
+
exports.MobilyCustomer = MobilyCustomer;
|
16
|
+
//# sourceMappingURL=mobily-customer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_objectTransformer","require","MobilyCustomer","parseFromAPI","obj","objectTransformer","dates","exports"],"sourceRoot":"../../../src","sources":["entities/mobily-customer.ts"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAEO,MAAMC,cAAc,CAAC;EAO1B,OAAOC,YAAYA,CAACC,GAAmB,EAAE;IACvC,OAAO,IAAAC,oCAAiB,EAACD,GAAG,EAAE;MAAEE,KAAK,EAAE,CAAC,WAAW,EAAE,WAAW;IAAE,CAAC,CAAC;EACtE;AACF;AAACC,OAAA,CAAAL,cAAA,GAAAA,cAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_objectTransformer","require","MobilyProduct","parseFromAPI","obj","objectTransformer","dates","exports"],"sourceRoot":"../../../src","sources":["entities/mobily-product.ts"],"mappings":";;;;;;AAIA,IAAAA,kBAAA,GAAAC,OAAA;AAEO,MAAMC,aAAa,CAAC;
|
1
|
+
{"version":3,"names":["_objectTransformer","require","MobilyProduct","parseFromAPI","obj","objectTransformer","dates","exports"],"sourceRoot":"../../../src","sources":["entities/mobily-product.ts"],"mappings":";;;;;;AAIA,IAAAA,kBAAA,GAAAC,OAAA;AAEO,MAAMC,aAAa,CAAC;EAuBzB,OAAOC,YAAYA,CAACC,GAAkB,EAAE;IACtC,OAAO,IAAAC,oCAAiB,EAACD,GAAG,EAAE;MAC5BE,KAAK,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW;IAC/C,CAAC,CAAC;EACJ;AACF;AAACC,OAAA,CAAAL,aAAA,GAAAA,aAAA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["MobilySubscriptionOffer","exports"],"sourceRoot":"../../../src","sources":["entities/mobily-subscription-offer.ts"],"mappings":";;;;;;AAGO,MAAMA,uBAAuB,CAAC;
|
1
|
+
{"version":3,"names":["MobilySubscriptionOffer","exports"],"sourceRoot":"../../../src","sources":["entities/mobily-subscription-offer.ts"],"mappings":";;;;;;AAGO,MAAMA,uBAAuB,CAAC;AAepCC,OAAA,CAAAD,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|