react-native-firework-sdk 2.0.0 → 2.2.0-beta.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.
Files changed (202) hide show
  1. package/FireworkVideoUI.xcframework/Info.plist +40 -0
  2. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  3. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Headers/FireworkVideoUI-Swift.h +280 -0
  4. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Headers/FireworkVideoUI.h +18 -0
  5. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Info.plist +0 -0
  6. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.abi.json +1327 -0
  7. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.private.swiftinterface +41 -0
  8. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  9. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftinterface +41 -0
  10. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/module.modulemap +11 -0
  11. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  12. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Headers/FireworkVideoUI-Swift.h +556 -0
  13. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Headers/FireworkVideoUI.h +18 -0
  14. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Info.plist +0 -0
  15. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.abi.json +1327 -0
  16. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +41 -0
  17. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  18. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +41 -0
  19. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json +1327 -0
  20. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +41 -0
  21. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  22. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +41 -0
  23. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/module.modulemap +11 -0
  24. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +245 -0
  25. package/README.md +1 -1
  26. package/android/build.gradle +5 -4
  27. package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +6 -0
  28. package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/StoryBlockFragment.kt +129 -0
  29. package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/StoryBlockFrameLayout.kt +90 -0
  30. package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModelDeserializer.kt +3 -3
  31. package/android/src/main/java/com/fireworksdk/bridge/models/FWEventName.kt +5 -1
  32. package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModelDeserializer.kt +1 -1
  33. package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfiguration.kt +18 -5
  34. package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfigurationDeserializer.kt +36 -8
  35. package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModelDeserializer.kt +3 -3
  36. package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResult.kt +17 -0
  37. package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResultDeserializer.kt +33 -0
  38. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModelDeserializer.kt +14 -12
  39. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +1 -0
  40. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelDeserializer.kt +11 -7
  41. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedSource.kt +1 -0
  42. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlaybackDetails.kt +8 -8
  43. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +1 -0
  44. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt +19 -12
  45. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoShoppingProductDeserializer.kt +11 -11
  46. package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +131 -45
  47. package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +11 -3
  48. package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWVideoShoppingInterface.kt +2 -2
  49. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWLiveStreamModule.kt +45 -4
  50. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWNavigatorModule.kt +9 -1
  51. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +83 -50
  52. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +112 -36
  53. package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +16 -6
  54. package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +26 -32
  55. package/android/src/main/java/com/fireworksdk/bridge/utils/FWGlobalDataUtil.kt +10 -0
  56. package/android/src/main/java/com/fireworksdk/bridge/utils/FWLanguageUtil.kt +48 -16
  57. package/android/src/main/res/layout/fw_bridge_story_block.xml +24 -0
  58. package/ios/Components/StoryBlock.swift +32 -2
  59. package/ios/Components/StoryBlockManager.m +33 -0
  60. package/ios/Components/StoryBlockManager.swift +4 -0
  61. package/ios/Components/VideoFeed.swift +16 -32
  62. package/ios/Components/VideoFeedManager.m +12 -6
  63. package/ios/Components/VideoFeedManager.swift +4 -0
  64. package/ios/Components/VideoPlayerConfiguration.swift +1 -0
  65. package/ios/FireworkSdk.xcodeproj/project.pbxproj +276 -212
  66. package/ios/FireworkVideoUI/FireworkVideoUI/FireworkVideoUI.docc/FireworkVideoUI.md +13 -0
  67. package/ios/FireworkVideoUI/FireworkVideoUI/FireworkVideoUI.h +18 -0
  68. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/AppLanguageManager.swift +147 -0
  69. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/Bundle+AppLanguage.swift +58 -0
  70. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/NumberFormatter+AppLanguage.swift +25 -0
  71. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/URLSession+AppLanguage.swift +69 -0
  72. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIImageView+AppLanguage.swift +91 -0
  73. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UILabel+AppLanguage.swift +98 -0
  74. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UITextField+AppLanguage.swift +97 -0
  75. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UITextView+AppLanguage.swift +97 -0
  76. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIView+AppLanguage.swift +38 -0
  77. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIViewController+AppLanguage.swift +46 -0
  78. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIWindow+AppLanguage.swift +26 -0
  79. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/LanguageUtil.swift +43 -0
  80. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/Foundation/NSObject+LayoutFlip.swift +42 -0
  81. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/CALayer+LayoutFlip.swift +160 -0
  82. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/UILabel+LayoutFlip.swift +35 -0
  83. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/UIView+LayoutFlip.swift +199 -0
  84. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/LayoutFlipManager.swift +59 -0
  85. package/ios/{Utils/DispatchQueue+FWOnce.swift → FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/Foundation/DispatchQueue+Once.swift} +5 -5
  86. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/Foundation/String+Base64.swift +18 -0
  87. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/UIKit/UIView+UIHierarchy.swift +46 -0
  88. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Swizzle.swift +37 -0
  89. package/ios/FireworkVideoUI/FireworkVideoUI.xcodeproj/project.pbxproj +766 -0
  90. package/ios/FireworkVideoUI/FireworkVideoUI.xcworkspace/contents.xcworkspacedata +10 -0
  91. package/ios/FireworkVideoUI/FireworkVideoUI.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  92. package/ios/FireworkVideoUI/FireworkVideoUITests/FireworkVideoUITests.swift +37 -0
  93. package/ios/FireworkVideoUI/Podfile +15 -0
  94. package/ios/FireworkVideoUI/Podfile.lock +16 -0
  95. package/ios/Models/NativeToRN/FireworkEventName.swift +7 -1
  96. package/ios/Models/NativeToRN/FireworkSDK+Json.swift +5 -1
  97. package/ios/Models/RNToNative/RCTConvert+Shopping.swift +21 -0
  98. package/ios/Models/RNToNative/RCTConvert+StoryBlock.swift +2 -1
  99. package/ios/Models/RNToNative/RCTConvert+VideoFeed.swift +29 -1
  100. package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +13 -101
  101. package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +34 -16
  102. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +1 -0
  103. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +48 -2
  104. package/ios/Modules/FireworkSDKModule/SDKInitOptions.swift +0 -1
  105. package/ios/Modules/LiveStream/LiveStreamModule.swift +1 -0
  106. package/ios/Modules/Shopping/ProductInfoViewConfiguration.swift +7 -2
  107. package/ios/Modules/Shopping/ShoppingCTAResult.swift +16 -0
  108. package/ios/Modules/Shopping/ShoppingModule.m +2 -1
  109. package/ios/Modules/Shopping/ShoppingModule.swift +92 -34
  110. package/ios/Support/MultiHostStreaming/FWMultiHostStreaming.podspec +22 -0
  111. package/ios/Support/MultiHostStreaming/Sources/MultiHostStreamingSDK.swift +17 -0
  112. package/ios/Utils/{UINavigationController+FWSwizzle.swift → Extensions/Swizzle/UINavigationController+FWSwizzle.swift} +9 -8
  113. package/ios/Utils/FWSwizzleLoader.m +6 -1
  114. package/ios/Utils/FWSwizzleLoader.swift +13 -0
  115. package/ios/react_native_firework_sdk.h +1 -0
  116. package/ios/scripts/react_native_firework_sdk_pods.rb +27 -0
  117. package/lib/commonjs/FireworkSDK.js +55 -15
  118. package/lib/commonjs/FireworkSDK.js.map +1 -1
  119. package/lib/commonjs/LiveStream.js +2 -2
  120. package/lib/commonjs/LiveStream.js.map +1 -1
  121. package/lib/commonjs/VideoShopping.js +21 -38
  122. package/lib/commonjs/VideoShopping.js.map +1 -1
  123. package/lib/commonjs/components/StoryBlock.js +193 -128
  124. package/lib/commonjs/components/StoryBlock.js.map +1 -1
  125. package/lib/commonjs/components/VideoFeed.js +17 -5
  126. package/lib/commonjs/components/VideoFeed.js.map +1 -1
  127. package/lib/commonjs/index.js.map +1 -1
  128. package/lib/commonjs/models/FWEventName.js +3 -0
  129. package/lib/commonjs/models/FWEventName.js.map +1 -1
  130. package/lib/commonjs/models/ShoppingCTAResult.js +2 -0
  131. package/lib/commonjs/models/VideoPlaybackEventName.js +3 -0
  132. package/lib/commonjs/models/VideoPlaybackEventName.js.map +1 -1
  133. package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
  134. package/lib/commonjs/modules/ShoppingModule.js.map +1 -1
  135. package/lib/module/FireworkSDK.js +54 -15
  136. package/lib/module/FireworkSDK.js.map +1 -1
  137. package/lib/module/LiveStream.js +2 -2
  138. package/lib/module/LiveStream.js.map +1 -1
  139. package/lib/module/VideoShopping.js +21 -40
  140. package/lib/module/VideoShopping.js.map +1 -1
  141. package/lib/module/components/StoryBlock.js +183 -133
  142. package/lib/module/components/StoryBlock.js.map +1 -1
  143. package/lib/module/components/VideoFeed.js +16 -5
  144. package/lib/module/components/VideoFeed.js.map +1 -1
  145. package/lib/module/index.js.map +1 -1
  146. package/lib/module/models/FWEventName.js +3 -0
  147. package/lib/module/models/FWEventName.js.map +1 -1
  148. package/lib/module/models/ShoppingCTAResult.js +2 -0
  149. package/lib/module/models/VideoPlaybackEventName.js +3 -0
  150. package/lib/module/models/VideoPlaybackEventName.js.map +1 -1
  151. package/lib/module/modules/FireworkSDKModule.js.map +1 -1
  152. package/lib/module/modules/ShoppingModule.js.map +1 -1
  153. package/lib/typescript/FireworkSDK.d.ts +15 -8
  154. package/lib/typescript/LiveStream.d.ts +2 -2
  155. package/lib/typescript/VideoShopping.d.ts +10 -12
  156. package/lib/typescript/components/StoryBlock.d.ts +25 -24
  157. package/lib/typescript/components/VideoFeed.d.ts +7 -0
  158. package/lib/typescript/index.d.ts +6 -6
  159. package/lib/typescript/models/FWEventName.d.ts +3 -0
  160. package/lib/typescript/models/FWEvents.d.ts +14 -1
  161. package/lib/typescript/models/ProductInfoViewConfiguration.d.ts +12 -8
  162. package/lib/typescript/models/SDKInitOptions.d.ts +6 -1
  163. package/lib/typescript/models/ShoppingCTAResult.d.ts +11 -0
  164. package/lib/typescript/models/StoryBlockSource.d.ts +1 -1
  165. package/lib/typescript/models/VideoFeedSource.d.ts +1 -1
  166. package/lib/typescript/models/VideoPlaybackDetails.d.ts +16 -0
  167. package/lib/typescript/models/VideoPlaybackEventName.d.ts +13 -1
  168. package/lib/typescript/models/VideoPlayerConfiguration.d.ts +4 -0
  169. package/lib/typescript/modules/FireworkSDKModule.d.ts +1 -2
  170. package/lib/typescript/modules/ShoppingModule.d.ts +2 -1
  171. package/package.json +8 -3
  172. package/react-native-firework-sdk.podspec +31 -24
  173. package/src/FireworkSDK.ts +54 -15
  174. package/src/LiveStream.ts +2 -2
  175. package/src/VideoShopping.ts +41 -54
  176. package/src/components/StoryBlock.tsx +210 -98
  177. package/src/components/VideoFeed.tsx +23 -4
  178. package/src/index.ts +15 -9
  179. package/src/models/FWEventName.ts +3 -0
  180. package/src/models/FWEvents.ts +14 -1
  181. package/src/models/ProductInfoViewConfiguration.ts +13 -8
  182. package/src/models/SDKInitOptions.ts +6 -1
  183. package/src/models/ShoppingCTAResult.ts +11 -0
  184. package/src/models/StoryBlockSource.ts +2 -1
  185. package/src/models/VideoFeedSource.ts +2 -1
  186. package/src/models/VideoPlaybackDetails.ts +16 -0
  187. package/src/models/VideoPlaybackEventName.ts +13 -1
  188. package/src/models/VideoPlayerConfiguration.ts +4 -0
  189. package/src/modules/FireworkSDKModule.ts +1 -2
  190. package/src/modules/ShoppingModule.ts +5 -5
  191. package/android/src/main/java/com/fireworksdk/bridge/constants/FWCommandConstant.kt +0 -6
  192. package/ios/Utils/FWSwizzleUtil.swift +0 -29
  193. package/ios/Utils/UIView+ParentViewController.swift +0 -21
  194. package/lib/commonjs/models/AddToCartResult.js +0 -2
  195. package/lib/module/models/AddToCartResult.js +0 -2
  196. package/lib/typescript/models/AddToCartResult.d.ts +0 -10
  197. package/src/models/AddToCartResult.ts +0 -10
  198. /package/ios/Utils/{String+Color.swift → Extensions/String+Color.swift} +0 -0
  199. /package/ios/Utils/{UIView+Constraints.swift → Extensions/UIView+Constraints.swift} +0 -0
  200. /package/ios/Utils/{UIViewController+AttachChild.swift → Extensions/UIViewController+AttachChild.swift} +0 -0
  201. /package/lib/commonjs/models/{AddToCartResult.js.map → ShoppingCTAResult.js.map} +0 -0
  202. /package/lib/module/models/{AddToCartResult.js.map → ShoppingCTAResult.js.map} +0 -0
