react-native-firework-sdk 2.7.1 → 2.8.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.
Files changed (73) hide show
  1. package/FireworkVideoUI.xcframework/Info.plist +5 -5
  2. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  3. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Info.plist +0 -0
  4. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  5. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Info.plist +0 -0
  6. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +1 -1
  7. package/ios/Components/StoryBlock.swift +86 -6
  8. package/ios/Components/StoryBlockConfiguration.swift +1 -0
  9. package/ios/Components/StoryBlockManager.m +4 -0
  10. package/ios/Components/VideoFeed.swift +90 -13
  11. package/ios/Components/VideoFeedManager.m +4 -0
  12. package/ios/Components/VideoPlayerConfiguration.swift +1 -0
  13. package/ios/Components/VideoPlayerLogoConfiguration.swift +18 -0
  14. package/ios/FireworkVideoUI/Podfile +1 -1
  15. package/ios/FireworkVideoUI/Podfile.lock +4 -4
  16. package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +71 -8
  17. package/ios/Modules/FWNavigatorModule/FWRNPresentContainerViewController.swift +30 -0
  18. package/ios/Modules/FireworkSDKModule/FireworkSDKModule+CTA.swift +23 -2
  19. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +2 -0
  20. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +3 -0
  21. package/ios/Modules/Shopping/ProductInfoViewConfiguration.swift +41 -8
  22. package/ios/Modules/Shopping/ShoppingModule.m +2 -0
  23. package/ios/Modules/Shopping/ShoppingModule.swift +163 -2
  24. package/lib/commonjs/FireworkSDK.js +16 -0
  25. package/lib/commonjs/FireworkSDK.js.map +1 -1
  26. package/lib/commonjs/VideoShopping.js +21 -1
  27. package/lib/commonjs/VideoShopping.js.map +1 -1
  28. package/lib/commonjs/components/StoryBlock.js +71 -0
  29. package/lib/commonjs/components/StoryBlock.js.map +1 -1
  30. package/lib/commonjs/components/VideoFeed.js +76 -1
  31. package/lib/commonjs/components/VideoFeed.js.map +1 -1
  32. package/lib/commonjs/index.js.map +1 -1
  33. package/lib/commonjs/models/VideoPlayerLogoConfiguration.js +2 -0
  34. package/lib/commonjs/models/VideoPlayerLogoConfiguration.js.map +1 -0
  35. package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
  36. package/lib/commonjs/modules/ShoppingModule.js.map +1 -1
  37. package/lib/module/FireworkSDK.js +15 -0
  38. package/lib/module/FireworkSDK.js.map +1 -1
  39. package/lib/module/VideoShopping.js +22 -1
  40. package/lib/module/VideoShopping.js.map +1 -1
  41. package/lib/module/components/StoryBlock.js +69 -0
  42. package/lib/module/components/StoryBlock.js.map +1 -1
  43. package/lib/module/components/VideoFeed.js +74 -1
  44. package/lib/module/components/VideoFeed.js.map +1 -1
  45. package/lib/module/index.js.map +1 -1
  46. package/lib/module/models/VideoPlayerLogoConfiguration.js +2 -0
  47. package/lib/module/models/VideoPlayerLogoConfiguration.js.map +1 -0
  48. package/lib/module/modules/FireworkSDKModule.js.map +1 -1
  49. package/lib/module/modules/ShoppingModule.js.map +1 -1
  50. package/lib/typescript/components/StoryBlock.d.ts +12 -1
  51. package/lib/typescript/components/VideoFeed.d.ts +12 -1
  52. package/lib/typescript/index.d.ts +3 -2
  53. package/lib/typescript/models/FWEvents.d.ts +21 -0
  54. package/lib/typescript/models/ProductInfoViewConfiguration.d.ts +110 -5
  55. package/lib/typescript/models/StoryBlockConfiguration.d.ts +7 -0
  56. package/lib/typescript/models/VideoPlayerConfiguration.d.ts +7 -0
  57. package/lib/typescript/models/VideoPlayerLogoConfiguration.d.ts +15 -0
  58. package/lib/typescript/modules/FireworkSDKModule.d.ts +2 -0
  59. package/lib/typescript/modules/ShoppingModule.d.ts +2 -0
  60. package/package.json +1 -1
  61. package/react-native-firework-sdk.podspec +1 -1
  62. package/src/FireworkSDK.ts +16 -0
  63. package/src/VideoShopping.ts +18 -1
  64. package/src/components/StoryBlock.tsx +92 -3
  65. package/src/components/VideoFeed.tsx +93 -2
  66. package/src/index.ts +14 -0
  67. package/src/models/FWEvents.ts +24 -0
  68. package/src/models/ProductInfoViewConfiguration.ts +114 -5
  69. package/src/models/StoryBlockConfiguration.ts +7 -0
  70. package/src/models/VideoPlayerConfiguration.ts +7 -0
  71. package/src/models/VideoPlayerLogoConfiguration.ts +23 -0
  72. package/src/modules/FireworkSDKModule.ts +2 -0
  73. package/src/modules/ShoppingModule.ts +2 -0
