react-native-firework-sdk 2.14.2 → 2.15.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/gradle.properties +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/components/storyblock/StoryBlockFragment.kt +14 -4
- package/android/src/main/java/com/fireworksdk/bridge/models/FWActionButtonDeserializer.kt +27 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWActionButtonModel.kt +8 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWActionButtonSerializer.kt +21 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWLiveStreamEventDetailsModel.kt +2 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWPlayerButtonConfigurationDeserializer.kt +3 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWPlayerButtonConfigurationModel.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWPlayerButtonConfigurationSerializer.kt +2 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWShape.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedItemDetailsModel.kt +2 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlaybackDetails.kt +2 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +6 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt +23 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelSerializer.kt +14 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWEventName.kt +3 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWLivestreamPlayerVersion.kt +6 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +4 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FireworkSDKInterface.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +3 -3
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +14 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +156 -3
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWGlobalDataUtil.kt +6 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWModelUtils.kt +32 -0
- package/ios/Components/StoryBlock.swift +10 -2
- package/ios/Components/VideoFeed.swift +12 -29
- package/ios/Components/VideoFeedManager.swift +0 -5
- package/ios/Models/NativeToRN/FireworkEventName.swift +3 -1
- package/ios/Models/RNToNative/RCTConvert+FireworkSDKModule.swift +13 -0
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +42 -5
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +2 -1
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +16 -0
- package/ios/Modules/Shopping/ShoppingModule.swift +1 -1
- package/lib/commonjs/FireworkSDK.js +41 -14
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/components/StoryBlock.js +21 -0
- package/lib/commonjs/components/StoryBlock.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +23 -0
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js +8 -0
- 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/LivestreamPlayerDesignVersion.js +16 -0
- package/lib/commonjs/models/LivestreamPlayerDesignVersion.js.map +1 -0
- package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
- package/lib/module/FireworkSDK.js +38 -14
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/components/StoryBlock.js +14 -0
- package/lib/module/components/StoryBlock.js.map +1 -1
- package/lib/module/components/VideoFeed.js +18 -0
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js +2 -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/LivestreamPlayerDesignVersion.js +9 -0
- package/lib/module/models/LivestreamPlayerDesignVersion.js.map +1 -0
- package/lib/module/modules/FireworkSDKModule.js.map +1 -1
- package/lib/typescript/FireworkSDK.d.ts +9 -2
- package/lib/typescript/index.d.ts +2 -1
- package/lib/typescript/models/FWEventName.d.ts +3 -1
- package/lib/typescript/models/LivestreamPlayerDesignVersion.d.ts +5 -0
- package/lib/typescript/models/StoryBlockConfiguration.d.ts +2 -7
- package/lib/typescript/modules/FireworkSDKModule.d.ts +3 -1
- package/package.json +1 -1
- package/react-native-firework-sdk.podspec +2 -2
- package/src/FireworkSDK.ts +44 -13
- package/src/components/StoryBlock.tsx +27 -1
- package/src/components/VideoFeed.tsx +29 -1
- package/src/index.ts +2 -0
- package/src/models/FWEventName.ts +2 -0
- package/src/models/LivestreamPlayerDesignVersion.ts +6 -0
- package/src/models/StoryBlockConfiguration.ts +2 -7
- package/src/modules/FireworkSDKModule.ts +5 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FireworkSDKModule.ts"],"names":["NativeEventEmitter","NativeModules","LINKING_ERROR","FireworkSDKModule","FireworkSDK","Proxy","get","Error","FireworkSDKModuleEventEmitter"],"mappings":"AAAA,SAASA,kBAAT,EAA2CC,aAA3C,QAAgE,cAAhE;AAEA,SAASC,aAAT,QAA8B,6BAA9B;
|
|
1
|
+
{"version":3,"sources":["FireworkSDKModule.ts"],"names":["NativeEventEmitter","NativeModules","LINKING_ERROR","FireworkSDKModule","FireworkSDK","Proxy","get","Error","FireworkSDKModuleEventEmitter"],"mappings":"AAAA,SAASA,kBAAT,EAA2CC,aAA3C,QAAgE,cAAhE;AAEA,SAASC,aAAT,QAA8B,6BAA9B;AAQA,MAAMC,iBAAiB,GAAGF,aAAa,CAACG,WAAd,GACtBH,aAAa,CAACG,WADQ,GAEtB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUL,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AA8BA,MAAMM,6BAA6B,GAAG,IAAIR,kBAAJ,CAAuBG,iBAAvB,CAAtC;AACA,SAASK,6BAAT;AACA,eAAeL,iBAAf","sourcesContent":["import { NativeEventEmitter, NativeModule, NativeModules } from 'react-native';\n\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\nimport type AdBadgeConfiguration from '../models/AdBadgeConfiguration';\nimport type SDKInitOptions from '../models/SDKInitOptions';\nimport type TrackPurchaseParameters from '../models/TrackPurchaseParameters';\nimport type VideoPlayerNativeConfiguration from '../models/VideoPlayerNativeConfiguration';\nimport type { DataTrackingLevel } from 'src/models/DataTrackingLevel';\nimport type LivestreamPlayerDesignVersion from 'src/models/LivestreamPlayerDesignVersion';\n\nconst FireworkSDKModule = NativeModules.FireworkSDK\n ? NativeModules.FireworkSDK\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\ninterface IFireworkSDKModule extends NativeModule {\n init(options?: SDKInitOptions): Promise<any>;\n markInitCalled(): Promise<boolean>;\n openVideoPlayer(url: string, config?: VideoPlayerNativeConfiguration): void;\n setVideoFeedClickCallbackEnabled(enabled: boolean): void; // Only supported on iOS\n setCustomCTAClickEnabled(enabled: boolean): void;\n setShareBaseURL(url?: string): Promise<any>;\n setVideoPlaybackEventEnabled(enabled: boolean): void;\n setAdBadgeConfiguration(config?: AdBadgeConfiguration): Promise<any>;\n trackPurchase(parameters: TrackPurchaseParameters): void;\n changeAppLanguage(language?: string | null): Promise<boolean>;\n pausePlayer(callbackId: number | string): void; // Only supported on iOS\n resumePlayer(callbackId: number | string): void; // Only supported on iOS\n setDataTrackingLevel(level?: DataTrackingLevel): Promise<boolean>;\n setLivestreamPlayerDesignVersion(\n version: LivestreamPlayerDesignVersion\n ): Promise<boolean>;\n}\n\nconst FireworkSDKModuleEventEmitter = new NativeEventEmitter(FireworkSDKModule);\nexport { FireworkSDKModuleEventEmitter };\nexport default FireworkSDKModule as IFireworkSDKModule;\n"]}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import FWNavigator from './FWNavigator';
|
|
2
2
|
import LiveStream from './LiveStream';
|
|
3
3
|
import type AdBadgeConfiguration from './models/AdBadgeConfiguration';
|
|
4
|
+
import type { DataTrackingLevel } from './models/DataTrackingLevel';
|
|
4
5
|
import type { CustomCTAClickEvent, SDKInitEvent, VideoFeedClickEvent, VideoPlaybackEvent } from './models/FWEvents';
|
|
6
|
+
import LivestreamPlayerDesignVersion from './models/LivestreamPlayerDesignVersion';
|
|
7
|
+
import type OpenVideoPlayerConfiguration from './models/OpenVideoPlayerConfiguration';
|
|
5
8
|
import type SDKInitOptions from './models/SDKInitOptions';
|
|
6
9
|
import type { VideoLaunchBehavior } from './models/SDKInitOptions';
|
|
7
10
|
import type TrackPurchaseParameters from './models/TrackPurchaseParameters';
|
|
8
11
|
import VideoShopping from './VideoShopping';
|
|
9
|
-
import type OpenVideoPlayerConfiguration from './models/OpenVideoPlayerConfiguration';
|
|
10
|
-
import type { DataTrackingLevel } from './models/DataTrackingLevel';
|
|
11
12
|
export type SDKInitCallback = (event: SDKInitEvent) => Promise<void> | void;
|
|
12
13
|
export type CustomCTAClickCallback = (event: CustomCTAClickEvent) => Promise<void> | void;
|
|
13
14
|
export type VideoPlaybackCallback = (event: VideoPlaybackEvent) => Promise<void> | void;
|
|
@@ -71,6 +72,12 @@ declare class FireworkSDK {
|
|
|
71
72
|
*/
|
|
72
73
|
get videoLaunchBehavior(): VideoLaunchBehavior | undefined;
|
|
73
74
|
private _videoLaunchBehavior;
|
|
75
|
+
/**
|
|
76
|
+
* The version of the livestream player design.
|
|
77
|
+
*/
|
|
78
|
+
get livestreamPlayerDesignVersion(): LivestreamPlayerDesignVersion;
|
|
79
|
+
set livestreamPlayerDesignVersion(value: LivestreamPlayerDesignVersion);
|
|
80
|
+
private _livestreamPlayerDesignVersion;
|
|
74
81
|
private get eventEmitter();
|
|
75
82
|
/**
|
|
76
83
|
* Get VideoShopping object.
|
|
@@ -28,6 +28,7 @@ import LiveStreamChatEventName from './models/LiveStreamChatEventName';
|
|
|
28
28
|
import type LiveStreamEventDetails from './models/LiveStreamEventDetails';
|
|
29
29
|
import LiveStreamEventName from './models/LiveStreamEventName';
|
|
30
30
|
import type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';
|
|
31
|
+
import LivestreamPlayerDesignVersion from './models/LivestreamPlayerDesignVersion';
|
|
31
32
|
import type OpenVideoPlayerConfiguration from './models/OpenVideoPlayerConfiguration';
|
|
32
33
|
import type Product from './models/Product';
|
|
33
34
|
import type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';
|
|
@@ -61,4 +62,4 @@ import VideoFeedUtil from './utils/VideoFeedUtil';
|
|
|
61
62
|
import type { ClickProductCallback, CustomClickCartIconCallback, CustomClickLinkButtonCallback, CustomTapProductCardCallback, ShoppingCTACallback, UpdateProductDetailsCallback } from './VideoShopping';
|
|
62
63
|
import VideoShopping from './VideoShopping';
|
|
63
64
|
export default FireworkSDK;
|
|
64
|
-
export { AdBadgeConfiguration, AdBadgeTextType, AdConfiguration, AndroidFontInfo, ButtonInfo, ClickProductCallback, ClickProductEvent, CountdownTimerAppearanceMode, CountdownTimerConfiguration, CustomClickCartIconCallback, CustomClickCartIconEvent, CustomClickLinkButtonCallback, CustomClickLinkButtonEvent, CustomCTAClickCallback, CustomCTAClickEvent, CustomTapProductCardCallback, CustomTapProductCardEvent, DataTrackingLevel, FeedItemDetails, FireworkSDK, FWComponentType, FWError, FWNavigator, GradientDrawable, GradientDrawableOrientation, IOSFontInfo, IOSSystemFontStyle, IOSSystemFontWeight, IStoryBlockMethods, IStoryBlockProps, IVideoFeedProps, LinkButtonConfiguration, LiveStream, LiveStreamChatEvent, LiveStreamChatEventName, LiveStreamEvent, LiveStreamEventDetails, LiveStreamEventName, LiveStreamMessageDetails, onLiveStreamChatEventCallback, onLiveStreamEventCallback, OpenVideoPlayerConfiguration, PlayerHandler, Product, ProductCardConfiguration, ProductCardCTAButtonStyle, ProductCardCTAButtonText, ProductCardIconConfiguration, ProductCardLabelConfiguration, ProductCardPriceConfiguration, ProductCardPriceLabelAxis, ProductCardTheme, ProductInfoViewConfiguration, ProductPrice, ProductUnit, ProductUnitOption, PushRNContainerParams, RNAppProps, SDKInitCallback, SDKInitEvent, SDKInitOptions, ShoppingCTAButtonConfiguration, ShoppingCTAButtonText, ShoppingCTACallback, ShoppingCTAEvent, ShoppingCTAResult, StoryBlock, StoryBlockConfiguration, StoryBlockSource, TrackPurchaseParameters, UpdateProductDetailsCallback, UpdateProductDetailsEvent, VastAttribute, VideoFeed, VideoFeedClickCallback, VideoFeedClickEvent, VideoFeedConfiguration, VideoFeedMode, VideoFeedPadding, VideoFeedPlayIconConfiguration, VideoFeedSource, VideoFeedTitleConfiguration, VideoFeedTitlePosition, VideoFeedUtil, VideoLaunchBehavior, VideoPlaybackCallback, VideoPlaybackDetails, VideoPlaybackEvent, VideoPlaybackEventName, VideoPlayerButtonConfiguration, VideoPlayerCompleteAction, VideoPlayerConfiguration, VideoPlayerCTADelay, VideoPlayerCTADelayType, VideoPlayerCTAStyle, VideoPlayerCTAWidth, VideoPlayerLivestreamCountdownTimerTheme, VideoPlayerLogoConfiguration, VideoPlayerLogoOption, VideoPlayerSize, VideoPlayerStyle, VideoShopping, };
|
|
65
|
+
export { AdBadgeConfiguration, AdBadgeTextType, AdConfiguration, AndroidFontInfo, ButtonInfo, ClickProductCallback, ClickProductEvent, CountdownTimerAppearanceMode, CountdownTimerConfiguration, CustomClickCartIconCallback, CustomClickCartIconEvent, CustomClickLinkButtonCallback, CustomClickLinkButtonEvent, CustomCTAClickCallback, CustomCTAClickEvent, CustomTapProductCardCallback, CustomTapProductCardEvent, DataTrackingLevel, FeedItemDetails, FireworkSDK, FWComponentType, FWError, FWNavigator, GradientDrawable, GradientDrawableOrientation, IOSFontInfo, IOSSystemFontStyle, IOSSystemFontWeight, IStoryBlockMethods, IStoryBlockProps, IVideoFeedProps, LinkButtonConfiguration, LiveStream, LiveStreamChatEvent, LiveStreamChatEventName, LiveStreamEvent, LiveStreamEventDetails, LiveStreamEventName, LiveStreamMessageDetails, LivestreamPlayerDesignVersion, onLiveStreamChatEventCallback, onLiveStreamEventCallback, OpenVideoPlayerConfiguration, PlayerHandler, Product, ProductCardConfiguration, ProductCardCTAButtonStyle, ProductCardCTAButtonText, ProductCardIconConfiguration, ProductCardLabelConfiguration, ProductCardPriceConfiguration, ProductCardPriceLabelAxis, ProductCardTheme, ProductInfoViewConfiguration, ProductPrice, ProductUnit, ProductUnitOption, PushRNContainerParams, RNAppProps, SDKInitCallback, SDKInitEvent, SDKInitOptions, ShoppingCTAButtonConfiguration, ShoppingCTAButtonText, ShoppingCTACallback, ShoppingCTAEvent, ShoppingCTAResult, StoryBlock, StoryBlockConfiguration, StoryBlockSource, TrackPurchaseParameters, UpdateProductDetailsCallback, UpdateProductDetailsEvent, VastAttribute, VideoFeed, VideoFeedClickCallback, VideoFeedClickEvent, VideoFeedConfiguration, VideoFeedMode, VideoFeedPadding, VideoFeedPlayIconConfiguration, VideoFeedSource, VideoFeedTitleConfiguration, VideoFeedTitlePosition, VideoFeedUtil, VideoLaunchBehavior, VideoPlaybackCallback, VideoPlaybackDetails, VideoPlaybackEvent, VideoPlaybackEventName, VideoPlayerButtonConfiguration, VideoPlayerCompleteAction, VideoPlayerConfiguration, VideoPlayerCTADelay, VideoPlayerCTADelayType, VideoPlayerCTAStyle, VideoPlayerCTAWidth, VideoPlayerLivestreamCountdownTimerTheme, VideoPlayerLogoConfiguration, VideoPlayerLogoOption, VideoPlayerSize, VideoPlayerStyle, VideoShopping, };
|
|
@@ -18,5 +18,7 @@ export declare enum FWEventName {
|
|
|
18
18
|
CustomLinkButtonClick = "fw:shopping:custom-link-button-click",
|
|
19
19
|
CustomProductCardTap = "fw:shopping:custom-product-card-tap",
|
|
20
20
|
ProductInfoViewConfigurationUpdated = "fw:product-info-view-configuration-updated",
|
|
21
|
-
ProductClick = "fw:shopping:product-click"
|
|
21
|
+
ProductClick = "fw:shopping:product-click",
|
|
22
|
+
LivestreamPlayerDesignVersionUpdated = "fw:livestream-player-design-version-updated",
|
|
23
|
+
DataTrackingLevelUpdated = "fw:data-tracking-level-updated"
|
|
22
24
|
}
|
|
@@ -10,14 +10,12 @@ import type { VideoPlayerStyle } from './VideoPlayerStyle';
|
|
|
10
10
|
export interface StoryBlockConfiguration {
|
|
11
11
|
/**
|
|
12
12
|
* Sets the proportion of the video player to its container.
|
|
13
|
-
* On iOS, the property only applies to full-screen story block but not to compact story block.
|
|
14
|
-
* On Android, the property applies to full-screen and compact story block.
|
|
15
13
|
*/
|
|
16
14
|
playerStyle?: VideoPlayerStyle;
|
|
17
15
|
/**
|
|
18
16
|
* Behavior occurring after video is complete.
|
|
19
|
-
* On iOS, the property only applies to full
|
|
20
|
-
* On Android, the property applies to full
|
|
17
|
+
* On iOS, the property only applies to full screen mode but not to embedded mode.
|
|
18
|
+
* On Android, the property applies to both full screen and embedded modes.
|
|
21
19
|
*/
|
|
22
20
|
videoCompleteAction?: VideoPlayerCompleteAction;
|
|
23
21
|
/**
|
|
@@ -60,7 +58,6 @@ export interface StoryBlockConfiguration {
|
|
|
60
58
|
ctaWidth?: VideoPlayerCTAWidth;
|
|
61
59
|
/**
|
|
62
60
|
* The host app could use this property to customize the button images of the video player.
|
|
63
|
-
* On iOS, the property only applies to full-screen story block but not to compact story block.
|
|
64
61
|
*/
|
|
65
62
|
buttonConfiguration?: VideoPlayerButtonConfiguration;
|
|
66
63
|
/**
|
|
@@ -79,8 +76,6 @@ export interface StoryBlockConfiguration {
|
|
|
79
76
|
replayBadgeConfiguration?: ReplayBadgeConfiguration;
|
|
80
77
|
/**
|
|
81
78
|
* Specifies countdown timer configuration.
|
|
82
|
-
* On iOS, the property applies to full-screen and compact story block.
|
|
83
|
-
* On Android, the property only applies to compact story block.
|
|
84
79
|
*/
|
|
85
80
|
countdownTimerConfiguration?: CountdownTimerConfiguration;
|
|
86
81
|
}
|
|
@@ -4,6 +4,7 @@ import type SDKInitOptions from '../models/SDKInitOptions';
|
|
|
4
4
|
import type TrackPurchaseParameters from '../models/TrackPurchaseParameters';
|
|
5
5
|
import type VideoPlayerNativeConfiguration from '../models/VideoPlayerNativeConfiguration';
|
|
6
6
|
import type { DataTrackingLevel } from 'src/models/DataTrackingLevel';
|
|
7
|
+
import type LivestreamPlayerDesignVersion from 'src/models/LivestreamPlayerDesignVersion';
|
|
7
8
|
interface IFireworkSDKModule extends NativeModule {
|
|
8
9
|
init(options?: SDKInitOptions): Promise<any>;
|
|
9
10
|
markInitCalled(): Promise<boolean>;
|
|
@@ -17,7 +18,8 @@ interface IFireworkSDKModule extends NativeModule {
|
|
|
17
18
|
changeAppLanguage(language?: string | null): Promise<boolean>;
|
|
18
19
|
pausePlayer(callbackId: number | string): void;
|
|
19
20
|
resumePlayer(callbackId: number | string): void;
|
|
20
|
-
setDataTrackingLevel(level?: DataTrackingLevel):
|
|
21
|
+
setDataTrackingLevel(level?: DataTrackingLevel): Promise<boolean>;
|
|
22
|
+
setLivestreamPlayerDesignVersion(version: LivestreamPlayerDesignVersion): Promise<boolean>;
|
|
21
23
|
}
|
|
22
24
|
declare const FireworkSDKModuleEventEmitter: NativeEventEmitter;
|
|
23
25
|
export { FireworkSDKModuleEventEmitter };
|
package/package.json
CHANGED
package/src/FireworkSDK.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { NativeEventEmitter, Platform } from 'react-native';
|
|
|
3
3
|
import FWNavigator from './FWNavigator';
|
|
4
4
|
import LiveStream from './LiveStream';
|
|
5
5
|
import type AdBadgeConfiguration from './models/AdBadgeConfiguration';
|
|
6
|
+
import type { DataTrackingLevel } from './models/DataTrackingLevel';
|
|
6
7
|
import { FWEventName } from './models/FWEventName';
|
|
7
8
|
import type {
|
|
8
9
|
CustomCTAClickEvent,
|
|
@@ -10,6 +11,8 @@ import type {
|
|
|
10
11
|
VideoFeedClickEvent,
|
|
11
12
|
VideoPlaybackEvent,
|
|
12
13
|
} from './models/FWEvents';
|
|
14
|
+
import LivestreamPlayerDesignVersion from './models/LivestreamPlayerDesignVersion';
|
|
15
|
+
import type OpenVideoPlayerConfiguration from './models/OpenVideoPlayerConfiguration';
|
|
13
16
|
import type SDKInitOptions from './models/SDKInitOptions';
|
|
14
17
|
import type { VideoLaunchBehavior } from './models/SDKInitOptions';
|
|
15
18
|
import type TrackPurchaseParameters from './models/TrackPurchaseParameters';
|
|
@@ -18,11 +21,9 @@ import FireworkSDKModule, {
|
|
|
18
21
|
} from './modules/FireworkSDKModule';
|
|
19
22
|
import LiveStreamModule from './modules/LiveStreamModule';
|
|
20
23
|
import ShoppingModule from './modules/ShoppingModule';
|
|
24
|
+
import FWGlobalState from './utils/FWGlobalState';
|
|
21
25
|
import FWLoggerUtil from './utils/FWLoggerUtil';
|
|
22
26
|
import VideoShopping from './VideoShopping';
|
|
23
|
-
import FWGlobalState from './utils/FWGlobalState';
|
|
24
|
-
import type OpenVideoPlayerConfiguration from './models/OpenVideoPlayerConfiguration';
|
|
25
|
-
import type { DataTrackingLevel } from './models/DataTrackingLevel';
|
|
26
27
|
|
|
27
28
|
export type SDKInitCallback = (event: SDKInitEvent) => Promise<void> | void;
|
|
28
29
|
export type CustomCTAClickCallback = (
|
|
@@ -94,7 +95,6 @@ class FireworkSDK {
|
|
|
94
95
|
}
|
|
95
96
|
public set shareBaseURL(value: string | undefined) {
|
|
96
97
|
this.updateInternalShareBaseURL(value);
|
|
97
|
-
FireworkSDKModule.setShareBaseURL(value ?? '');
|
|
98
98
|
}
|
|
99
99
|
private _shareBaseURL: string | undefined;
|
|
100
100
|
|
|
@@ -114,10 +114,12 @@ class FireworkSDK {
|
|
|
114
114
|
this._adBadgeConfiguration?.androidFontInfo?.typefaceName !==
|
|
115
115
|
value?.androidFontInfo?.typefaceName;
|
|
116
116
|
this._adBadgeConfiguration = value;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
|
|
118
|
+
FireworkSDKModule.setAdBadgeConfiguration(value ?? {}).then(() => {
|
|
119
|
+
if (valueHasChanged) {
|
|
120
|
+
this.eventEmitter.emit(FWEventName.AdBadgeConfigurationUpdated);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
121
123
|
}
|
|
122
124
|
private _adBadgeConfiguration: AdBadgeConfiguration | undefined;
|
|
123
125
|
|
|
@@ -133,8 +135,13 @@ class FireworkSDK {
|
|
|
133
135
|
return this._dataTrackingLevel;
|
|
134
136
|
}
|
|
135
137
|
public set dataTrackingLevel(value: DataTrackingLevel) {
|
|
138
|
+
const valueHasChanged = this._dataTrackingLevel !== value;
|
|
136
139
|
this._dataTrackingLevel = value;
|
|
137
|
-
FireworkSDKModule.setDataTrackingLevel(value)
|
|
140
|
+
FireworkSDKModule.setDataTrackingLevel(value).then(() => {
|
|
141
|
+
if (valueHasChanged) {
|
|
142
|
+
this.eventEmitter.emit(FWEventName.DataTrackingLevelUpdated);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
138
145
|
}
|
|
139
146
|
private _dataTrackingLevel: DataTrackingLevel = 'all';
|
|
140
147
|
|
|
@@ -157,6 +164,28 @@ class FireworkSDK {
|
|
|
157
164
|
}
|
|
158
165
|
private _videoLaunchBehavior: VideoLaunchBehavior | undefined;
|
|
159
166
|
|
|
167
|
+
/**
|
|
168
|
+
* The version of the livestream player design.
|
|
169
|
+
*/
|
|
170
|
+
public get livestreamPlayerDesignVersion(): LivestreamPlayerDesignVersion {
|
|
171
|
+
return this._livestreamPlayerDesignVersion;
|
|
172
|
+
}
|
|
173
|
+
public set livestreamPlayerDesignVersion(
|
|
174
|
+
value: LivestreamPlayerDesignVersion
|
|
175
|
+
) {
|
|
176
|
+
const valueHasChanged = this._livestreamPlayerDesignVersion !== value;
|
|
177
|
+
this._livestreamPlayerDesignVersion = value;
|
|
178
|
+
FireworkSDKModule.setLivestreamPlayerDesignVersion(value).then(() => {
|
|
179
|
+
if (valueHasChanged) {
|
|
180
|
+
this.eventEmitter.emit(
|
|
181
|
+
FWEventName.LivestreamPlayerDesignVersionUpdated
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
private _livestreamPlayerDesignVersion: LivestreamPlayerDesignVersion =
|
|
187
|
+
LivestreamPlayerDesignVersion.v1;
|
|
188
|
+
|
|
160
189
|
private get eventEmitter(): NativeEventEmitter {
|
|
161
190
|
return FireworkSDKModuleEventEmitter;
|
|
162
191
|
}
|
|
@@ -283,10 +312,10 @@ class FireworkSDK {
|
|
|
283
312
|
const videoLaunchBehaviorUpdated =
|
|
284
313
|
this._videoLaunchBehavior !== options?.videoLaunchBehavior;
|
|
285
314
|
this._videoLaunchBehavior = options?.videoLaunchBehavior;
|
|
315
|
+
await FireworkSDKModule.init(options);
|
|
286
316
|
if (videoLaunchBehaviorUpdated) {
|
|
287
317
|
this.eventEmitter.emit(FWEventName.VideoLaunchBehaviorUpdated);
|
|
288
318
|
}
|
|
289
|
-
await FireworkSDKModule.init(options);
|
|
290
319
|
await this.completeRemainingInitialization();
|
|
291
320
|
}
|
|
292
321
|
|
|
@@ -382,9 +411,11 @@ class FireworkSDK {
|
|
|
382
411
|
private updateInternalShareBaseURL(shareBaseURL?: string) {
|
|
383
412
|
const shareBaseURLChanged = this._shareBaseURL !== shareBaseURL;
|
|
384
413
|
this._shareBaseURL = shareBaseURL;
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
414
|
+
FireworkSDKModule.setShareBaseURL(shareBaseURL ?? '').then(() => {
|
|
415
|
+
if (shareBaseURLChanged) {
|
|
416
|
+
this.eventEmitter.emit(FWEventName.ShareBaseURLUpdated);
|
|
417
|
+
}
|
|
418
|
+
});
|
|
388
419
|
}
|
|
389
420
|
|
|
390
421
|
private async completeRemainingInitialization(): Promise<void> {
|
|
@@ -339,6 +339,9 @@ const StoryBlock: ForwardRefRenderFunction<
|
|
|
339
339
|
adBadgeConfiguration?.androidFontInfo?.isCustom;
|
|
340
340
|
const androidFontTypefaceNameOfAdBadge =
|
|
341
341
|
adBadgeConfiguration?.androidFontInfo?.typefaceName;
|
|
342
|
+
const dataTrackingLevel = FireworkSDK.getInstance().dataTrackingLevel;
|
|
343
|
+
const livestreamPlayerDesignVersion =
|
|
344
|
+
FireworkSDK.getInstance().livestreamPlayerDesignVersion;
|
|
342
345
|
|
|
343
346
|
const {
|
|
344
347
|
source,
|
|
@@ -399,7 +402,8 @@ const StoryBlock: ForwardRefRenderFunction<
|
|
|
399
402
|
key += `_androidFontIsCustomOfAdBadge${androidFontIsCustomOfAdBadge}`;
|
|
400
403
|
key += `_androidFontTypefaceNameOfAdBadge${androidFontTypefaceNameOfAdBadge}`;
|
|
401
404
|
}
|
|
402
|
-
|
|
405
|
+
key += `_dataTrackingLevel:${dataTrackingLevel}`;
|
|
406
|
+
key += `_livestreamPlayerDesignVersion:${livestreamPlayerDesignVersion}`;
|
|
403
407
|
key += `_source:${source}`;
|
|
404
408
|
key += `_channel:${channel}`;
|
|
405
409
|
key += `_playlist:${playlist}`;
|
|
@@ -553,12 +557,34 @@ const StoryBlock: ForwardRefRenderFunction<
|
|
|
553
557
|
}
|
|
554
558
|
);
|
|
555
559
|
|
|
560
|
+
const subscriptionOfDataTrackingLevelUpdated =
|
|
561
|
+
FireworkSDKModuleEventEmitter.addListener(
|
|
562
|
+
FWEventName.DataTrackingLevelUpdated,
|
|
563
|
+
() => {
|
|
564
|
+
FWLoggerUtil.log('Receive FWEventName.DataTrackingLevelUpdated');
|
|
565
|
+
forceUpdate();
|
|
566
|
+
}
|
|
567
|
+
);
|
|
568
|
+
|
|
569
|
+
const subscriptionOfLivestreamPlayerDesignVersionUpdated =
|
|
570
|
+
FireworkSDKModuleEventEmitter.addListener(
|
|
571
|
+
FWEventName.LivestreamPlayerDesignVersionUpdated,
|
|
572
|
+
() => {
|
|
573
|
+
FWLoggerUtil.log(
|
|
574
|
+
'Receive FWEventName.LivestreamPlayerDesignVersionUpdated'
|
|
575
|
+
);
|
|
576
|
+
forceUpdate();
|
|
577
|
+
}
|
|
578
|
+
);
|
|
579
|
+
|
|
556
580
|
return () => {
|
|
557
581
|
subscriptionOfShareBaseURLUpdated.remove();
|
|
558
582
|
subscriptionOfAdBadgeConfigurationUpdated.remove();
|
|
559
583
|
subscriptionOfVideoLaunchBehaviorUpdated.remove();
|
|
560
584
|
subscriptionOfAppLanguageUpdated.remove();
|
|
561
585
|
subscriptionOfProductInfoViewConfigurationUpdated.remove();
|
|
586
|
+
subscriptionOfDataTrackingLevelUpdated.remove();
|
|
587
|
+
subscriptionOfLivestreamPlayerDesignVersionUpdated.remove();
|
|
562
588
|
};
|
|
563
589
|
}, []);
|
|
564
590
|
|
|
@@ -347,6 +347,30 @@ class VideoFeed extends React.Component<IVideoFeedProps, IVideoFeedState> {
|
|
|
347
347
|
}
|
|
348
348
|
);
|
|
349
349
|
this._subscriptions.push(subscriptionOfAppLanguageUpdated);
|
|
350
|
+
|
|
351
|
+
const subscriptionOfDataTrackingLevelUpdated =
|
|
352
|
+
FireworkSDKModuleEventEmitter.addListener(
|
|
353
|
+
FWEventName.DataTrackingLevelUpdated,
|
|
354
|
+
() => {
|
|
355
|
+
FWLoggerUtil.log('Receive FWEventName.DataTrackingLevelUpdated');
|
|
356
|
+
this.setState({});
|
|
357
|
+
}
|
|
358
|
+
);
|
|
359
|
+
this._subscriptions.push(subscriptionOfDataTrackingLevelUpdated);
|
|
360
|
+
|
|
361
|
+
const subscriptionOfLivestreamPlayerDesignVersionUpdated =
|
|
362
|
+
FireworkSDKModuleEventEmitter.addListener(
|
|
363
|
+
FWEventName.LivestreamPlayerDesignVersionUpdated,
|
|
364
|
+
() => {
|
|
365
|
+
FWLoggerUtil.log(
|
|
366
|
+
'Receive FWEventName.LivestreamPlayerDesignVersionUpdated'
|
|
367
|
+
);
|
|
368
|
+
this.setState({});
|
|
369
|
+
}
|
|
370
|
+
);
|
|
371
|
+
this._subscriptions.push(
|
|
372
|
+
subscriptionOfLivestreamPlayerDesignVersionUpdated
|
|
373
|
+
);
|
|
350
374
|
}
|
|
351
375
|
|
|
352
376
|
/**
|
|
@@ -383,6 +407,9 @@ class VideoFeed extends React.Component<IVideoFeedProps, IVideoFeedState> {
|
|
|
383
407
|
adBadgeConfiguration?.androidFontInfo?.isCustom?.toString();
|
|
384
408
|
const androidFontTypefaceNameOfAdBadge =
|
|
385
409
|
adBadgeConfiguration?.androidFontInfo?.typefaceName;
|
|
410
|
+
const dataTrackingLevel = FireworkSDK.getInstance().dataTrackingLevel;
|
|
411
|
+
const livestreamPlayerDesignVersion =
|
|
412
|
+
FireworkSDK.getInstance().livestreamPlayerDesignVersion;
|
|
386
413
|
|
|
387
414
|
const {
|
|
388
415
|
source,
|
|
@@ -465,7 +492,8 @@ class VideoFeed extends React.Component<IVideoFeedProps, IVideoFeedState> {
|
|
|
465
492
|
key += `_androidFontIsCustomOfAdBadge${androidFontIsCustomOfAdBadge}`;
|
|
466
493
|
key += `_androidFontTypefaceNameOfAdBadge${androidFontTypefaceNameOfAdBadge}`;
|
|
467
494
|
}
|
|
468
|
-
|
|
495
|
+
key += `_dataTrackingLevel:${dataTrackingLevel}`;
|
|
496
|
+
key += `_livestreamPlayerDesignVersion:${livestreamPlayerDesignVersion}`;
|
|
469
497
|
key += `_source:${source}`;
|
|
470
498
|
key += `_channel:${channel}`;
|
|
471
499
|
key += `_playlist:${playlist}`;
|
package/src/index.ts
CHANGED
|
@@ -56,6 +56,7 @@ import LiveStreamChatEventName from './models/LiveStreamChatEventName';
|
|
|
56
56
|
import type LiveStreamEventDetails from './models/LiveStreamEventDetails';
|
|
57
57
|
import LiveStreamEventName from './models/LiveStreamEventName';
|
|
58
58
|
import type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';
|
|
59
|
+
import LivestreamPlayerDesignVersion from './models/LivestreamPlayerDesignVersion';
|
|
59
60
|
import type OpenVideoPlayerConfiguration from './models/OpenVideoPlayerConfiguration';
|
|
60
61
|
import type Product from './models/Product';
|
|
61
62
|
import type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';
|
|
@@ -161,6 +162,7 @@ export {
|
|
|
161
162
|
LiveStreamEventDetails,
|
|
162
163
|
LiveStreamEventName,
|
|
163
164
|
LiveStreamMessageDetails,
|
|
165
|
+
LivestreamPlayerDesignVersion,
|
|
164
166
|
onLiveStreamChatEventCallback,
|
|
165
167
|
onLiveStreamEventCallback,
|
|
166
168
|
OpenVideoPlayerConfiguration,
|
|
@@ -19,4 +19,6 @@ export enum FWEventName {
|
|
|
19
19
|
CustomProductCardTap = 'fw:shopping:custom-product-card-tap',
|
|
20
20
|
ProductInfoViewConfigurationUpdated = 'fw:product-info-view-configuration-updated',
|
|
21
21
|
ProductClick = 'fw:shopping:product-click',
|
|
22
|
+
LivestreamPlayerDesignVersionUpdated = 'fw:livestream-player-design-version-updated',
|
|
23
|
+
DataTrackingLevelUpdated = 'fw:data-tracking-level-updated',
|
|
22
24
|
}
|
|
@@ -11,14 +11,12 @@ import type { VideoPlayerStyle } from './VideoPlayerStyle';
|
|
|
11
11
|
export interface StoryBlockConfiguration {
|
|
12
12
|
/**
|
|
13
13
|
* Sets the proportion of the video player to its container.
|
|
14
|
-
* On iOS, the property only applies to full-screen story block but not to compact story block.
|
|
15
|
-
* On Android, the property applies to full-screen and compact story block.
|
|
16
14
|
*/
|
|
17
15
|
playerStyle?: VideoPlayerStyle;
|
|
18
16
|
/**
|
|
19
17
|
* Behavior occurring after video is complete.
|
|
20
|
-
* On iOS, the property only applies to full
|
|
21
|
-
* On Android, the property applies to full
|
|
18
|
+
* On iOS, the property only applies to full screen mode but not to embedded mode.
|
|
19
|
+
* On Android, the property applies to both full screen and embedded modes.
|
|
22
20
|
*/
|
|
23
21
|
videoCompleteAction?: VideoPlayerCompleteAction;
|
|
24
22
|
/**
|
|
@@ -61,7 +59,6 @@ export interface StoryBlockConfiguration {
|
|
|
61
59
|
ctaWidth?: VideoPlayerCTAWidth;
|
|
62
60
|
/**
|
|
63
61
|
* The host app could use this property to customize the button images of the video player.
|
|
64
|
-
* On iOS, the property only applies to full-screen story block but not to compact story block.
|
|
65
62
|
*/
|
|
66
63
|
buttonConfiguration?: VideoPlayerButtonConfiguration;
|
|
67
64
|
/**
|
|
@@ -80,8 +77,6 @@ export interface StoryBlockConfiguration {
|
|
|
80
77
|
replayBadgeConfiguration?: ReplayBadgeConfiguration;
|
|
81
78
|
/**
|
|
82
79
|
* Specifies countdown timer configuration.
|
|
83
|
-
* On iOS, the property applies to full-screen and compact story block.
|
|
84
|
-
* On Android, the property only applies to compact story block.
|
|
85
80
|
*/
|
|
86
81
|
countdownTimerConfiguration?: CountdownTimerConfiguration;
|
|
87
82
|
}
|
|
@@ -6,6 +6,7 @@ import type SDKInitOptions from '../models/SDKInitOptions';
|
|
|
6
6
|
import type TrackPurchaseParameters from '../models/TrackPurchaseParameters';
|
|
7
7
|
import type VideoPlayerNativeConfiguration from '../models/VideoPlayerNativeConfiguration';
|
|
8
8
|
import type { DataTrackingLevel } from 'src/models/DataTrackingLevel';
|
|
9
|
+
import type LivestreamPlayerDesignVersion from 'src/models/LivestreamPlayerDesignVersion';
|
|
9
10
|
|
|
10
11
|
const FireworkSDKModule = NativeModules.FireworkSDK
|
|
11
12
|
? NativeModules.FireworkSDK
|
|
@@ -31,7 +32,10 @@ interface IFireworkSDKModule extends NativeModule {
|
|
|
31
32
|
changeAppLanguage(language?: string | null): Promise<boolean>;
|
|
32
33
|
pausePlayer(callbackId: number | string): void; // Only supported on iOS
|
|
33
34
|
resumePlayer(callbackId: number | string): void; // Only supported on iOS
|
|
34
|
-
setDataTrackingLevel(level?: DataTrackingLevel):
|
|
35
|
+
setDataTrackingLevel(level?: DataTrackingLevel): Promise<boolean>;
|
|
36
|
+
setLivestreamPlayerDesignVersion(
|
|
37
|
+
version: LivestreamPlayerDesignVersion
|
|
38
|
+
): Promise<boolean>;
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
const FireworkSDKModuleEventEmitter = new NativeEventEmitter(FireworkSDKModule);
|