@@ -1,14 +1,25 @@
1
- import React from 'react';
1
+ import type { ForwardRefRenderFunction } from 'react';
2
+ import React, {
3
+ forwardRef,
4
+ useEffect,
5
+ useImperativeHandle,
6
+ useReducer,
7
+ useRef,
8
+ useState,
9
+ } from 'react';
2
10
 
3
- import type {
4
- EmitterSubscription,
11
+ import {
12
+ BackHandler,
13
+ findNodeHandle,
5
14
  NativeSyntheticEvent,
15
+ Platform,
6
16
  StyleProp,
17
+ UIManager,
7
18
  ViewStyle,
8
19
  } from 'react-native';
9
- import { findNodeHandle, Platform, UIManager } from 'react-native';
10
20
 
11
21
  import FireworkSDK from '../FireworkSDK';
22
+ import type AdConfiguration from '../models/AdConfiguration';
12
23
  import type FWError from '../models/FWError';
13
24
  import { FWEventName } from '../models/FWEventName';
14
25
  import type { StoryBlockSource } from '../models/StoryBlockSource';
@@ -18,17 +29,16 @@ import FWStoryBlock from './FWStoryBlock';
18
29
 
19
30
  const NativeComponentName = 'FWStoryBlock';
20
31
 
21
- const createFragment = (viewId: any) => {
22
- if (Platform.OS === 'android') {
23
- UIManager.dispatchViewManagerCommand(
24
- viewId,
25
- UIManager.getViewManagerConfig(
26
- NativeComponentName
27
- ).Commands.create.toString(),
28
- [viewId]
29
- );
30
- }
31
- };
32
+ export interface IStoryBlockMethods {
33
+ /**
34
+ * Play the story block.
35
+ */
36
+ play: () => void;
37
+ /**
38
+ * Pause the story block.
39
+ */
40
+ pause: () => void;
41
+ }
32
42
 
33
43
  /**
34
44
  * The props type of StoryBlock component.
@@ -55,98 +65,126 @@ export interface IStoryBlockProps {
55
65
  */
56
66
  dynamicContentParameters?: { [key: string]: string[] };
57
67
  /**
58
- * Specifies if Picture in Picture is enabled.
68
+ * Hashtag filter expression is an s-expression used to provide feeds filtered by hashtags with specified criteria.
69
+ * Queries are specified with boolean predicates on what hashtags are there on the video.
70
+ * For instance, (and sport food) (or sport food) (and sport (or food comedy)) sport are all valid expressions.
71
+ * Non-UTF-8 characters are not allowed. If using boolean predicates, the expression needs to be wrapped with parenthesis.
72
+ */
73
+ hashtagFilterExpression?: string;
74
+ /**
75
+ * Specifies if Picture in Picture is enabled. Only supported on iOS.
59
76
  */
60
77
  enablePictureInPicture?: boolean;
78
+ /**
79
+ * Ad configuration of the feed. Only supported on iOS.
80
+ */
81
+ adConfiguration?: AdConfiguration;
61
82
  /**
62
83
  * The feed loading result callback. It means loading successfully when error equals to undefined.
63
84
  */
64
85
  onStoryBlockLoadFinished?: (error?: FWError) => void;
65
86
  }