@@ -201,8 +201,24 @@ class FireworkSDK {
201
201
 
202
202
  this.eventEmitter.addListener(FWEventName.CustomCTAClick, (event) => {
203
203
  FWLoggerUtil.log(`Receive CustomCTAClick url: ${event?.url}`);
204
+ FWLoggerUtil.log(
205
+ `Receive CustomCTAClick callbackId: ${event?.callbackId}`
206
+ );
204
207
 
205
208
  if (this.onCustomCTAClick) {
209
+ if (event) {
210
+ if (event.callbackId) {
211
+ const callbackId = event.callbackId;
212
+ delete event.callbackId;
213
+ if (Platform.OS === 'ios') {
214
+ event.playerHandler = {
215
+ pause: () => FireworkSDKModule.pausePlayer(callbackId),
216
+ resume: () => FireworkSDKModule.resumePlayer(callbackId),
217
+ };
218
+ }
219
+ }
220
+ }
221
+
206
222
  this.onCustomCTAClick(event ?? {});
207
223
  }
208
224
  });
@@ -202,7 +202,24 @@ class VideoShopping {
202
202
 
203
203
  this.eventEmitter.addListener(FWEventName.CustomProductCardTap, (event) => {
204
204
  FWLoggerUtil.log(`Receive CustomProductCardTap event url: ${event?.url}`);
205
- this.handleCustomProductCardTapEvent(event);
205
+ if (event) {
206
+ if (!event.video) {
207
+ event.video = { videoId: '' };
208
+ }
209
+
210
+ if (event.callbackId) {
211
+ const callbackId = event.callbackId;
212
+ delete event.callbackId;
213
+ if (Platform.OS === 'ios') {
214
+ event.playerHandler = {
215
+ pause: () => ShoppingModule.pausePlayer(callbackId),
216
+ resume: () => ShoppingModule.resumePlayer(callbackId),
217
+ };
218
+ }
219
+ }
220
+ }
221
+
222
+ this.handleCustomProductCardTapEvent(event ?? {});
206
223
  });
207
224
  }
208
225
 
@@ -29,6 +29,7 @@ import { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';
29
29
  import FWGlobalState from '../utils/FWGlobalState';
30
30
  import FWLoggerUtil from '../utils/FWLoggerUtil';
31
31
  import FWStoryBlock from './FWStoryBlock';
32
+ import type ButtonInfo from '../models/ButtonInfo';
32
33
 
33
34
  const NativeComponentName = 'FWStoryBlock';
34
35
 
@@ -79,7 +80,7 @@ export interface IStoryBlockProps {
79
80
  */
80
81
  productIds?: string[];
81
82
  /**
82
- * The video or live stream id. Only supported on iOS.
83
+ * The video or live stream id.
83
84
  */
84
85
  contentId?: string;
85
86
  /**
@@ -95,13 +96,22 @@ export interface IStoryBlockProps {
95
96
  */
96
97
  adConfiguration?: AdConfiguration;
97
98
 
98
- /* The configuration of the story block.
99
- Only supported on Android.*/
99
+ /**
100
+ * The configuration of the story block.
101
+ */
100
102
  storyBlockConfiguration?: StoryBlockConfiguration;
101
103
  /**
102
104
  * The feed loading result callback. It means loading successfully when error equals to undefined.
103
105
  */
104
106
  onStoryBlockLoadFinished?: (error?: FWError) => void;
107
+ /**
108
+ * Start Picture in Picture callback. Only supported on iOS.
109
+ */
110
+ onStoryBlockDidStartPictureInPicture?: (error?: FWError) => void;
111
+ /**
112
+ * Stop Picture in Picture callback. Only supported on iOS.
113
+ */
114
+ onStoryBlockDidStopPictureInPicture?: (error?: FWError) => void;
105
115
  }
106
116
 
107
117
  const StoryBlock: ForwardRefRenderFunction<
@@ -136,6 +146,56 @@ const StoryBlock: ForwardRefRenderFunction<
136
146
  }
137
147
  };
