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
@@ -4,6 +4,7 @@ import { MobilyProduct } from './entities/mobily-product';
|
|
4
4
|
import { MobilySubscriptionGroup } from './entities/mobily-subscription-group';
|
5
5
|
import { MobilyCustomerEntitlement } from './entities/mobily-customer-entitlement';
|
6
6
|
import { WebhookStatus } from './enums/webhook-status';
|
7
|
+
import type { MobilyCustomer } from './entities/mobily-customer';
|
7
8
|
|
8
9
|
export type MobilyPurchaseSDKOptions = {
|
9
10
|
languages?: string[];
|
@@ -20,7 +21,7 @@ export interface Spec extends TurboModule {
|
|
20
21
|
instantiate(appId: string, apiKey: string, environment: number, options?: MobilyPurchaseSDKOptions): string;
|
21
22
|
close(uuid: string): void;
|
22
23
|
|
23
|
-
login(uuid: string,
|
24
|
+
login(uuid: string, externalRef: string): Promise<MobilyCustomer>;
|
24
25
|
getProducts(uuid: string, identifiers: string[], onlyAvailable: boolean): Promise<MobilyProduct[]>;
|
25
26
|
getSubscriptionGroups(
|
26
27
|
uuid: string,
|
@@ -34,13 +35,13 @@ export interface Spec extends TurboModule {
|
|
34
35
|
|
35
36
|
requestTransferOwnership(uuid: string): Promise<void>;
|
36
37
|
openManageSubscription(uuid: string): Promise<void>;
|
37
|
-
openRefundDialog(uuid: string,
|
38
|
+
openRefundDialog(uuid: string, productId: string): Promise<boolean>;
|
38
39
|
|
39
40
|
purchaseProduct(uuid: string, productId: string, options?: PurchaseOptions): Promise<WebhookStatus>;
|
40
41
|
|
41
42
|
sendDiagnotic(uuid: string): void;
|
42
43
|
getStoreCountry(uuid: string): Promise<string>;
|
43
|
-
isForwardingEnable(uuid: string): Promise<boolean>;
|
44
|
+
isForwardingEnable(uuid: string, externalRef: string): Promise<boolean>;
|
44
45
|
}
|
45
46
|
|
46
47
|
export default TurboModuleRegistry.getEnforcing<Spec>('MobilyflowReactNativeSdk');
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { objectTransformer } from '../utils/object-transformer';
|
2
|
+
|
3
|
+
export class MobilyCustomer {
|
4
|
+
public id: string;
|
5
|
+
public createdAt: Date;
|
6
|
+
public updatedAt: Date;
|
7
|
+
public externalRef: string;
|
8
|
+
public isForwardingEnable: boolean;
|
9
|
+
|
10
|
+
static parseFromAPI(obj: MobilyCustomer) {
|
11
|
+
return objectTransformer(obj, { dates: ['createdAt', 'updatedAt'] });
|
12
|
+
}
|
13
|
+
}
|
@@ -3,13 +3,16 @@ import type { PeriodUnit } from '../enums/period-unit';
|
|
3
3
|
|
4
4
|
export class MobilySubscriptionOffer {
|
5
5
|
id: string;
|
6
|
+
identifier: string;
|
7
|
+
externalRef: string;
|
6
8
|
name: string;
|
7
9
|
price: number;
|
8
10
|
currencyCode: string;
|
9
11
|
priceFormatted: string;
|
10
|
-
|
12
|
+
type: string;
|
11
13
|
periodCount: number;
|
12
14
|
periodUnit: PeriodUnit;
|
15
|
+
countBillingCycle: number;
|
13
16
|
ios_offerId: string;
|
14
17
|
extras: any;
|
15
18
|
status: ProductStatus;
|
@@ -14,14 +14,16 @@ export namespace MobilyPurchaseError {
|
|
14
14
|
|
15
15
|
PRODUCT_UNAVAILABLE,
|
16
16
|
NETWORK_UNAVAILABLE,
|
17
|
+
BILLING_ISSUE,
|
17
18
|
|
18
|
-
WEBHOOK_NOT_PRECESSED,
|
19
19
|
WEBHOOK_FAILED,
|
20
|
+
WEBHOOK_NOT_PROCESSED,
|
20
21
|
|
21
22
|
ALREADY_PURCHASED,
|
23
|
+
RENEW_ALREADY_ON_THIS_PLAN,
|
22
24
|
NOT_MANAGED_BY_THIS_STORE_ACCOUNT,
|
23
25
|
STORE_ACCOUNT_ALREADY_HAVE_PURCHASE,
|
24
|
-
|
26
|
+
CUSTOMER_FORWARDED,
|
25
27
|
|
26
28
|
USER_CANCELED,
|
27
29
|
FAILED,
|