66
87
 
67
- /**
68
- * StoryBlock component. Only supported on iOS.
69
- */
70
- class StoryBlock extends React.Component<IStoryBlockProps> {
71
- private _nativeComponentRef = React.createRef<any>();
88
+ const StoryBlock: ForwardRefRenderFunction<
89
+ IStoryBlockMethods,
90
+ IStoryBlockProps
91
+ > = (props: IStoryBlockProps, forwardedRef) => {
92
+ const nativeComponentRef = useRef(null);
93
+ const [isFullscreenState, setIsFullscreenState] = useState<boolean>(false);
94
+ const [, forceUpdate] = useReducer((x) => x + 1, 0);
95
+ useImperativeHandle(
96
+ forwardedRef,
97
+ () => {
98
+ const sendCommand = (command: string) => {
99
+ const nativeNodeHandle = findNodeHandle(nativeComponentRef.current);
72
100
 
73
- private _subscriptions: EmitterSubscription[] = [];
101
+ let commandId: string | number =
102
+ UIManager.getViewManagerConfig(NativeComponentName).Commands[command];
103
+ if (Platform.OS === 'android') {
104
+ commandId = commandId.toString();
105
+ }
74
106
 
75
- /**
76
- * @ignore
77
- */
78
- componentDidMount() {
107
+ UIManager.dispatchViewManagerCommand(
108
+ findNodeHandle(nativeNodeHandle),
109
+ commandId,
110
+ []
111
+ );
112
+ };
113
+ return {
114
+ play: () => {
115
+ sendCommand('play');
116
+ },
117
+ pause: () => {
118
+ sendCommand('pause');
119
+ },
120
+ };
121
+ },
122
+ []
123
+ );
124
+ useEffect(() => {
79
125
  const subscriptionOfShareBaseURLUpdated =
80
126
  FireworkSDKModuleEventEmitter.addListener(
81
127
  FWEventName.ShareBaseURLUpdated,
82
128
  () => {
83
- this.setState({});
129
+ FWLoggerUtil.log('Receive FWEventName.ShareBaseURLUpdated');
130
+ forceUpdate();
84
131
  }
85
132
  );
86
- this._subscriptions.push(subscriptionOfShareBaseURLUpdated);
87
-
88
133
  const subscriptionOfAdBadgeConfigurationUpdated =
89
134
  FireworkSDKModuleEventEmitter.addListener(
90
135
  FWEventName.AdBadgeConfigurationUpdated,
91
136
  () => {
92
- this.setState({});
137
+ FWLoggerUtil.log('Receive FWEventName.AdBadgeConfigurationUpdated');
138
+ forceUpdate();
93
139
  }
94
140
  );
95
- this._subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);
96
141
 
97
142
  const subscriptionOfVideoLaunchBehaviorUpdated =
98
143
  FireworkSDKModuleEventEmitter.addListener(
99
144
  FWEventName.VideoLaunchBehaviorUpdated,
100
145
  () => {
101
146
  FWLoggerUtil.log('Receive FWEventName.VideoLaunchBehaviorUpdated');
102
- this.setState({});
147
+ forceUpdate();
103
148
  }
104
149
  );
105
- this._subscriptions.push(subscriptionOfVideoLaunchBehaviorUpdated);
106
150
 
107
- if (Platform.OS === 'android') {
108
- const viewId = findNodeHandle(this._nativeComponentRef.current);
109
- FWLoggerUtil.log(
110
- `StoryBlock componentDidMount createFragment viewId: ${viewId}`
151
+ const subscriptionOfAppLanguageUpdated =
152
+ FireworkSDKModuleEventEmitter.addListener(
153
+ FWEventName.AppLanguageUpdated,
154
+ () => {
155
+ FWLoggerUtil.log('Receive FWEventName.AppLanguageUpdated');
156
+ forceUpdate();
157
+ }
111
158
  );
112
- createFragment(viewId);
113
- }
114
- }
115
-
116
- /**
117
- * @ignore
118
- */
119
- componentWillUnmount() {
120
- this._subscriptions.forEach((value) => {
121
- value.remove();
122
- });
123
159
 
124
- this._subscriptions = [];
125
- }
160
+ if (Platform.OS === 'android') {
161
+ setTimeout(() => {
162
+ const viewId = findNodeHandle(nativeComponentRef.current);
163
+ FWLoggerUtil.log(`StoryBlock createFragment viewId: ${viewId}`);
164
+ UIManager.dispatchViewManagerCommand(
165
+ viewId,
166
+ UIManager.getViewManagerConfig(
167
+ NativeComponentName
168
+ ).Commands.create.toString(),
169
+ [viewId]
170
+ );
171
+ }, 500);
172
+ }
126
173
 
127
- /**
128
- * @ignore
129
- */
130
- render() {
131
- const { style } = this.props;
132
-
133
- return (
134
- <FWStoryBlock
135
- ref={this._nativeComponentRef}
136
- key={this._generateKey()}
137
- {...this.props}
138
- onStoryBlockLoadFinished={this._onStoryBlockLoadFinished}
139
- style={Object.assign({}, style, { zIndex: -1 })}
140
- />
141
- );
142
- }
174
+ return () => {
175
+ subscriptionOfShareBaseURLUpdated.remove();
176
+ subscriptionOfAdBadgeConfigurationUpdated.remove();
177
+ subscriptionOfVideoLaunchBehaviorUpdated.remove();
178
+ subscriptionOfAppLanguageUpdated.remove();
179
+ };
180
+ }, []);
143
181
 
144
- private _onStoryBlockLoadFinished = (event: NativeSyntheticEvent<any>) => {
182
+ const handleStoryBlockLoadFinished = (event: NativeSyntheticEvent<any>) => {
145
183
  FWLoggerUtil.log(
146
- `StoryBlock _onStoryBlockLoadFinished ${event.nativeEvent.name}`
184
+ `StoryBlock handleStoryBlockLoadFinished ${event.nativeEvent.name}`
147
185
  );
148
186
 
149
- const { onStoryBlockLoadFinished } = this.props;
187
+ const { onStoryBlockLoadFinished } = props;
150
188
  const { name, reason } = event.nativeEvent;
151
189
 
152
190
  if (onStoryBlockLoadFinished) {
@@ -162,60 +200,134 @@ class StoryBlock extends React.Component<IStoryBlockProps> {
162
200
  }
163
201
  };
164
202
 
165
- private _generateKey(): string {
203
+ const handleStoryBlockFullscreenStateChanged = (
204
+ event: NativeSyntheticEvent<any>
205
+ ) => {
206
+ FWLoggerUtil.log(
207
+ `StoryBlock handleStoryBlockFullscreenStateChanged ${event.nativeEvent.isFullScreen}`
208
+ );
209
+ const { isFullScreen } = event.nativeEvent;
210
+ setIsFullscreenState(isFullScreen);
211
+ };
212
+
213
+ const generateDynamicContentParametersString = (): string => {
214
+ const { dynamicContentParameters } = props;
215
+
216
+ if (!dynamicContentParameters) {
217
+ return '';
218
+ }
219
+
220
+ let resultString = '';
221
+ const sortedKeyList = Object.keys(dynamicContentParameters).sort();
222
+ for (const key of sortedKeyList) {
223
+ const value = dynamicContentParameters[key];
224
+ const valueString = value.join(',');
225
+ if (resultString.length > 0) {
226
+ resultString += '_';
227
+ }
228
+
229
+ resultString += `${key}:${valueString}`;
230
+ }
231
+
232
+ return resultString;
233
+ };
234
+
235
+ const generateVastAttributesString = () => {
236
+ const { adConfiguration } = props;
237
+ const vastAttributes = adConfiguration?.vastAttributes ?? '';
238
+ if (!vastAttributes) {
239
+ return '';
240
+ }
241
+
242
+ let resultString = '';
243
+ for (const attribute of vastAttributes) {
244
+ if (resultString.length > 0) {
245
+ resultString += '_';
246
+ }
247
+ resultString += `${attribute.name ?? ''}:${attribute.value}`;
248
+ }
249
+
250
+ return resultString;
251
+ };
252
+
253
+ const generateKey = (): string => {
166
254
  const {
167
255
  source,
168
256
  channel = '',
169
257
  playlist = '',
170
258
  enablePictureInPicture = false,
171
- } = this.props;
259
+ adConfiguration,
260
+ hashtagFilterExpression = '',
261
+ } = props;
172
262
 
173
- const shareBaseURL = FireworkSDK.getInstance().getShareBaseURL() ?? '';
263
+ const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';
264
+ const videoLaunchBehavior =
265
+ FireworkSDK.getInstance().videoLaunchBehavior ?? 'default';
174
266
  const adBadgeConfiguration =
175
267
  FireworkSDK.getInstance().getAdBadgeConfiguration() ?? {};
176
268
  const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';
177
269
  const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';
178
270
  const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';
179
271
  const dynamicContentParametersString =
180
- this._generateDynamicContentParametersString();
181
- const videoLaunchBehavior =
182
- FireworkSDK.getInstance().getVideoLaunchBehavior() ?? 'default';
272
+ generateDynamicContentParametersString();
273
+ const appLanguage = FireworkSDK.getInstance().appLanguage ?? '';
274
+ const requiresAds = adConfiguration?.requiresAds ?? false;
275
+ const adsFetchTimeout = adConfiguration?.adsFetchTimeout ?? 10;
276
+ const vastAttributesString = generateVastAttributesString();
183
277
 
184
278
  let key = `source:${source}`;
185
279
  key += `_channel:${channel}`;
186
280
  key += `_playlist:${playlist}`;
187
- key += `_shareBaseURL:${shareBaseURL}`;
281
+ key += `_gShareBaseURL:${gShareBaseURL}`;
282
+ key += `_videoLaunchBehavior:${videoLaunchBehavior}`;
188
283
  key += `_adBadgeTextType:${adBadgeTextType}`;
189
284
  key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;
190
285
  key += `_textColorOfAdBadge:${textColorOfAdBadge}`;
191
286
  key += `_dynamicContentParameters:${dynamicContentParametersString}`;
192
287
  key += `_enablePictureInPicture:${enablePictureInPicture}`;
193
- key += `_videoLaunchBehavior:${videoLaunchBehavior}`;
288
+ key += `_appLanguage:${appLanguage}`;
289
+ key += `_requiresAds:${requiresAds}`;
290
+ key += `_adsFetchTimeout:${adsFetchTimeout}`;
291
+ key += `_vastAttributes:${vastAttributesString}`;
292
+ key += `_hashtagFilterExpression:${hashtagFilterExpression}`;
194
293
 
195
294
  return key;
196
- }
197
-
198
- private _generateDynamicContentParametersString(): string {
199
- const { dynamicContentParameters } = this.props;
295
+ };
200
296
 
201
- if (!dynamicContentParameters) {
202
- return '';
297
+ useEffect(() => {
298
+ if (Platform.OS === 'android') {
299
+ const onBackPress = () => {
300
+ if (isFullscreenState) {
301
+ FireworkSDK.getInstance().navigator.popNativeContainer();
302
+ return true;
303
+ }
304
+ return false;
305
+ };
306
+ const subscription = BackHandler.addEventListener(
307
+ 'hardwareBackPress',
308
+ onBackPress
309
+ );
310
+ return () => {
311
+ subscription.remove();
312
+ };
203
313
  }
204
314
 
205
- let resultString = '';
206
- const sortedKeyList = Object.keys(dynamicContentParameters).sort();
207
- for (const key of sortedKeyList) {
208
- const value = dynamicContentParameters[key];
209
- const valueString = value.join(',');
210
- if (resultString.length > 0) {
211
- resultString += '_';
212
- }
315
+ return;
316
+ }, [isFullscreenState]);
213
317
 
214
- resultString += `${key}:${valueString}`;
215
- }
216
-
217
- return resultString;
218
- }
219
- }
318
+ const { style } = props;
319
+ return (
320
+ <FWStoryBlock
321
+ ref={nativeComponentRef}
322
+ key={generateKey()}
323
+ {...props}
324
+ onStoryBlockLoadFinished={handleStoryBlockLoadFinished}
325
+ onStoryBlockFullScreenStateChanged={
326
+ handleStoryBlockFullscreenStateChanged
327
+ }
328
+ style={Object.assign({}, style, { zIndex: -1 })}
329
+ />
330
+ );
331
+ };
220
332
 
221
- export default StoryBlock;
333
+ export default forwardRef(StoryBlock);
@@ -51,6 +51,13 @@ export interface IVideoFeedProps {
51
51
  * The dynamic content parameters of the feed. Required when the source is set as dynamicContent.
52
52
  */
53
53
  dynamicContentParameters?: { [key: string]: string[] };
54
+ /**
55
+ * Hashtag filter expression is an s-expression used to provide feeds filtered by hashtags with specified criteria.
56
+ * Queries are specified with boolean predicates on what hashtags are there on the video.
57
+ * For instance, (and sport food) (or sport food) (and sport (or food comedy)) sport are all valid expressions.
58
+ * Non-UTF-8 characters are not allowed. If using boolean predicates, the expression needs to be wrapped with parenthesis.
59
+ */
60
+ hashtagFilterExpression?: string;
54
61
  /**
55
62
  * One of three available display modes. Defaults to row.
56
63
  */
@@ -170,6 +177,15 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
170
177
  }
171
178
  );
172
179
  this._subscriptions.push(subscriptionOfVideoLaunchBehaviorUpdated);
180
+ const subscriptionOfAppLanguageUpdated =
181
+ FireworkSDKModuleEventEmitter.addListener(
182
+ FWEventName.AppLanguageUpdated,
183
+ () => {
184
+ FWLoggerUtil.log('Receive FWEventName.AppLanguageUpdated');
185
+ this.setState({});
186
+ }
187
+ );
188
+ this._subscriptions.push(subscriptionOfAppLanguageUpdated);
173
189
  }