138
148
 
149
+ const handleStoryBlockDidStartPictureInPicture = (
150
+ event: NativeSyntheticEvent<any>
151
+ ) => {
152
+ FWLoggerUtil.log(
153
+ `StoryBlock handleStoryBlockDidStartPictureInPicture ${JSON.stringify(
154
+ event.nativeEvent
155
+ )}`
156
+ );
157
+ const { onStoryBlockDidStartPictureInPicture } = props;
158
+
159
+ const { name, reason } = event.nativeEvent;
160
+
161
+ if (onStoryBlockDidStartPictureInPicture) {
162
+ if (name) {
163
+ if (reason) {
164
+ onStoryBlockDidStartPictureInPicture({ name, reason });
165
+ } else {
166
+ onStoryBlockDidStartPictureInPicture({ name });
167
+ }
168
+ } else {
169
+ onStoryBlockDidStartPictureInPicture();
170
+ }
171
+ }
172
+ };
173
+
174
+ const handleStoryBlockDidStopPictureInPicture = (
175
+ event: NativeSyntheticEvent<any>
176
+ ) => {
177
+ FWLoggerUtil.log(
178
+ `StoryBlock handleStoryBlockDidStopPictureInPicture ${JSON.stringify(
179
+ event.nativeEvent
180
+ )}`
181
+ );
182
+ const { onStoryBlockDidStopPictureInPicture } = props;
183
+
184
+ const { name, reason } = event.nativeEvent;
185
+
186
+ if (onStoryBlockDidStopPictureInPicture) {
187
+ if (name) {
188
+ if (reason) {
189
+ onStoryBlockDidStopPictureInPicture({ name, reason });
190
+ } else {
191
+ onStoryBlockDidStopPictureInPicture({ name });
192
+ }
193
+ } else {
194
+ onStoryBlockDidStopPictureInPicture();
195
+ }
196
+ }
197
+ };
198
+
139
199
  const handleStoryBlockFullScreenStateChanged = (
140
200
  event: NativeSyntheticEvent<any>
141
201
  ) => {
@@ -186,6 +246,10 @@ const StoryBlock: ForwardRefRenderFunction<
186
246
  return resultString;
187
247
  };
188
248
 
249
+ const generateButtonInfoString = (buttonInfo?: ButtonInfo) => {
250
+ return `imageName:${buttonInfo?.imageName}_systemImageName:${buttonInfo?.systemImageName}_tintColor:${buttonInfo?.tintColor}`;
251
+ };
252
+
189
253
  const getStoryBlockConfiguration: () =>
190
254
  | StoryBlockNativeConfiguration
