react-native-firework-sdk 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +5 -3
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/StoryBlockFragment.kt +129 -0
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/StoryBlockFrameLayout.kt +84 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWEventName.kt +2 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfiguration.kt +18 -5
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfigurationDeserializer.kt +33 -9
- package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResult.kt +17 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResultDeserializer.kt +33 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +126 -45
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +6 -3
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWVideoShoppingInterface.kt +2 -2
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWNavigatorModule.kt +9 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +81 -50
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +9 -2
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWGlobalDataUtil.kt +4 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWLanguageUtil.kt +48 -16
- package/android/src/main/res/layout/fw_bridge_story_block.xml +24 -0
- package/ios/Components/StoryBlock.swift +33 -2
- package/ios/Components/StoryBlockManager.m +32 -0
- package/ios/Components/VideoFeed.swift +9 -29
- package/ios/Components/VideoFeedManager.m +11 -6
- package/ios/FireworkSdk.xcodeproj/project.pbxproj +378 -104
- package/ios/Models/NativeToRN/FireworkEventName.swift +3 -1
- package/ios/Models/RNToNative/RCTConvert+Shopping.swift +21 -0
- package/ios/Models/RNToNative/RCTConvert+VideoFeed.swift +27 -0
- package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +5 -1
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +1 -0
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +30 -0
- package/ios/Modules/Shopping/ProductInfoViewConfiguration.swift +13 -0
- package/ios/Modules/Shopping/ShoppingCTAResult.swift +16 -0
- package/ios/Modules/Shopping/ShoppingModule.m +2 -1
- package/ios/Modules/Shopping/ShoppingModule.swift +106 -30
- package/ios/Support/MultiHostStreaming/FWMultiHostStreaming.podspec +24 -0
- package/ios/Support/MultiHostStreaming/src/MultiHostStreamingSDK.swift +17 -0
- package/ios/Utils/AppLanguage/Bundle+FWSwizzle.swift +58 -0
- package/ios/Utils/AppLanguage/FWAppLanguageManager.swift +139 -0
- package/ios/Utils/AppLanguage/FWLanguageUtil.swift +43 -0
- package/ios/Utils/AppLanguage/NumberFormatter+FWSwizzle.swift +25 -0
- package/ios/Utils/AppLanguage/UIImageView+FWSwizzle.swift +91 -0
- package/ios/Utils/AppLanguage/UILabel+FWSwizzle.swift +98 -0
- package/ios/Utils/AppLanguage/UITextField+FWSwizzle.swift +97 -0
- package/ios/Utils/AppLanguage/UITextView+FWSwizzle.swift +97 -0
- package/ios/Utils/AppLanguage/UIView+FWSwizzle.swift +38 -0
- package/ios/Utils/AppLanguage/UIViewController+FWSwizzle.swift +32 -0
- package/ios/Utils/AppLanguage/UIWindow+FWSwizzle.swift +26 -0
- package/ios/Utils/AppLanguage/URLSession+FWSwizzle.swift +69 -0
- package/ios/Utils/{DispatchQueue+FWOnce.swift → Extensions/DispatchQueue+FWOnce.swift} +3 -3
- package/ios/Utils/{UINavigationController+FWSwizzle.swift → Extensions/Swizzle/UINavigationController+FWSwizzle.swift} +6 -8
- package/ios/Utils/Extensions/UIView+FWUIHierarchy.swift +47 -0
- package/ios/Utils/FWRTL/Classes/Manager/FWRTLManager.h +25 -0
- package/ios/Utils/FWRTL/Classes/Manager/FWRTLManager.m +75 -0
- package/ios/Utils/FWRTL/Classes/UICategories/CALayer+FWRTL.h +21 -0
- package/ios/Utils/FWRTL/Classes/UICategories/CALayer+FWRTL.m +124 -0
- package/ios/Utils/FWRTL/Classes/UICategories/FWRTLRemoteViewControllerAdaptor.h +11 -0
- package/ios/Utils/FWRTL/Classes/UICategories/FWRTLRemoteViewControllerAdaptor.m +86 -0
- package/ios/Utils/FWRTL/Classes/UICategories/FWRTLWhiteListManager.h +16 -0
- package/ios/Utils/FWRTL/Classes/UICategories/FWRTLWhiteListManager.m +55 -0
- package/ios/Utils/FWRTL/Classes/UICategories/UILabel+FWRTL.h +18 -0
- package/ios/Utils/FWRTL/Classes/UICategories/UILabel+FWRTL.m +39 -0
- package/ios/Utils/FWRTL/Classes/UICategories/UIView+FWRTL.h +54 -0
- package/ios/Utils/FWRTL/Classes/UICategories/UIView+FWRTL.m +141 -0
- package/ios/Utils/FWRTL/Classes/UICategories/UIWindow+FWRTL.h +16 -0
- package/ios/Utils/FWRTL/Classes/UICategories/UIWindow+FWRTL.m +20 -0
- package/ios/Utils/FWRTL/Classes/Utils/FWRTLDefinitions.h +52 -0
- package/ios/Utils/FWRTL/Classes/Utils/NSObject+FWRTLReloadBlock.h +19 -0
- package/ios/Utils/FWRTL/Classes/Utils/NSObject+FWRTLReloadBlock.m +49 -0
- package/ios/Utils/FWRTL/Classes/Utils/NSString+FWRTL.h +21 -0
- package/ios/Utils/FWRTL/Classes/Utils/NSString+FWRTL.m +38 -0
- package/ios/Utils/FWRTL/Classes/Utils/UIImage+FWRTL.h +18 -0
- package/ios/Utils/FWRTL/Classes/Utils/UIImage+FWRTL.m +43 -0
- package/ios/Utils/FWSwizzleLoader.m +6 -1
- package/ios/Utils/FWSwizzleLoader.swift +13 -0
- package/ios/Utils/FWSwizzleUtil.swift +17 -9
- package/ios/react_native_firework_sdk.h +1 -0
- package/ios/scripts/react_native_firework_sdk_pods.rb +31 -0
- package/lib/commonjs/FireworkSDK.js +21 -4
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/VideoShopping.js +20 -37
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/StoryBlock.js +190 -125
- package/lib/commonjs/components/StoryBlock.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +11 -1
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/FWEventName.js +2 -0
- package/lib/commonjs/models/FWEventName.js.map +1 -1
- package/lib/commonjs/models/ShoppingCTAResult.js +2 -0
- package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
- package/lib/commonjs/modules/ShoppingModule.js.map +1 -1
- package/lib/module/FireworkSDK.js +21 -4
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/VideoShopping.js +20 -39
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/StoryBlock.js +179 -131
- package/lib/module/components/StoryBlock.js.map +1 -1
- package/lib/module/components/VideoFeed.js +10 -1
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/FWEventName.js +2 -0
- package/lib/module/models/FWEventName.js.map +1 -1
- package/lib/module/models/ShoppingCTAResult.js +2 -0
- package/lib/module/modules/FireworkSDKModule.js.map +1 -1
- package/lib/module/modules/ShoppingModule.js.map +1 -1
- package/lib/typescript/FireworkSDK.d.ts +7 -4
- package/lib/typescript/VideoShopping.d.ts +9 -11
- package/lib/typescript/components/StoryBlock.d.ts +19 -25
- package/lib/typescript/index.d.ts +6 -6
- package/lib/typescript/models/FWEventName.d.ts +2 -0
- package/lib/typescript/models/FWEvents.d.ts +14 -1
- package/lib/typescript/models/ProductInfoViewConfiguration.d.ts +36 -1
- package/lib/typescript/models/ShoppingCTAResult.d.ts +11 -0
- package/lib/typescript/modules/FireworkSDKModule.d.ts +1 -2
- package/lib/typescript/modules/ShoppingModule.d.ts +2 -1
- package/package.json +2 -2
- package/react-native-firework-sdk.podspec +26 -24
- package/src/FireworkSDK.ts +18 -5
- package/src/VideoShopping.ts +40 -53
- package/src/components/StoryBlock.tsx +199 -96
- package/src/components/VideoFeed.tsx +11 -0
- package/src/index.ts +15 -7
- package/src/models/FWEventName.ts +2 -0
- package/src/models/FWEvents.ts +14 -1
- package/src/models/ProductInfoViewConfiguration.ts +38 -1
- package/src/models/ShoppingCTAResult.ts +11 -0
- package/src/modules/FireworkSDKModule.ts +1 -2
- package/src/modules/ShoppingModule.ts +5 -5
- package/android/src/main/java/com/fireworksdk/bridge/constants/FWCommandConstant.kt +0 -6
- package/ios/Utils/UIView+ParentViewController.swift +0 -21
- package/lib/commonjs/models/AddToCartResult.js +0 -2
- package/lib/module/models/AddToCartResult.js +0 -2
- package/lib/typescript/models/AddToCartResult.d.ts +0 -10
- package/src/models/AddToCartResult.ts +0 -10
- /package/ios/Utils/{String+Color.swift → Extensions/String+Color.swift} +0 -0
- /package/ios/Utils/{UIView+Constraints.swift → Extensions/UIView+Constraints.swift} +0 -0
- /package/ios/Utils/{UIViewController+AttachChild.swift → Extensions/UIViewController+AttachChild.swift} +0 -0
- /package/lib/commonjs/models/{AddToCartResult.js.map → ShoppingCTAResult.js.map} +0 -0
- /package/lib/module/models/{AddToCartResult.js.map → ShoppingCTAResult.js.map} +0 -0
package/src/index.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
IStoryBlockMethods,
|
|
3
|
+
IStoryBlockProps,
|
|
4
|
+
} from './components/StoryBlock';
|
|
2
5
|
import StoryBlock from './components/StoryBlock';
|
|
3
6
|
import type { IVideoFeedProps, VideoFeedMode } from './components/VideoFeed';
|
|
4
7
|
import VideoFeed from './components/VideoFeed';
|
|
@@ -19,17 +22,16 @@ import type AdBadgeConfiguration from './models/AdBadgeConfiguration';
|
|
|
19
22
|
import type { AdBadgeTextType } from './models/AdBadgeConfiguration';
|
|
20
23
|
import type AdConfiguration from './models/AdConfiguration';
|
|
21
24
|
import type { VastAttribute } from './models/AdConfiguration';
|
|
22
|
-
import type AddToCartResult from './models/AddToCartResult';
|
|
23
25
|
import type AndroidFontInfo from './models/AndroidFontInfo';
|
|
24
26
|
import type FeedItemDetails from './models/FeedItemDetails';
|
|
25
27
|
import type FWError from './models/FWError';
|
|
26
28
|
import type {
|
|
27
|
-
AddToCartEvent,
|
|
28
29
|
CustomClickLinkButtonEvent,
|
|
29
30
|
CustomCTAClickEvent,
|
|
30
31
|
LiveStreamChatEvent,
|
|
31
32
|
LiveStreamEvent,
|
|
32
33
|
SDKInitEvent,
|
|
34
|
+
ShoppingCTAEvent,
|
|
33
35
|
UpdateProductDetailsEvent,
|
|
34
36
|
VideoFeedClickEvent,
|
|
35
37
|
VideoPlaybackEvent,
|
|
@@ -48,11 +50,14 @@ import type ProductInfoViewConfiguration from './models/ProductInfoViewConfigura
|
|
|
48
50
|
import type {
|
|
49
51
|
AddToCartButtonConfiguration,
|
|
50
52
|
LinkButtonConfiguration,
|
|
53
|
+
ShoppingCTAButtonConfiguration,
|
|
54
|
+
ShoppingCTAButtonText,
|
|
51
55
|
} from './models/ProductInfoViewConfiguration';
|
|
52
56
|
import type ProductUnit from './models/ProductUnit';
|
|
53
57
|
import type { ProductPrice, ProductUnitOption } from './models/ProductUnit';
|
|
54
58
|
import type SDKInitOptions from './models/SDKInitOptions';
|
|
55
59
|
import type { VideoLaunchBehavior } from './models/SDKInitOptions';
|
|
60
|
+
import type ShoppingCTAResult from './models/ShoppingCTAResult';
|
|
56
61
|
import type { StoryBlockSource } from './models/StoryBlockSource';
|
|
57
62
|
import type TrackPurchaseParameters from './models/TrackPurchaseParameters';
|
|
58
63
|
import type VideoFeedConfiguration from './models/VideoFeedConfiguration';
|
|
@@ -75,9 +80,9 @@ import type {
|
|
|
75
80
|
VideoPlayerStyle,
|
|
76
81
|
} from './models/VideoPlayerConfiguration';
|
|
77
82
|
import type {
|
|
78
|
-
AddToCartCallback,
|
|
79
83
|
CustomClickCartIconCallback,
|
|
80
84
|
CustomClickLinkButtonCallback,
|
|
85
|
+
ShoppingCTACallback,
|
|
81
86
|
UpdateProductDetailsCallback,
|
|
82
87
|
} from './VideoShopping';
|
|
83
88
|
import VideoShopping from './VideoShopping';
|
|
@@ -89,9 +94,6 @@ export {
|
|
|
89
94
|
AdBadgeTextType,
|
|
90
95
|
AdConfiguration,
|
|
91
96
|
AddToCartButtonConfiguration,
|
|
92
|
-
AddToCartCallback,
|
|
93
|
-
AddToCartEvent,
|
|
94
|
-
AddToCartResult,
|
|
95
97
|
AndroidFontInfo,
|
|
96
98
|
CustomClickCartIconCallback,
|
|
97
99
|
CustomClickLinkButtonCallback,
|
|
@@ -105,6 +107,7 @@ export {
|
|
|
105
107
|
IOSFontInfo,
|
|
106
108
|
IOSSystemFontStyle,
|
|
107
109
|
IOSSystemFontWeight,
|
|
110
|
+
IStoryBlockMethods,
|
|
108
111
|
IStoryBlockProps,
|
|
109
112
|
IVideoFeedProps,
|
|
110
113
|
LinkButtonConfiguration,
|
|
@@ -125,6 +128,11 @@ export {
|
|
|
125
128
|
SDKInitCallback,
|
|
126
129
|
SDKInitEvent,
|
|
127
130
|
SDKInitOptions,
|
|
131
|
+
ShoppingCTAButtonConfiguration,
|
|
132
|
+
ShoppingCTAButtonText,
|
|
133
|
+
ShoppingCTACallback,
|
|
134
|
+
ShoppingCTAEvent,
|
|
135
|
+
ShoppingCTAResult,
|
|
128
136
|
StoryBlock,
|
|
129
137
|
StoryBlockSource,
|
|
130
138
|
TrackPurchaseParameters,
|
|
@@ -4,6 +4,7 @@ export enum FWEventName {
|
|
|
4
4
|
VideoPlayback = 'fw:video-playback',
|
|
5
5
|
VideoFeedClick = 'fw:video-feed-click',
|
|
6
6
|
AddToCart = 'fw:shopping:add-to-cart',
|
|
7
|
+
ShoppingCTAButtonClick = 'fw:shopping:cta-button-click',
|
|
7
8
|
ClickCartIcon = 'fw:shopping:click-cart-icon',
|
|
8
9
|
UpdateProductDetails = 'fw:shopping:update-product-details',
|
|
9
10
|
LiveStream = 'fw:livestream',
|
|
@@ -11,6 +12,7 @@ export enum FWEventName {
|
|
|
11
12
|
ShareBaseURLUpdated = 'fw:share-base-url-updated',
|
|
12
13
|
VideoLaunchBehaviorUpdated = 'fw:video-launch-behavior-updated',
|
|
13
14
|
AdBadgeConfigurationUpdated = 'fw:ad-badge-configuration-updated',
|
|
15
|
+
AppLanguageUpdated = 'fw:app-language-updated',
|
|
14
16
|
LogMessage = 'fw:log-message',
|
|
15
17
|
CustomLinkButtonClick = 'fw:shopping:custom-link-button-click',
|
|
16
18
|
}
|
package/src/models/FWEvents.ts
CHANGED
|
@@ -30,7 +30,11 @@ export interface VideoFeedClickEvent {
|
|
|
30
30
|
info: FeedItemDetails;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export interface
|
|
33
|
+
export interface ShoppingCTAEvent {
|
|
34
|
+
/**
|
|
35
|
+
* The url for the product unit
|
|
36
|
+
*/
|
|
37
|
+
url: string;
|
|
34
38
|
/**
|
|
35
39
|
* A unique identifier of the product.
|
|
36
40
|
*/
|
|
@@ -60,7 +64,16 @@ export interface LiveStreamChatEvent {
|
|
|
60
64
|
}
|
|
61
65
|
|
|
62
66
|
export interface CustomClickLinkButtonEvent {
|
|
67
|
+
/**
|
|
68
|
+
* The url for the product unit
|
|
69
|
+
*/
|
|
63
70
|
url: string;
|
|
71
|
+
/**
|
|
72
|
+
* A unique identifier of the product.
|
|
73
|
+
*/
|
|
64
74
|
productId: string;
|
|
75
|
+
/**
|
|
76
|
+
* A unique identifier of the product unit.
|
|
77
|
+
*/
|
|
65
78
|
unitId: string;
|
|
66
79
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type IOSFontInfo from './IOSFontInfo';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated The interface will be removed since RN SDK V2.1.
|
|
5
|
+
* Use {@link ShoppingCTAButtonConfiguration} instead.
|
|
6
|
+
*/
|
|
3
7
|
export interface AddToCartButtonConfiguration {
|
|
4
8
|
/**
|
|
5
9
|
* The background color of "Add to cart" button.
|
|
@@ -21,6 +25,32 @@ export interface AddToCartButtonConfiguration {
|
|
|
21
25
|
iOSFontInfo?: IOSFontInfo;
|
|
22
26
|
}
|
|
23
27
|
|
|
28
|
+
export type ShoppingCTAButtonText = 'addToCart' | 'shopNow';
|
|
29
|
+
|
|
30
|
+
export interface ShoppingCTAButtonConfiguration {
|
|
31
|
+
/**
|
|
32
|
+
* The text of shopping CTA button.
|
|
33
|
+
*/
|
|
34
|
+
text?: ShoppingCTAButtonText;
|
|
35
|
+
/**
|
|
36
|
+
* The background color of CTA button.
|
|
37
|
+
*/
|
|
38
|
+
backgroundColor?: string;
|
|
39
|
+
/**
|
|
40
|
+
* The text color of CTA button.
|
|
41
|
+
*/
|
|
42
|
+
textColor?: string;
|
|
43
|
+
/**
|
|
44
|
+
* The font size of CTA button.
|
|
45
|
+
*/
|
|
46
|
+
fontSize?: number;
|
|
47
|
+
/**
|
|
48
|
+
* The iOS font info of "Add to cart" button.
|
|
49
|
+
* The property is ignored when fontSize is not set.
|
|
50
|
+
*/
|
|
51
|
+
iOSFontInfo?: IOSFontInfo;
|
|
52
|
+
}
|
|
53
|
+
|
|
24
54
|
export interface LinkButtonConfiguration {
|
|
25
55
|
isHidden?: boolean;
|
|
26
56
|
}
|
|
@@ -28,10 +58,17 @@ export interface LinkButtonConfiguration {
|
|
|
28
58
|
export default interface ProductInfoViewConfiguration {
|
|
29
59
|
/**
|
|
30
60
|
* Configuration of "Add to cart" button. Only supported on iOS.
|
|
61
|
+
*
|
|
62
|
+
* @deprecated The property will be removed since RN SDK V2.1.
|
|
63
|
+
* Use {@link ctaButton} instead.
|
|
31
64
|
*/
|
|
32
65
|
addToCartButton?: AddToCartButtonConfiguration;
|
|
33
66
|
/**
|
|
34
|
-
* Configuration of
|
|
67
|
+
* Configuration of shopping CTA button. Only supported on iOS.
|
|
68
|
+
*/
|
|
69
|
+
ctaButton?: ShoppingCTAButtonConfiguration;
|
|
70
|
+
/**
|
|
71
|
+
* Configuration of link button next to "Add to cart" button.
|
|
35
72
|
*/
|
|
36
73
|
linkButton?: LinkButtonConfiguration;
|
|
37
74
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default interface ShoppingCTAResult {
|
|
2
|
+
/**
|
|
3
|
+
* The result of shopping CTA button.
|
|
4
|
+
*/
|
|
5
|
+
res: 'success' | 'fail';
|
|
6
|
+
/**
|
|
7
|
+
* We will show a toast to display the tips.
|
|
8
|
+
* If the property is undefined or empty string, we don't show a toast.
|
|
9
|
+
*/
|
|
10
|
+
tips?: string;
|
|
11
|
+
}
|
|
@@ -25,8 +25,7 @@ interface IFireworkSDKModule extends NativeModule {
|
|
|
25
25
|
setVideoPlaybackEventEnabled(enabled: boolean): void;
|
|
26
26
|
setAdBadgeConfiguration(config?: AdBadgeConfiguration): Promise<any>;
|
|
27
27
|
trackPurchase(parameters: TrackPurchaseParameters): void;
|
|
28
|
-
changeAppLanguage(language
|
|
29
|
-
restart(): Promise<any>;
|
|
28
|
+
changeAppLanguage(language?: string | null): Promise<boolean>;
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
const FireworkSDKModuleEventEmitter = new NativeEventEmitter(FireworkSDKModule);
|
|
@@ -3,6 +3,7 @@ import { NativeEventEmitter, NativeModule, NativeModules } from 'react-native';
|
|
|
3
3
|
import { LINKING_ERROR } from '../constants/FWErrorMessage';
|
|
4
4
|
import type Product from '../models/Product';
|
|
5
5
|
import type ProductInfoViewConfiguration from '../models/ProductInfoViewConfiguration';
|
|
6
|
+
import type ShoppingCTAResult from '../models/ShoppingCTAResult';
|
|
6
7
|
|
|
7
8
|
const ShoppingModule = NativeModules.ShoppingModule
|
|
8
9
|
? NativeModules.ShoppingModule
|
|
@@ -18,17 +19,16 @@ const ShoppingModule = NativeModules.ShoppingModule
|
|
|
18
19
|
interface IShoppingModule extends NativeModule {
|
|
19
20
|
init(): void;
|
|
20
21
|
updateVideoProducts(products: Product[], callbackId: number | string): void;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
tips: string,
|
|
22
|
+
updateShoppingCTAResult(
|
|
23
|
+
result: ShoppingCTAResult,
|
|
24
24
|
callbackId: number | string
|
|
25
25
|
): void;
|
|
26
26
|
setCartIconVisible(visible: boolean): void;
|
|
27
27
|
setCartItemCount(count: number): void;
|
|
28
28
|
setCustomClickCartIconEnabled(enabled: boolean): Promise<void>; // Only supported on iOS
|
|
29
29
|
clearCallbackId(callbackId: number | string, eventName: string): void; // Only supported on iOS
|
|
30
|
-
setProductInfoViewConfiguration(config: ProductInfoViewConfiguration): void;
|
|
31
|
-
setCustomClickLinkButtonEnabled(enabled: boolean): Promise<void>;
|
|
30
|
+
setProductInfoViewConfiguration(config: ProductInfoViewConfiguration): void;
|
|
31
|
+
setCustomClickLinkButtonEnabled(enabled: boolean): Promise<void>;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
const ShoppingModuleEventEmitter = new NativeEventEmitter(ShoppingModule);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// View+ParentViewController.swift
|
|
3
|
-
// react-native-firework-sdk
|
|
4
|
-
//
|
|
5
|
-
// Created by Jeff Zheng on 2021/12/22.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
import UIKit
|
|
9
|
-
|
|
10
|
-
extension UIView {
|
|
11
|
-
var parentViewController: UIViewController? {
|
|
12
|
-
var parentResponder: UIResponder? = self
|
|
13
|
-
while parentResponder != nil {
|
|
14
|
-
parentResponder = parentResponder!.next
|
|
15
|
-
if let viewController = parentResponder as? UIViewController {
|
|
16
|
-
return viewController
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return nil
|
|
20
|
-
}
|
|
21
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|