174
190
 
175
191
  /**
@@ -201,11 +217,12 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
201
217
  mode = 'row',
202
218
  adConfiguration,
203
219
  enablePictureInPicture = false,
220
+ hashtagFilterExpression = '',
204
221
  } = this.props;
205
222
  const videoFeedConfiguration = this._getVideoFeedConfiguration();
206
223
  const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;
207
224
  const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';
208
- const shareBaseURL = FireworkSDK.getInstance().getShareBaseURL() ?? '';
225
+ const gShareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';
209
226
  const adBadgeConfiguration =
210
227
  FireworkSDK.getInstance().getAdBadgeConfiguration() ?? {};
211
228
  const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';
@@ -221,8 +238,8 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
221
238
  const vastAttributesString = this._generateVastAttributesString();
222
239
  const showAdBadge = videoFeedConfiguration?.showAdBadge ?? false;
223
240
  const videoLaunchBehavior =
224
- FireworkSDK.getInstance().getVideoLaunchBehavior() ?? 'default';
225
-
241
+ FireworkSDK.getInstance().videoLaunchBehavior ?? 'default';
242
+ const appLanguage = FireworkSDK.getInstance().appLanguage ?? '';
226
243
  let key = `source:${source}`;
227
244
  key += `_channel:${channel}`;
228
245
  key += `_playlist:${playlist}`;
@@ -230,7 +247,7 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
230
247
  key += `_mode:${mode}`;
231
248
  key += `_titleHidden:${titleHidden}`;
232
249
  key += `_titlePosition:${titlePosition}`;
233
- key += `_shareBaseURL:${shareBaseURL}`;
250
+ key += `_gShareBaseURL:${gShareBaseURL}`;
234
251
  key += `_adBadgeTextType:${adBadgeTextType}`;
235
252
  key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;
236
253
  key += `_textColorOfAdBadge:${textColorOfAdBadge}`;
@@ -243,6 +260,8 @@ class VideoFeed extends React.Component<IVideoFeedProps> {
243
260
  key += `_vastAttributes:${vastAttributesString}`;
244
261
  key += `_showAdBadge:${showAdBadge}`;
245
262
  key += `_videoLaunchBehavior:${videoLaunchBehavior}`;
263
+ key += `_appLanguage:${appLanguage}`;
264
+ key += `_hashtagFilterExpression:${hashtagFilterExpression}`;
246
265
 
247
266
  return (
248
267
  <FWVideoFeed
package/src/index.ts CHANGED
@@ -1,4 +1,7 @@
1
- import type { IStoryBlockProps } from './components/StoryBlock';
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,
@@ -46,13 +48,15 @@ import type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';
46
48
  import type Product from './models/Product';
47
49
  import type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';
48
50
  import type {
49
- AddToCartButtonConfiguration,
50
51
  LinkButtonConfiguration,
52
+ ShoppingCTAButtonConfiguration,
53
+ ShoppingCTAButtonText,
51
54
  } from './models/ProductInfoViewConfiguration';
52
55
  import type ProductUnit from './models/ProductUnit';
53
56
  import type { ProductPrice, ProductUnitOption } from './models/ProductUnit';
54
57
  import type SDKInitOptions from './models/SDKInitOptions';
55
58
  import type { VideoLaunchBehavior } from './models/SDKInitOptions';
59
+ import type ShoppingCTAResult from './models/ShoppingCTAResult';
56
60
  import type { StoryBlockSource } from './models/StoryBlockSource';
57
61
  import type TrackPurchaseParameters from './models/TrackPurchaseParameters';
58
62
  import type VideoFeedConfiguration from './models/VideoFeedConfiguration';
@@ -75,9 +79,9 @@ import type {
75
79
  VideoPlayerStyle,
76
80
  } from './models/VideoPlayerConfiguration';
77
81
  import type {
78
- AddToCartCallback,
79
82
  CustomClickCartIconCallback,
80
83
  CustomClickLinkButtonCallback,
84
+ ShoppingCTACallback,
81
85
  UpdateProductDetailsCallback,
82
86
  } from './VideoShopping';
83
87
  import VideoShopping from './VideoShopping';
@@ -88,10 +92,6 @@ export {
88
92
  AdBadgeConfiguration,
89
93
  AdBadgeTextType,
90
94
  AdConfiguration,
91
- AddToCartButtonConfiguration,
92
- AddToCartCallback,
93
- AddToCartEvent,
94
- AddToCartResult,
95
95
  AndroidFontInfo,
96
96
  CustomClickCartIconCallback,
97
97
  CustomClickLinkButtonCallback,
@@ -105,6 +105,7 @@ export {
105
105
  IOSFontInfo,
106
106
  IOSSystemFontStyle,
107
107
  IOSSystemFontWeight,
108
+ IStoryBlockMethods,
108
109
  IStoryBlockProps,
109
110
  IVideoFeedProps,
110
111
  LinkButtonConfiguration,
@@ -125,6 +126,11 @@ export {
125
126
  SDKInitCallback,
126
127
  SDKInitEvent,
127
128
  SDKInitOptions,
129
+ ShoppingCTAButtonConfiguration,
130
+ ShoppingCTAButtonText,
131
+ ShoppingCTACallback,
132
+ ShoppingCTAEvent,
133
+ ShoppingCTAResult,
128
134
  StoryBlock,
129
135
  StoryBlockSource,
130
136
  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,8 @@ 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',
16
+ NativeAppLanguageUpdated = 'fw:native-app-language-updated',
14
17
  LogMessage = 'fw:log-message',
15
18
  CustomLinkButtonClick = 'fw:shopping:custom-link-button-click',
16
19
  }
@@ -30,7 +30,11 @@ export interface VideoFeedClickEvent {
30
30
  info: FeedItemDetails;
31
31
  }
32
32
 
33
- export interface AddToCartEvent {
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,22 +1,27 @@
1
1
  import type IOSFontInfo from './IOSFontInfo';
2
2
 
3
- export interface AddToCartButtonConfiguration {
3
+ export type ShoppingCTAButtonText = 'addToCart' | 'shopNow';
4
+
5
+ export interface ShoppingCTAButtonConfiguration {
6
+ /**
7
+ * The text of shopping CTA button.
8
+ */
9
+ text?: ShoppingCTAButtonText;
4
10
  /**
5
- * The background color of "Add to cart" button.
11
+ * The background color of CTA button.
6
12
  */