191
255
  | undefined = () => {
@@ -246,6 +310,7 @@ const StoryBlock: ForwardRefRenderFunction<
246
310
  const ctaHighlightDelayValue =
247
311
  storyBlockConfiguration?.ctaHighlightDelay?.value?.toFixed(5);
248
312
  const shareBaseURL = storyBlockConfiguration?.shareBaseURL;
313
+ const buttonConfiguration = storyBlockConfiguration?.buttonConfiguration;
249
314
  const ctaWidth = storyBlockConfiguration?.ctaWidth;
250
315
  const showVideoDetailTitle = storyBlockConfiguration?.showVideoDetailTitle;
251
316
 
@@ -288,6 +353,24 @@ const StoryBlock: ForwardRefRenderFunction<
288
353
  key += `_ctaHighlightDelayType:${ctaHighlightDelayType}`;
289
354
  key += `_ctaHighlightDelayValue:${ctaHighlightDelayValue}`;
290
355
  key += `_ctaWidth:${ctaWidth}`;
356
+ key += `_buttonConfiguration.videoDetailButton:${generateButtonInfoString(
357
+ buttonConfiguration?.videoDetailButton
358
+ )}`;
359
+ key += `_buttonConfiguration.closeButton:${generateButtonInfoString(
360
+ buttonConfiguration?.closeButton
361
+ )}`;
362
+ key += `_buttonConfiguration.muteButton:${generateButtonInfoString(
363
+ buttonConfiguration?.muteButton
364
+ )}`;
365
+ key += `_buttonConfiguration.unmuteButton:${generateButtonInfoString(
366
+ buttonConfiguration?.unmuteButton
367
+ )}`;
368
+ key += `_buttonConfiguration.playButton:${generateButtonInfoString(
369
+ buttonConfiguration?.playButton
370
+ )}`;
371
+ key += `_buttonConfiguration.pauseButton:${generateButtonInfoString(
372
+ buttonConfiguration?.pauseButton
373
+ )}`;
291
374
  key += `_showVideoDetailTitle:${showVideoDetailTitle}`;
292
375
 
293
376
  key += `_requiresAds:${requiresAds}`;
@@ -432,6 +515,12 @@ const StoryBlock: ForwardRefRenderFunction<
432
515
  storyBlockConfiguration={storyBlockConfiguration}
433
516
  enablePictureInPicture={undefined}
434
517
  onStoryBlockLoadFinished={handleStoryBlockLoadFinished}
518
+ onStoryBlockDidStartPictureInPicture={
519
+ handleStoryBlockDidStartPictureInPicture
520
+ }
521
+ onStoryBlockDidStopPictureInPicture={
522
+ handleStoryBlockDidStopPictureInPicture
523
+ }
435
524
  onStoryBlockFullScreenStateChanged={
436
525
  handleStoryBlockFullScreenStateChanged
437
526
  }
@@ -22,6 +22,7 @@ import FWGlobalState from '../utils/FWGlobalState';
22
22
  import FWLoggerUtil from '../utils/FWLoggerUtil';
23
23
  import FWVideoFeed from './FWVideoFeed';
24
24
  import type VideoPlayerNativeConfiguration from '../models/VideoPlayerNativeConfiguration';
25
+ import type ButtonInfo from '../models/ButtonInfo';
25
26
 
26
27
  export type VideoFeedMode = 'row' | 'column' | 'grid';
27
28
 
@@ -91,9 +92,17 @@ export interface IVideoFeedProps {
91
92
  */
92
93
  adConfiguration?: AdConfiguration;
93
94
  /**
94
- * The feed loading result callback. It means loading successfully when error equals to undefined. Only supported on iOS.
95
+ * The feed loading result callback. It means loading successfully when error equals to undefined.
95
96
  */
96
97
  onVideoFeedLoadFinished?: (error?: FWError) => void;
98
+ /**
99
+ * Start Picture in Picture callback. Only supported on iOS.
100
+ */
101
+ onVideoFeedDidStartPictureInPicture?: (error?: FWError) => void;
102
+ /**
103
+ * Stop Picture in Picture callback. Only supported on iOS.
104
+ */
105
+ onVideoFeedDidStopPictureInPicture?: (error?: FWError) => void;
97
106
  }
98
107
 
99
108
  interface IVideoFeedState {
@@ -163,6 +172,56 @@ class VideoFeed extends React.Component<IVideoFeedProps, IVideoFeedState> {
163
172
  }
164
173
  };
165
174
 
175
+ private _onVideoFeedDidStartPictureInPicture = (
176
+ event: NativeSyntheticEvent<any>
177
+ ) => {
178
+ FWLoggerUtil.log(
179
+ `VideoFeed _onVideoFeedDidStartPictureInPicture ${JSON.stringify(
180
+ event.nativeEvent
181
+ )}`
182
+ );
183
+ const { onVideoFeedDidStartPictureInPicture } = this.props;
184
+
185
+ const { name, reason } = event.nativeEvent;
186
+
187
+ if (onVideoFeedDidStartPictureInPicture) {
188
+ if (name) {
189
+ if (reason) {
190
+ onVideoFeedDidStartPictureInPicture({ name, reason });
191
+ } else {
192
+ onVideoFeedDidStartPictureInPicture({ name });
193
+ }
194
+ } else {
195
+ onVideoFeedDidStartPictureInPicture();
196
+ }
197
+ }
198
+ };
199
+
200
+ private _onVideoFeedDidStopPictureInPicture = (
201
+ event: NativeSyntheticEvent<any>
202
+ ) => {
203
+ FWLoggerUtil.log(
204
+ `VideoFeed _onVideoFeedDidStopPictureInPicture ${JSON.stringify(
205
+ event.nativeEvent
206
+ )}`
207
+ );
208
+ const { onVideoFeedDidStopPictureInPicture } = this.props;
209
+
210
+ const { name, reason } = event.nativeEvent;
211
+
212
+ if (onVideoFeedDidStopPictureInPicture) {
213
+ if (name) {
214
+ if (reason) {
215
+ onVideoFeedDidStopPictureInPicture({ name, reason });
216
+ } else {
217
+ onVideoFeedDidStopPictureInPicture({ name });
218
+ }
219
+ } else {
220
+ onVideoFeedDidStopPictureInPicture();
221
+ }
222
+ }
223
+ };
224
+
166
225
  /**
167
226
  * @ignore
168
227
  */
@@ -309,7 +368,8 @@ class VideoFeed extends React.Component<IVideoFeedProps, IVideoFeedState> {
309
368
  videoPlayerConfiguration?.ctaHighlightDelay?.value?.toFixed(5);
310
369
  const shareBaseURL = videoPlayerConfiguration?.shareBaseURL;
311
370
  const ctaWidth = videoPlayerConfiguration?.ctaWidth;
312
-
371
+ const buttonConfiguration = videoPlayerConfiguration?.buttonConfiguration;
372
+ const showVideoDetailTitle = videoPlayerConfiguration?.showVideoDetailTitle;
313
373
  const requiresAds = adConfiguration?.requiresAds;
314
374
  const adsFetchTimeout = adConfiguration?.adsFetchTimeout;
315
375
  const vastAttributesString = this._generateVastAttributesString();
@@ -372,7 +432,28 @@ class VideoFeed extends React.Component<IVideoFeedProps, IVideoFeedState> {
372
432
  key += `_ctaHighlightDelayType:${ctaHighlightDelayType}`;
373
433
  key += `_ctaHighlightDelayValue:${ctaHighlightDelayValue}`;
374
434
  key += `_ctaWidth:${ctaWidth}`;
435
+ key += `_buttonConfiguration.videoDetailButton:${this._generateButtonInfoString(
436
+ buttonConfiguration?.videoDetailButton
437
+ )}`;
438
+ key += `_buttonConfiguration.closeButton:${this._generateButtonInfoString(
439
+ buttonConfiguration?.closeButton
440
+ )}`;
441
+ key += `_buttonConfiguration.muteButton:${this._generateButtonInfoString(
442
+ buttonConfiguration?.muteButton
443
+ )}`;
444
+ key += `_buttonConfiguration.unmuteButton:${this._generateButtonInfoString(
445
+ buttonConfiguration?.unmuteButton
446
+ )}`;
447
+ key += `_buttonConfiguration.playButton:${this._generateButtonInfoString(
448
+ buttonConfiguration?.playButton
449
+ )}`;
450
+ key += `_buttonConfiguration.pauseButton:${this._generateButtonInfoString(
451
+ buttonConfiguration?.pauseButton
452
+ )}`;
453
+ key += `_showVideoDetailTitle:${showVideoDetailTitle}`;
375
454
  }
455
+ // key += `_videoPlayerLogoConfiguration.option:${videoPlayerLogoConfigurationOption}`;
456
+ // key += `_videoPlayerLogoConfiguration.encodeId:${videoPlayerLogoConfigurationEncodeId}`;
376
457
 
377
458
  key += `_requiresAds:${requiresAds}`;
378
459
  key += `_adsFetchTimeout:${adsFetchTimeout}`;
@@ -387,6 +468,12 @@ class VideoFeed extends React.Component<IVideoFeedProps, IVideoFeedState> {
387
468
  videoPlayerConfiguration={videoPlayerConfiguration}
388
469
  ref={this._nativeComponentRef}
389
470
  onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}
471
+ onVideoFeedDidStartPictureInPicture={
472
+ this._onVideoFeedDidStartPictureInPicture
473
+ }
474
+ onVideoFeedDidStopPictureInPicture={
475
+ this._onVideoFeedDidStopPictureInPicture
476
+ }
390
477
  mode={mode ?? 'row'}
391
478
  />
392
479
  );
@@ -431,6 +518,10 @@ class VideoFeed extends React.Component<IVideoFeedProps, IVideoFeedState> {
431
518
  return resultString;
432
519
  }
433
520
 
521
+ private _generateButtonInfoString(buttonInfo?: ButtonInfo): string {
522
+ return `imageName:${buttonInfo?.imageName}_systemImageName:${buttonInfo?.systemImageName}_tintColor:${buttonInfo?.tintColor}`;
523
+ }
524
+
434
525
  private _getVideoFeedConfiguration(): VideoFeedConfiguration | undefined {
435
526
  const { videoFeedConfiguration } = this.props;
436
527
  if (!videoFeedConfiguration) {
package/src/index.ts CHANGED
@@ -55,8 +55,12 @@ import type ProductInfoViewConfiguration from './models/ProductInfoViewConfigura
55
55
  import type {
56
56
  LinkButtonConfiguration,
57
57
  ProductCardConfiguration,
58
+ ProductCardCTAButtonStyle,
58
59
  ProductCardCTAButtonText,
60
+ ProductCardIconConfiguration,
61
+ ProductCardLabelConfiguration,
59
62
  ProductCardPriceConfiguration,
63
+ ProductCardPriceLabelAxis,
60
64
  ProductCardTheme,
61
65
  ShoppingCTAButtonConfiguration,
62
66
  ShoppingCTAButtonText,
@@ -91,6 +95,10 @@ import type {
91
95
  } from './models/VideoPlayerCTADelay';
92
96
  import type { VideoPlayerCTAStyle } from './models/VideoPlayerCTAStyle';
93
97
  import type { VideoPlayerCTAWidth } from './models/VideoPlayerCTAWidth';
98
+ import type {
99
+ VideoPlayerLogoConfiguration,
100
+ VideoPlayerLogoOption,
101
+ } from './models/VideoPlayerLogoConfiguration';
94
102
  import type { VideoPlayerStyle } from './models/VideoPlayerStyle';
95
103
  import type {
96
104
  CustomClickCartIconCallback,
@@ -141,8 +149,12 @@ export {
141
149
  OpenVideoPlayerConfiguration,
142
150
  Product,
143
151
  ProductCardConfiguration,
152
+ ProductCardCTAButtonStyle,
144
153
  ProductCardCTAButtonText,
154
+ ProductCardIconConfiguration,
155
+ ProductCardLabelConfiguration,
145
156
  ProductCardPriceConfiguration,
157
+ ProductCardPriceLabelAxis,
146
158
  ProductCardTheme,
147
159
  ProductInfoViewConfiguration,
148
160
  ProductPrice,
@@ -187,6 +199,8 @@ export {
187
199
  VideoPlayerCTADelayType,
188
200
  VideoPlayerCTAStyle,
189
201
  VideoPlayerCTAWidth,
202
+ VideoPlayerLogoConfiguration,
203
+ VideoPlayerLogoOption,
190
204
  VideoPlayerSize,
191
205
  VideoPlayerStyle,
192
206
  VideoShopping,
@@ -14,11 +14,31 @@ export interface SDKInitEvent {
14
14
  error?: FWError | null;
15
15
  }
16
16
 
17
+ export interface PlayerHandler {
18
+ /**
19
+ * Pause the video playback associated with this CTA.
20
+ * Only supported on iOS
21
+ */
22
+ pause: () => void;
23
+
24
+ /**
25
+ * Resume the video playback associated with this CTA.
26
+ * Only supported on iOS
27
+ */
28
+ resume: () => void;
29
+ }
30
+
17
31
  export interface CustomCTAClickEvent {
18
32
  /**
19
33
  * Action URL that is associated with this CTA
20
34
  */
21
35
  url: string;
36
+
37
+ /**
38
+ * The video playback pause/resume handler for the video.
39
+ * Only supported on iOS
40
+ */
41
+ playerHandler?: PlayerHandler;
22
42
  }
23
43
 
24
44
  export interface VideoPlaybackEvent {
@@ -84,6 +104,10 @@ export interface CustomTapProductCardEvent {
84
104
  * the video playback details that the product unit belongs to.
85
105
  */
86
106
  video: VideoPlaybackDetails;
107
+ /**
108
+ * The video playback pause/resume handler for the video.
109
+ */
110
+ playerHandler?: PlayerHandler;
87
111
  }
88
112
 
89
113
  export interface LiveStreamEvent {
@@ -35,14 +35,89 @@ export type ProductCardCTAButtonText = 'shopNow' | 'buyNow';
35
35
  export type ProductCardTheme = 'dark' | 'light';
36
36
 
37
37
  export interface ProductCardPriceConfiguration {
38
+ /**
39
+ * Hide the price label or not.
40
+ * @deprecated This property has no effect on iOS.
41
+ */
38
42
  isHidden?: boolean;
43
+ /**
44
+ * The axis of price label.
45
+ * Default to 'horizontal'.
46
+ * Only supported on iOS.
47
+ */
48
+ axis?: ProductCardPriceLabelAxis;
49
+ /**
50
+ * The label configuration of price.
51
+ * Only supported on iOS.
52
+ */
53
+ priceLabel?: ProductCardLabelConfiguration;
54
+ /**
55
+ * The label configuration of original price.
56
+ * Only supported on iOS.
57
+ */
58
+ originalPriceLabel?: ProductCardLabelConfiguration;
59
+ /**
60
+ * The default display order is [priceLabel, originalPriceLabel]. When the value is `true`, the order is reversed.
61
+ * Only supported on iOS.
62
+ */
63
+ isPriceFirst?: boolean;
39
64
  }
40
65
 
41
- export interface ProductCardConfiguration {
66
+ export type ProductCardPriceLabelAxis = 'horizontal' | 'vertical';
67
+
68
+ export interface ProductCardLabelConfiguration {
42
69
  /**
43
- * The text of shopping CTA button.
70
+ * The text color of label.
71
+ * Only supported on iOS.
44
72
  */
45
- ctaButtonText?: ProductCardCTAButtonText;
73
+ textColor?: string;
74
+ /**
75
+ * The font size of label.
76
+ * Only supported on iOS.
77
+ */
78
+ fontSize?: number;
79
+ /**
80
+ * Number of lines to show.
81
+ * Only supported on iOS.
82
+ * Default to 1.
83
+ */
84
+ numberOfLines?: number;
85
+ /**
86
+ * The iOS font info.
87
+ * The property is ignored when fontSize is not set.
88
+ * Only supported on iOS.
89
+ */
90
+ iOSFontInfo?: IOSFontInfo;
91
+ }
92
+
93
+ export interface ProductCardCTAButtonStyle {
94
+ /**
95
+ * The text color of CTA button.
96
+ * Only supported on iOS.
97
+ */
98
+ textColor?: string;
99
+ /**
100
+ * The font size of CTA button.
101
+ * Only supported on iOS.
102
+ */
103
+ fontSize?: number;
104
+ /**
105
+ * The iOS font info.
106
+ * The property is ignored when fontSize is not set.
107
+ * Only supported on iOS.
108
+ */
109
+ iOSFontInfo?: IOSFontInfo;
110
+ }
111
+
112
+ export interface ProductCardIconConfiguration {
113
+ /**
114
+ * The corner radius of icon.
115
+ * Only supported on iOS.
116
+ */
117
+ cornerRadius?: number;
118
+ }
119
+
120
+ export interface ProductCardConfiguration {
46
121
  /**
47
122
  * The theme of product card.
48
123
  */
@@ -51,14 +126,48 @@ export interface ProductCardConfiguration {
51
126
  * The corner radius of product card.
52
127
  */
53
128
  cornerRadius?: number;
129
+ /**
130
+ * CTA button is hidden or not.
131
+ */
132
+ isCtaButtonHidden?: boolean;
133
+ /**
134
+ * The text of shopping CTA button.
135
+ */
136
+ ctaButtonText?: ProductCardCTAButtonText;
137
+ /**
138
+ * The cta button style of product card.
139
+ * Only supported on iOS.
140
+ */
141
+ ctaButtonStyle?: ProductCardCTAButtonStyle;
54
142
  /**
55
143
  * Price is hidden or not.
56
144
  */
57
145
  priceConfiguration?: ProductCardPriceConfiguration;
58
146
  /**
59
- * CTA button is hidden or not.
147
+ * The width of product card.
148
+ * Only supported on iOS.
60
149
  */
61
- isCtaButtonHidden?: boolean;
150
+ width?: number;
151
+ /**
152
+ * The height of product card.
153
+ * Only supported on iOS.
154
+ */
155
+ height?: number;
156
+ /**
157
+ * The background color of product card.
158
+ * Only supported on iOS.
159
+ */
160
+ backgroundColor?: string;
161
+ /**
162
+ * The icon configuration of product card.
163
+ * Only supported on iOS.
164
+ */
165
+ iconConfiguration?: ProductCardIconConfiguration;
166
+ /**
167
+ * The label configuration of product card.
168
+ * Only supported on iOS.
169
+ */
170
+ nameLabel?: ProductCardLabelConfiguration;
62
171
  }
63
172
 
64
173
  export default interface ProductInfoViewConfiguration {
@@ -3,6 +3,7 @@ import type { VideoPlayerCTADelay } from './VideoPlayerCTADelay';
3
3
  import type { VideoPlayerCTAStyle } from './VideoPlayerCTAStyle';
4
4
  import type { VideoPlayerCTAWidth } from './VideoPlayerCTAWidth';
5
5
  import type { VideoPlayerCompleteAction } from './VideoPlayerCompleteAction';
6
+ import type { VideoPlayerLogoConfiguration } from './VideoPlayerLogoConfiguration';
6
7
  import type { VideoPlayerStyle } from './VideoPlayerStyle';
7
8
 
8
9
  export interface StoryBlockConfiguration {
@@ -71,4 +72,10 @@ export interface StoryBlockConfiguration {
71
72
  * Only supported on ios.
72
73
  */
73
74
  showVideoDetailTitle?: boolean;
75
+ /**
76
+ * Specifies the logo configuration
77
+ * Defaults to { option: 'disabled' }
78
+ * Only supported on iOS.
79
+ */
80
+ videoPlayerLogoConfiguration?: VideoPlayerLogoConfiguration;
74
81
  }
@@ -4,6 +4,7 @@ import type { VideoPlayerCTAStyle } from './VideoPlayerCTAStyle';
4
4
  import type { VideoPlayerCTAWidth } from './VideoPlayerCTAWidth';
5
5
  import type { VideoPlayerCompleteAction } from './VideoPlayerCompleteAction';
6
6
  import type { VideoPlayerStyle } from './VideoPlayerStyle';
7
+ import type { VideoPlayerLogoConfiguration } from './VideoPlayerLogoConfiguration';
7
8
 
8
9
  export default interface VideoPlayerConfiguration {
9
10
  /**
@@ -69,4 +70,10 @@ export default interface VideoPlayerConfiguration {
69
70
  * Only supported on iOS.
70
71
  */
71
72
  showVideoDetailTitle?: boolean;
73
+ /**
74
+ * Specifies the logo configuration
75
+ * Defaults to { option: 'disabled' }
76
+ * Only supported on iOS.
77
+ */
78
+ videoPlayerLogoConfiguration?: VideoPlayerLogoConfiguration;
72
79
  }
@@ -0,0 +1,23 @@
1
+ // Specifies the configuration of the media's logo on the player
2
+ // Only supported on iOS.
3
+ export interface VideoPlayerLogoConfiguration {
4
+ /**
5
+ * Specifies the logo type.
6
+ * Defaults to 'disabled'.
7
+ * Only supported on iOS.
8
+ */
9
+ option: VideoPlayerLogoOption;
10
+ /**
11
+ * Specifies the logo encoding id.
12
+ * Required when option is 'creator' or 'channelAggregator'.
13
+ * Only supported on iOS.
14
+ */
15
+ encodedId?: string;
16
+ }
17
+
18
+ // Specifies the logo option
19
+ // Only supported on iOS.
20
+ export type VideoPlayerLogoOption =
21
+ | 'disabled'
22
+ | 'creator'
23
+ | 'channelAggregator';
@@ -27,6 +27,8 @@ interface IFireworkSDKModule extends NativeModule {
27
27
  setAdBadgeConfiguration(config?: AdBadgeConfiguration): Promise<any>;
28
28
  trackPurchase(parameters: TrackPurchaseParameters): void;
29
29
  changeAppLanguage(language?: string | null): Promise<boolean>;
30
+ pausePlayer(callbackId: number | string): void; // Only supported on iOS
31
+ resumePlayer(callbackId: number | string): void; // Only supported on iOS
30
32
  }
31
33
 
32
34
  const FireworkSDKModuleEventEmitter = new NativeEventEmitter(FireworkSDKModule);
@@ -29,6 +29,8 @@ interface IShoppingModule extends NativeModule {
29
29
  setProductInfoViewConfiguration(config: ProductInfoViewConfiguration): void;
30
30
  setCustomClickLinkButtonEnabled(enabled: boolean): Promise<any>;
31
31
  setCustomTapProductCardEnabled(enabled: boolean): Promise<any>; // Only supported on iOS
32
+ pausePlayer(callbackId: number | string): void; // Only supported on iOS
33
+ resumePlayer(callbackId: number | string): void; // Only supported on iOS
32
34
  }
33
35
 
34
36
  const ShoppingModuleEventEmitter = new NativeEventEmitter(ShoppingModule);