7
13
  backgroundColor?: string;
8
14
  /**
9
- * The text color of "Add to cart" button.
15
+ * The text color of CTA button.
10
16
  */
11
17
  textColor?: string;
12
18
  /**
13
- * The font size of "Add to cart" button.
19
+ * The font size of CTA button.
14
20
  */
15
21
  fontSize?: number;
16
22
  /**
17
23
  * The iOS font info of "Add to cart" button.
18
24
  * The property is ignored when fontSize is not set.
19
- * Only supported on iOS.
20
25
  */
21
26
  iOSFontInfo?: IOSFontInfo;
22
27
  }
@@ -27,11 +32,11 @@ export interface LinkButtonConfiguration {
27
32
 
28
33
  export default interface ProductInfoViewConfiguration {
29
34
  /**
30
- * Configuration of "Add to cart" button. Only supported on iOS.
35
+ * Configuration of shopping CTA button. Only supported on iOS.
31
36
  */
32
- addToCartButton?: AddToCartButtonConfiguration;
37
+ ctaButton?: ShoppingCTAButtonConfiguration;
33
38
  /**
34
- * Configuration of link button next to "Add to cart" button. Only supported on iOS.
39
+ * Configuration of link button next to "Add to cart" button.
35
40
  */
36
41
  linkButton?: LinkButtonConfiguration;
37
42
  }
@@ -1,7 +1,12 @@
1
1
  export type VideoLaunchBehavior = 'default' | 'muteOnFirstLaunch';
2
2
 
3
3
  export default interface SDKInitOptions {
4
+ /**
5
+ * Custom value to identify the current user.
6
+ */
4
7
  userId?: string;
5
- shareBaseURL?: string;
8
+ /**
9
+ * Behavior occurring after video is launched.
10
+ */
6
11
  videoLaunchBehavior?: VideoLaunchBehavior;
7
12
  }
@@ -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
+ }