react-native-firework-sdk 2.10.0 → 2.11.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 +18 -1
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +4 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModel.kt +0 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModelDeserializer.kt +0 -3
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModelSerializer.kt +0 -2
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSdkInitResultModel.kt +6 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWTrackPurchaseModel.kt +9 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWTrackPurchaseModelDeserializer.kt +45 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWTrackPurchaseModelSerializer.kt +34 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedItemDetailsModel.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlaybackDetails.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +2 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt +4 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelSerializer.kt +2 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerLogoConfigurationModel.kt +8 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerLogoConfigurationModelDeserializer.kt +23 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerLogoConfigurationModelSerializer.kt +18 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWEventName.kt +2 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoPlayerLogoOption.kt +19 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/FWReactNativeSDK.kt +103 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +12 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +8 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FireworkSDKInterface.kt +2 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWLiveStreamModule.kt +2 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +22 -9
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +78 -122
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +34 -9
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +13 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWFragmentUtil.kt +3 -3
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWGlobalDataUtil.kt +5 -2
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWModelUtils.kt +64 -0
- package/ios/Components/ReplayBadgeConfiguration.swift +12 -0
- package/ios/Components/StoryBlock.swift +31 -0
- package/ios/Components/StoryBlockConfiguration.swift +1 -0
- package/ios/Components/StoryBlockManager.m +24 -0
- package/ios/Components/StoryBlockManager.swift +6 -3
- package/ios/Components/VideoFeed.swift +18 -3
- package/ios/Components/VideoFeedConfiguration.swift +1 -0
- package/ios/Components/VideoFeedManager.m +4 -1
- package/ios/Components/VideoFeedManager.swift +6 -3
- package/ios/Components/VideoPlayerConfiguration.swift +1 -0
- package/ios/FWReactNativeSDK.swift +14 -0
- package/ios/FireworkSdk.xcodeproj/project.pbxproj +4 -0
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+CTA.swift +17 -15
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +1 -11
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +1 -0
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +80 -81
- package/ios/Modules/FireworkSDKModule/SDKInitOptions.swift +9 -5
- package/ios/Modules/Shopping/ShoppingModule.swift +10 -74
- package/lib/commonjs/FireworkSDK.js +30 -25
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/VideoShopping.js +6 -12
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/StoryBlock.js +54 -3
- package/lib/commonjs/components/StoryBlock.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +46 -4
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/FWNativeErrorAction.js +14 -0
- package/lib/commonjs/models/FWNativeErrorAction.js.map +1 -0
- package/lib/commonjs/models/ReplayBadgeConfiguration.js +2 -0
- package/lib/commonjs/models/ReplayBadgeConfiguration.js.map +1 -0
- package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
- package/lib/module/FireworkSDK.js +29 -25
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/VideoShopping.js +6 -12
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/StoryBlock.js +53 -3
- package/lib/module/components/StoryBlock.js.map +1 -1
- package/lib/module/components/VideoFeed.js +42 -4
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/FWNativeErrorAction.js +7 -0
- package/lib/module/models/FWNativeErrorAction.js.map +1 -0
- package/lib/module/models/ReplayBadgeConfiguration.js +2 -0
- package/lib/module/models/ReplayBadgeConfiguration.js.map +1 -0
- package/lib/module/modules/FireworkSDKModule.js.map +1 -1
- package/lib/typescript/VideoShopping.d.ts +2 -2
- package/lib/typescript/components/StoryBlock.d.ts +18 -1
- package/lib/typescript/components/VideoFeed.d.ts +7 -1
- package/lib/typescript/index.d.ts +2 -2
- package/lib/typescript/models/FWEvents.d.ts +26 -3
- package/lib/typescript/models/FWNativeErrorAction.d.ts +4 -0
- package/lib/typescript/models/FeedItemDetails.d.ts +6 -1
- package/lib/typescript/models/ReplayBadgeConfiguration.d.ts +7 -0
- package/lib/typescript/models/StoryBlockConfiguration.d.ts +6 -1
- package/lib/typescript/models/VideoFeedConfiguration.d.ts +6 -0
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +6 -1
- package/lib/typescript/modules/FireworkSDKModule.d.ts +1 -0
- package/package.json +1 -5
- package/react-native-firework-sdk.podspec +3 -5
- package/src/FireworkSDK.ts +27 -24
- package/src/VideoShopping.ts +9 -11
- package/src/components/StoryBlock.tsx +69 -7
- package/src/components/VideoFeed.tsx +57 -12
- package/src/index.ts +2 -0
- package/src/models/FWEvents.ts +28 -3
- package/src/models/FWNativeErrorAction.ts +4 -0
- package/src/models/FeedItemDetails.ts +7 -1
- package/src/models/ReplayBadgeConfiguration.ts +7 -0
- package/src/models/StoryBlockConfiguration.ts +6 -1
- package/src/models/VideoFeedConfiguration.ts +6 -0
- package/src/models/VideoPlayerConfiguration.ts +6 -1
- package/src/modules/FireworkSDKModule.ts +1 -0
- package/FireworkVideoUI.xcframework/Info.plist +0 -40
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Headers/FireworkVideoUI-Swift.h +0 -280
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Headers/FireworkVideoUI.h +0 -18
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Info.plist +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.abi.json +0 -1313
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.private.swiftinterface +0 -42
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftinterface +0 -42
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/module.modulemap +0 -11
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Headers/FireworkVideoUI-Swift.h +0 -556
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Headers/FireworkVideoUI.h +0 -18
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Info.plist +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.abi.json +0 -1313
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +0 -42
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +0 -42
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json +0 -1313
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +0 -42
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +0 -42
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/module.modulemap +0 -11
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +0 -245
- package/ios/FireworkVideoUI/FireworkVideoUI/FireworkVideoUI.docc/FireworkVideoUI.md +0 -13
- package/ios/FireworkVideoUI/FireworkVideoUI/FireworkVideoUI.h +0 -18
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/AppLanguageManager.swift +0 -154
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/Bundle+AppLanguage.swift +0 -73
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/NumberFormatter+AppLanguage.swift +0 -25
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/URLSession+AppLanguage.swift +0 -52
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIImageView+AppLanguage.swift +0 -60
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UILabel+AppLanguage.swift +0 -98
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UITextField+AppLanguage.swift +0 -97
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UITextView+AppLanguage.swift +0 -97
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIView+AppLanguage.swift +0 -71
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIViewController+AppLanguage.swift +0 -48
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIWindow+AppLanguage.swift +0 -26
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/LanguageUtil.swift +0 -43
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/Foundation/NSObject+LayoutFlip.swift +0 -42
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/CALayer+LayoutFlip.swift +0 -149
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/UILabel+LayoutFlip.swift +0 -35
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/UIView+LayoutFlip.swift +0 -202
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/LayoutFlipManager.swift +0 -59
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/Foundation/DispatchQueue+Once.swift +0 -32
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/Foundation/String+Base64.swift +0 -18
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/UIKit/UIView+UIHierarchy.swift +0 -46
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Swizzle.swift +0 -37
- package/ios/FireworkVideoUI/FireworkVideoUI.xcodeproj/project.pbxproj +0 -766
- package/ios/FireworkVideoUI/FireworkVideoUI.xcworkspace/contents.xcworkspacedata +0 -10
- package/ios/FireworkVideoUI/FireworkVideoUI.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/FireworkVideoUI/FireworkVideoUITests/FireworkVideoUITests.swift +0 -37
- package/ios/FireworkVideoUI/Podfile +0 -15
- package/ios/FireworkVideoUI/Podfile.lock +0 -16
- package/ios/scripts/react_native_firework_sdk_pods.rb +0 -27
|
@@ -18,6 +18,18 @@ export interface IStoryBlockMethods {
|
|
|
18
18
|
* Only supported on Android.
|
|
19
19
|
*/
|
|
20
20
|
openFullscreen: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Triggered when the story block enters the viewport.
|
|
23
|
+
* Only supported on iOS.
|
|
24
|
+
* It is recommended that the host app is triggered when listening for scrolling.
|
|
25
|
+
*/
|
|
26
|
+
onViewportEntered: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* Triggered when the story block leaves the viewport.
|
|
29
|
+
* Only supported on iOS.
|
|
30
|
+
* It is recommended that the host app is triggered when listening for scrolling.
|
|
31
|
+
*/
|
|
32
|
+
onViewportLeft: () => void;
|
|
21
33
|
}
|
|
22
34
|
/**
|
|
23
35
|
* The props type of StoryBlock component.
|
|
@@ -83,7 +95,6 @@ export interface IStoryBlockProps {
|
|
|
83
95
|
* 1. Loading successfully but the back end returns an empty list.
|
|
84
96
|
* 2. The load failed and list is empty.
|
|
85
97
|
* onStoryBlockLoadFinished will also be triggered when onStoryBlockEmpty is triggered.
|
|
86
|
-
* Only supported on Android.
|
|
87
98
|
*/
|
|
88
99
|
onStoryBlockEmpty?: (error?: FWError) => void;
|
|
89
100
|
/**
|
|
@@ -94,6 +105,12 @@ export interface IStoryBlockProps {
|
|
|
94
105
|
* Stop Picture in Picture callback. Only supported on iOS.
|
|
95
106
|
*/
|
|
96
107
|
onStoryBlockDidStopPictureInPicture?: (error?: FWError) => void;
|
|
108
|
+
/**
|
|
109
|
+
*
|
|
110
|
+
* The host app could use this callback to get feed id.
|
|
111
|
+
* The feed id can be used for conversion tracking.
|
|
112
|
+
*/
|
|
113
|
+
onStoryBlockGetFeedId?: (feedId: string) => void;
|
|
97
114
|
}
|
|
98
115
|
declare const _default: React.ForwardRefExoticComponent<IStoryBlockProps & React.RefAttributes<IStoryBlockMethods>>;
|
|
99
116
|
export default _default;
|
|
@@ -83,7 +83,6 @@ export interface IVideoFeedProps {
|
|
|
83
83
|
* 1. Loading successfully but the back end returns an empty list.
|
|
84
84
|
* 2. The load failed and list is empty.
|
|
85
85
|
* onVideoFeedLoadFinished will also be triggered when onVideoFeedEmpty is triggered.
|
|
86
|
-
* Only supported on Android.
|
|
87
86
|
*/
|
|
88
87
|
onVideoFeedEmpty?: (error?: FWError) => void;
|
|
89
88
|
/**
|
|
@@ -94,6 +93,12 @@ export interface IVideoFeedProps {
|
|
|
94
93
|
* Stop Picture in Picture callback. Only supported on iOS.
|
|
95
94
|
*/
|
|
96
95
|
onVideoFeedDidStopPictureInPicture?: (error?: FWError) => void;
|
|
96
|
+
/**
|
|
97
|
+
*
|
|
98
|
+
* The host app could use this callback to get feed id.
|
|
99
|
+
* The feed id can be used for conversion tracking.
|
|
100
|
+
*/
|
|
101
|
+
onVideoFeedGetFeedId?: (feedId: string) => void;
|
|
97
102
|
}
|
|
98
103
|
interface IVideoFeedState {
|
|
99
104
|
sdkInitCalled: boolean;
|
|
@@ -117,6 +122,7 @@ declare class VideoFeed extends React.Component<IVideoFeedProps, IVideoFeedState
|
|
|
117
122
|
private _onVideoFeedEmpty;
|
|
118
123
|
private _onVideoFeedDidStartPictureInPicture;
|
|
119
124
|
private _onVideoFeedDidStopPictureInPicture;
|
|
125
|
+
private _onVideoFeedGetFeedId;
|
|
120
126
|
/**
|
|
121
127
|
* @ignore
|
|
122
128
|
*/
|
|
@@ -15,7 +15,7 @@ import type AndroidFontInfo from './models/AndroidFontInfo';
|
|
|
15
15
|
import type ButtonInfo from './models/ButtonInfo';
|
|
16
16
|
import type FeedItemDetails from './models/FeedItemDetails';
|
|
17
17
|
import type FWError from './models/FWError';
|
|
18
|
-
import type { CustomClickLinkButtonEvent, CustomCTAClickEvent, CustomTapProductCardEvent, LiveStreamChatEvent, LiveStreamEvent, PlayerHandler, SDKInitEvent, ShoppingCTAEvent, UpdateProductDetailsEvent, VideoFeedClickEvent, VideoPlaybackEvent } from './models/FWEvents';
|
|
18
|
+
import type { CustomClickCartIconEvent, CustomClickLinkButtonEvent, CustomCTAClickEvent, CustomTapProductCardEvent, LiveStreamChatEvent, LiveStreamEvent, PlayerHandler, SDKInitEvent, ShoppingCTAEvent, UpdateProductDetailsEvent, VideoFeedClickEvent, VideoPlaybackEvent } from './models/FWEvents';
|
|
19
19
|
import type GradientDrawable from './models/GradientDrawable';
|
|
20
20
|
import type { GradientDrawableOrientation } from './models/GradientDrawable';
|
|
21
21
|
import type IOSFontInfo from './models/IOSFontInfo';
|
|
@@ -56,4 +56,4 @@ import VideoFeedUtil from './utils/VideoFeedUtil';
|
|
|
56
56
|
import type { CustomClickCartIconCallback, CustomClickLinkButtonCallback, CustomTapProductCardCallback, ShoppingCTACallback, UpdateProductDetailsCallback } from './VideoShopping';
|
|
57
57
|
import VideoShopping from './VideoShopping';
|
|
58
58
|
export default FireworkSDK;
|
|
59
|
-
export { AdBadgeConfiguration, AdBadgeTextType, AdConfiguration, AndroidFontInfo, ButtonInfo, CustomClickCartIconCallback, CustomClickLinkButtonCallback, CustomClickLinkButtonEvent, CustomCTAClickCallback, CustomCTAClickEvent, CustomTapProductCardCallback, CustomTapProductCardEvent, FeedItemDetails, FireworkSDK, 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, VideoPlayerLogoConfiguration, VideoPlayerLogoOption, VideoPlayerSize, VideoPlayerStyle, VideoShopping, };
|
|
59
|
+
export { AdBadgeConfiguration, AdBadgeTextType, AdConfiguration, AndroidFontInfo, ButtonInfo, CustomClickCartIconCallback, CustomClickCartIconEvent, CustomClickLinkButtonCallback, CustomClickLinkButtonEvent, CustomCTAClickCallback, CustomCTAClickEvent, CustomTapProductCardCallback, CustomTapProductCardEvent, FeedItemDetails, FireworkSDK, 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, VideoPlayerLogoConfiguration, VideoPlayerLogoOption, VideoPlayerSize, VideoPlayerStyle, VideoShopping, };
|
|
@@ -14,12 +14,12 @@ export interface SDKInitEvent {
|
|
|
14
14
|
}
|
|
15
15
|
export interface PlayerHandler {
|
|
16
16
|
/**
|
|
17
|
-
* Pause
|
|
17
|
+
* Pause The video playback associated with this CTA.
|
|
18
18
|
* Only supported on iOS
|
|
19
19
|
*/
|
|
20
20
|
pause: () => void;
|
|
21
21
|
/**
|
|
22
|
-
* Resume
|
|
22
|
+
* Resume The video playback associated with this CTA.
|
|
23
23
|
* Only supported on iOS
|
|
24
24
|
*/
|
|
25
25
|
resume: () => void;
|
|
@@ -34,6 +34,10 @@ export interface CustomCTAClickEvent {
|
|
|
34
34
|
* Only supported on iOS
|
|
35
35
|
*/
|
|
36
36
|
playerHandler?: PlayerHandler;
|
|
37
|
+
/**
|
|
38
|
+
* The video playback details for the event.
|
|
39
|
+
*/
|
|
40
|
+
video: VideoPlaybackDetails;
|
|
37
41
|
}
|
|
38
42
|
export interface VideoPlaybackEvent {
|
|
39
43
|
eventName: VideoPlaybackEventName;
|
|
@@ -55,12 +59,20 @@ export interface ShoppingCTAEvent {
|
|
|
55
59
|
* A unique identifier of the product unit.
|
|
56
60
|
*/
|
|
57
61
|
unitId: string;
|
|
62
|
+
/**
|
|
63
|
+
* The video playback details for the event.
|
|
64
|
+
*/
|
|
65
|
+
video: VideoPlaybackDetails;
|
|
58
66
|
}
|
|
59
67
|
export interface UpdateProductDetailsEvent {
|
|
60
68
|
/**
|
|
61
69
|
* A unique identifier list of the products.
|
|
62
70
|
*/
|
|
63
71
|
productIds: string[];
|
|
72
|
+
/**
|
|
73
|
+
* The video playback details for the event.
|
|
74
|
+
*/
|
|
75
|
+
video: VideoPlaybackDetails;
|
|
64
76
|
}
|
|
65
77
|
export interface CustomClickLinkButtonEvent {
|
|
66
78
|
/**
|
|
@@ -75,6 +87,11 @@ export interface CustomClickLinkButtonEvent {
|
|
|
75
87
|
* A unique identifier of the product unit.
|
|
76
88
|
*/
|
|
77
89
|
unitId: string;
|
|
90
|
+
/**
|
|
91
|
+
* The video playback details for the event.
|
|
92
|
+
* Only supported on Android.
|
|
93
|
+
*/
|
|
94
|
+
video?: VideoPlaybackDetails;
|
|
78
95
|
}
|
|
79
96
|
export interface CustomTapProductCardEvent {
|
|
80
97
|
/**
|
|
@@ -90,7 +107,7 @@ export interface CustomTapProductCardEvent {
|
|
|
90
107
|
*/
|
|
91
108
|
unitId: string;
|
|
92
109
|
/**
|
|
93
|
-
*
|
|
110
|
+
* The video playback details for the event.
|
|
94
111
|
*/
|
|
95
112
|
video: VideoPlaybackDetails;
|
|
96
113
|
/**
|
|
@@ -107,3 +124,9 @@ export interface LiveStreamChatEvent {
|
|
|
107
124
|
message: LiveStreamMessageDetails;
|
|
108
125
|
liveStream: LiveStreamEventDetails;
|
|
109
126
|
}
|
|
127
|
+
export interface CustomClickCartIconEvent {
|
|
128
|
+
/**
|
|
129
|
+
* The video playback details for the event.
|
|
130
|
+
*/
|
|
131
|
+
video: VideoPlaybackDetails;
|
|
132
|
+
}
|
|
@@ -50,5 +50,10 @@ export default interface FeedItemDetails {
|
|
|
50
50
|
* For instance, (and sport food) (or sport food) (and sport (or food comedy)) sport are all valid expressions.
|
|
51
51
|
* Non-UTF-8 characters are not allowed. If using boolean predicates, the expression needs to be wrapped with parenthesis.
|
|
52
52
|
*/
|
|
53
|
-
hashtagFilterExpression?: string;
|
|
53
|
+
hashtagFilterExpression?: string | null;
|
|
54
|
+
/**
|
|
55
|
+
* The feed id for the item.
|
|
56
|
+
* Only supported on Android.
|
|
57
|
+
*/
|
|
58
|
+
feedId?: string | null;
|
|
54
59
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReplayBadgeConfiguration } from './ReplayBadgeConfiguration';
|
|
1
2
|
import type VideoPlayerButtonConfiguration from './VideoPlayerButtonConfiguration';
|
|
2
3
|
import type { VideoPlayerCTADelay } from './VideoPlayerCTADelay';
|
|
3
4
|
import type { VideoPlayerCTAStyle } from './VideoPlayerCTAStyle';
|
|
@@ -72,7 +73,11 @@ export interface StoryBlockConfiguration {
|
|
|
72
73
|
/**
|
|
73
74
|
* Specifies the logo configuration
|
|
74
75
|
* Defaults to { option: 'disabled' }
|
|
75
|
-
* Only supported on iOS.
|
|
76
76
|
*/
|
|
77
77
|
videoPlayerLogoConfiguration?: VideoPlayerLogoConfiguration;
|
|
78
|
+
/**
|
|
79
|
+
* The configuration of replay badge.
|
|
80
|
+
* Only supported on iOS.
|
|
81
|
+
*/
|
|
82
|
+
replayBadgeConfiguration?: ReplayBadgeConfiguration;
|
|
78
83
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type IOSFontInfo from './IOSFontInfo';
|
|
2
2
|
import type AndroidFontInfo from './AndroidFontInfo';
|
|
3
3
|
import type GradientDrawable from './GradientDrawable';
|
|
4
|
+
import type { ReplayBadgeConfiguration } from './ReplayBadgeConfiguration';
|
|
4
5
|
export interface VideoFeedTitleConfiguration {
|
|
5
6
|
/**
|
|
6
7
|
* Specifies if the video feed title is hidden.
|
|
@@ -130,4 +131,9 @@ export default interface VideoFeedConfiguration {
|
|
|
130
131
|
* Defaults to 2.
|
|
131
132
|
*/
|
|
132
133
|
gridColumns?: number;
|
|
134
|
+
/**
|
|
135
|
+
* The configuration of replay badge.
|
|
136
|
+
* Only supported on iOS.
|
|
137
|
+
*/
|
|
138
|
+
replayBadge?: ReplayBadgeConfiguration;
|
|
133
139
|
}
|
|
@@ -5,6 +5,7 @@ import type { VideoPlayerCTAWidth } from './VideoPlayerCTAWidth';
|
|
|
5
5
|
import type { VideoPlayerCompleteAction } from './VideoPlayerCompleteAction';
|
|
6
6
|
import type { VideoPlayerStyle } from './VideoPlayerStyle';
|
|
7
7
|
import type { VideoPlayerLogoConfiguration } from './VideoPlayerLogoConfiguration';
|
|
8
|
+
import type { ReplayBadgeConfiguration } from './ReplayBadgeConfiguration';
|
|
8
9
|
export default interface VideoPlayerConfiguration {
|
|
9
10
|
/**
|
|
10
11
|
* Sets the proportion of the video player to its container.
|
|
@@ -70,7 +71,11 @@ export default interface VideoPlayerConfiguration {
|
|
|
70
71
|
/**
|
|
71
72
|
* Specifies the logo configuration
|
|
72
73
|
* Defaults to { option: 'disabled' }
|
|
73
|
-
* Only supported on iOS.
|
|
74
74
|
*/
|
|
75
75
|
videoPlayerLogoConfiguration?: VideoPlayerLogoConfiguration;
|
|
76
|
+
/**
|
|
77
|
+
* The configuration of replay badge.
|
|
78
|
+
* Only supported on iOS.
|
|
79
|
+
*/
|
|
80
|
+
replayBadgeConfiguration?: ReplayBadgeConfiguration;
|
|
76
81
|
}
|
|
@@ -5,6 +5,7 @@ import type TrackPurchaseParameters from '../models/TrackPurchaseParameters';
|
|
|
5
5
|
import type VideoPlayerNativeConfiguration from '../models/VideoPlayerNativeConfiguration';
|
|
6
6
|
interface IFireworkSDKModule extends NativeModule {
|
|
7
7
|
init(options?: SDKInitOptions): Promise<any>;
|
|
8
|
+
markInitCalled(): Promise<boolean>;
|
|
8
9
|
openVideoPlayer(url: string, config?: VideoPlayerNativeConfiguration): void;
|
|
9
10
|
setVideoFeedClickCallbackEnabled(enabled: boolean): void;
|
|
10
11
|
setCustomCTAClickEnabled(enabled: boolean): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-firework-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"description": "Firework React Native SDK",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -13,13 +13,9 @@
|
|
|
13
13
|
"ios",
|
|
14
14
|
"cpp",
|
|
15
15
|
"react-native-firework-sdk.podspec",
|
|
16
|
-
"FireworkVideoUI.xcframework",
|
|
17
16
|
"!lib/typescript/example",
|
|
18
17
|
"!android/build",
|
|
19
18
|
"!ios/build",
|
|
20
|
-
"!ios/FireworkVideoUI/build",
|
|
21
|
-
"!ios/FireworkVideoUI/Pods",
|
|
22
|
-
"!ios/FireworkVideoUI/scripts",
|
|
23
19
|
"!**/__tests__",
|
|
24
20
|
"!**/__fixtures__",
|
|
25
21
|
"!**/__mocks__",
|
|
@@ -27,13 +27,11 @@ fi
|
|
|
27
27
|
|
|
28
28
|
s.source_files = 'ios/**/*.{h,m,mm,swift}'
|
|
29
29
|
s.exclude_files = [
|
|
30
|
-
'ios/Support/**/*'
|
|
31
|
-
'ios/FireworkVideoUI/**/*'
|
|
30
|
+
'ios/Support/**/*'
|
|
32
31
|
]
|
|
33
|
-
s.preserve_paths = "FireworkVideoUI.xcframework"
|
|
34
|
-
s.vendored_frameworks = "FireworkVideoUI.xcframework"
|
|
35
32
|
|
|
36
33
|
s.static_framework = true
|
|
37
34
|
s.dependency 'React-Core'
|
|
38
|
-
s.dependency '
|
|
35
|
+
s.dependency 'FireworkVideoUI', '0.1.0'
|
|
36
|
+
s.dependency 'FireworkVideo', '1.18.0'
|
|
39
37
|
end
|
package/src/FireworkSDK.ts
CHANGED
|
@@ -190,8 +190,8 @@ class FireworkSDK {
|
|
|
190
190
|
this.eventEmitter.addListener(FWEventName.SDKInit, (event) => {
|
|
191
191
|
FWLoggerUtil.log(`Receive SDKInit event ${event?.error}`);
|
|
192
192
|
|
|
193
|
-
if (this.onSDKInit) {
|
|
194
|
-
this.onSDKInit(event
|
|
193
|
+
if (this.onSDKInit && event) {
|
|
194
|
+
this.onSDKInit(event);
|
|
195
195
|
}
|
|
196
196
|
});
|
|
197
197
|
|
|
@@ -205,21 +205,18 @@ class FireworkSDK {
|
|
|
205
205
|
`Receive CustomCTAClick callbackId: ${event?.callbackId}`
|
|
206
206
|
);
|
|
207
207
|
|
|
208
|
-
if (this.onCustomCTAClick) {
|
|
209
|
-
if (event) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
};
|
|
218
|
-
}
|
|
208
|
+
if (this.onCustomCTAClick && event) {
|
|
209
|
+
if (event.callbackId) {
|
|
210
|
+
const callbackId = event.callbackId;
|
|
211
|
+
delete event.callbackId;
|
|
212
|
+
if (Platform.OS === 'ios') {
|
|
213
|
+
event.playerHandler = {
|
|
214
|
+
pause: () => FireworkSDKModule.pausePlayer(callbackId),
|
|
215
|
+
resume: () => FireworkSDKModule.resumePlayer(callbackId),
|
|
216
|
+
};
|
|
219
217
|
}
|
|
220
218
|
}
|
|
221
|
-
|
|
222
|
-
this.onCustomCTAClick(event ?? {});
|
|
219
|
+
this.onCustomCTAClick(event);
|
|
223
220
|
}
|
|
224
221
|
});
|
|
225
222
|
|
|
@@ -228,16 +225,16 @@ class FireworkSDK {
|
|
|
228
225
|
`Receive VideoPlayback event eventName: ${event?.eventName}`
|
|
229
226
|
);
|
|
230
227
|
|
|
231
|
-
if (this.onVideoPlayback) {
|
|
232
|
-
this.onVideoPlayback(event
|
|
228
|
+
if (this.onVideoPlayback && event) {
|
|
229
|
+
this.onVideoPlayback(event);
|
|
233
230
|
}
|
|
234
231
|
});
|
|
235
232
|
|
|
236
233
|
this.eventEmitter.addListener(FWEventName.VideoFeedClick, (event) => {
|
|
237
234
|
FWLoggerUtil.log(`Receive VideoFeedClick event id: ${event?.info.id}`);
|
|
238
235
|
|
|
239
|
-
if (this.onVideoFeedClick) {
|
|
240
|
-
this.onVideoFeedClick(event
|
|
236
|
+
if (this.onVideoFeedClick && event) {
|
|
237
|
+
this.onVideoFeedClick(event);
|
|
241
238
|
}
|
|
242
239
|
});
|
|
243
240
|
|
|
@@ -278,6 +275,14 @@ class FireworkSDK {
|
|
|
278
275
|
* You only need to call this method when you call init method in native side instead of JS side.
|
|
279
276
|
*/
|
|
280
277
|
public async markInitCalled(): Promise<void> {
|
|
278
|
+
FWLoggerUtil.log('Call FireworkSDK markInitCalled method');
|
|
279
|
+
|
|
280
|
+
const hasCalledSDKInitFromNative = await FireworkSDKModule.markInitCalled();
|
|
281
|
+
if (hasCalledSDKInitFromNative) {
|
|
282
|
+
await ShoppingModule.init();
|
|
283
|
+
await LiveStreamModule.init();
|
|
284
|
+
}
|
|
285
|
+
|
|
281
286
|
FWGlobalState.getInstance().resolveSdkInitCalled();
|
|
282
287
|
}
|
|
283
288
|
|
|
@@ -303,12 +308,10 @@ class FireworkSDK {
|
|
|
303
308
|
public async trackPurchase(
|
|
304
309
|
parameters: TrackPurchaseParameters
|
|
305
310
|
): Promise<void> {
|
|
306
|
-
if (
|
|
307
|
-
|
|
308
|
-
await FWGlobalState.getInstance().sdkInitCalledPromise;
|
|
309
|
-
}
|
|
310
|
-
FireworkSDKModule.trackPurchase(parameters);
|
|
311
|
+
if (!FWGlobalState.getInstance().sdkInitCalled) {
|
|
312
|
+
await FWGlobalState.getInstance().sdkInitCalledPromise;
|
|
311
313
|
}
|
|
314
|
+
FireworkSDKModule.trackPurchase(parameters);
|
|
312
315
|
}
|
|
313
316
|
|
|
314
317
|
/**
|
package/src/VideoShopping.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { NativeEventEmitter, Platform } from 'react-native';
|
|
|
2
2
|
|
|
3
3
|
import { FWEventName } from './models/FWEventName';
|
|
4
4
|
import type {
|
|
5
|
+
CustomClickCartIconEvent,
|
|
5
6
|
CustomClickLinkButtonEvent,
|
|
6
7
|
CustomTapProductCardEvent,
|
|
7
8
|
ShoppingCTAEvent,
|
|
@@ -20,7 +21,9 @@ export type ShoppingCTACallback = (
|
|
|
20
21
|
event: ShoppingCTAEvent
|
|
21
22
|
) => Promise<ShoppingCTAResult> | ShoppingCTAResult;
|
|
22
23
|
|
|
23
|
-
export type CustomClickCartIconCallback = (
|
|
24
|
+
export type CustomClickCartIconCallback = (
|
|
25
|
+
event: CustomClickCartIconEvent
|
|
26
|
+
) => Promise<void> | void;
|
|
24
27
|
|
|
25
28
|
export type UpdateProductDetailsCallbackResult = Product[] | undefined | null;
|
|
26
29
|
export type UpdateProductDetailsCallback = (
|
|
@@ -186,9 +189,9 @@ class VideoShopping {
|
|
|
186
189
|
}
|
|
187
190
|
);
|
|
188
191
|
|
|
189
|
-
this.eventEmitter.addListener(FWEventName.ClickCartIcon, () => {
|
|
192
|
+
this.eventEmitter.addListener(FWEventName.ClickCartIcon, (event) => {
|
|
190
193
|
FWLoggerUtil.log('Receive ClickCartIcon event');
|
|
191
|
-
this.handleClickCartIconEvent();
|
|
194
|
+
this.handleClickCartIconEvent(event);
|
|
192
195
|
});
|
|
193
196
|
|
|
194
197
|
this.eventEmitter.addListener(FWEventName.UpdateProductDetails, (event) => {
|
|
@@ -213,10 +216,6 @@ class VideoShopping {
|
|
|
213
216
|
this.eventEmitter.addListener(FWEventName.CustomProductCardTap, (event) => {
|
|
214
217
|
FWLoggerUtil.log(`Receive CustomProductCardTap event url: ${event?.url}`);
|
|
215
218
|
if (event) {
|
|
216
|
-
if (!event.video) {
|
|
217
|
-
event.video = { videoId: '' };
|
|
218
|
-
}
|
|
219
|
-
|
|
220
219
|
if (event.callbackId) {
|
|
221
220
|
const callbackId = event.callbackId;
|
|
222
221
|
delete event.callbackId;
|
|
@@ -227,9 +226,8 @@ class VideoShopping {
|
|
|
227
226
|
};
|
|
228
227
|
}
|
|
229
228
|
}
|
|
229
|
+
this.handleCustomProductCardTapEvent(event);
|
|
230
230
|
}
|
|
231
|
-
|
|
232
|
-
this.handleCustomProductCardTapEvent(event ?? {});
|
|
233
231
|
});
|
|
234
232
|
}
|
|
235
233
|
|
|
@@ -269,9 +267,9 @@ class VideoShopping {
|
|
|
269
267
|
}
|
|
270
268
|
}
|
|
271
269
|
|
|
272
|
-
private async handleClickCartIconEvent() {
|
|
270
|
+
private async handleClickCartIconEvent(event: any) {
|
|
273
271
|
if (this.onCustomClickCartIcon) {
|
|
274
|
-
this.onCustomClickCartIcon();
|
|
272
|
+
this.onCustomClickCartIcon(event as CustomClickCartIconEvent);
|
|
275
273
|
}
|
|
276
274
|
}
|
|
277
275
|
|
|
@@ -47,6 +47,18 @@ export interface IStoryBlockMethods {
|
|
|
47
47
|
* Only supported on Android.
|
|
48
48
|
*/
|
|
49
49
|
openFullscreen: () => void;
|
|
50
|
+
/**
|
|
51
|
+
* Triggered when the story block enters the viewport.
|
|
52
|
+
* Only supported on iOS.
|
|
53
|
+
* It is recommended that the host app is triggered when listening for scrolling.
|
|
54
|
+
*/
|
|
55
|
+
onViewportEntered: () => void;
|
|
56
|
+
/**
|
|
57
|
+
* Triggered when the story block leaves the viewport.
|
|
58
|
+
* Only supported on iOS.
|
|
59
|
+
* It is recommended that the host app is triggered when listening for scrolling.
|
|
60
|
+
*/
|
|
61
|
+
onViewportLeft: () => void;
|
|
50
62
|
}
|
|
51
63
|
|
|
52
64
|
/**
|
|
@@ -113,7 +125,6 @@ export interface IStoryBlockProps {
|
|
|
113
125
|
* 1. Loading successfully but the back end returns an empty list.
|
|
114
126
|
* 2. The load failed and list is empty.
|
|
115
127
|
* onStoryBlockLoadFinished will also be triggered when onStoryBlockEmpty is triggered.
|
|
116
|
-
* Only supported on Android.
|
|
117
128
|
*/
|
|
118
129
|
onStoryBlockEmpty?: (error?: FWError) => void;
|
|
119
130
|
/**
|
|
@@ -124,6 +135,12 @@ export interface IStoryBlockProps {
|
|
|
124
135
|
* Stop Picture in Picture callback. Only supported on iOS.
|
|
125
136
|
*/
|
|
126
137
|
onStoryBlockDidStopPictureInPicture?: (error?: FWError) => void;
|
|
138
|
+
/**
|
|
139
|
+
*
|
|
140
|
+
* The host app could use this callback to get feed id.
|
|
141
|
+
* The feed id can be used for conversion tracking.
|
|
142
|
+
*/
|
|
143
|
+
onStoryBlockGetFeedId?: (feedId: string) => void;
|
|
127
144
|
}
|
|
128
145
|
|
|
129
146
|
const StoryBlock: ForwardRefRenderFunction<
|
|
@@ -223,6 +240,21 @@ const StoryBlock: ForwardRefRenderFunction<
|
|
|
223
240
|
}
|
|
224
241
|
};
|
|
225
242
|
|
|
243
|
+
const handleStoryBlockGetFeedId = (event: NativeSyntheticEvent<any>) => {
|
|
244
|
+
FWLoggerUtil.log(
|
|
245
|
+
`StoryBlock handleStoryBlockGetFeedId ${JSON.stringify(
|
|
246
|
+
event.nativeEvent
|
|
247
|
+
)}`
|
|
248
|
+
);
|
|
249
|
+
const { onStoryBlockGetFeedId } = props;
|
|
250
|
+
|
|
251
|
+
const { feedId } = event.nativeEvent;
|
|
252
|
+
|
|
253
|
+
if (onStoryBlockGetFeedId) {
|
|
254
|
+
onStoryBlockGetFeedId(feedId ?? '');
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
|
|
226
258
|
const generateDynamicContentParametersString = (): string => {
|
|
227
259
|
const { dynamicContentParameters } = props;
|
|
228
260
|
|
|
@@ -328,6 +360,9 @@ const StoryBlock: ForwardRefRenderFunction<
|
|
|
328
360
|
storyBlockConfiguration?.ctaHighlightDelay?.value?.toFixed(5);
|
|
329
361
|
const shareBaseURL = storyBlockConfiguration?.shareBaseURL;
|
|
330
362
|
const buttonConfiguration = storyBlockConfiguration?.buttonConfiguration;
|
|
363
|
+
const videoPlayerLogoConfigurationJsonKey = gennerateJsonKey(
|
|
364
|
+
storyBlockConfiguration?.videoPlayerLogoConfiguration
|
|
365
|
+
);
|
|
331
366
|
const ctaWidth = storyBlockConfiguration?.ctaWidth;
|
|
332
367
|
const showVideoDetailTitle = storyBlockConfiguration?.showVideoDetailTitle;
|
|
333
368
|
|
|
@@ -337,6 +372,9 @@ const StoryBlock: ForwardRefRenderFunction<
|
|
|
337
372
|
const productInfoViewConfigurationJsonKey = gennerateJsonKey(
|
|
338
373
|
FireworkSDK.getInstance().shopping.productInfoViewConfiguration
|
|
339
374
|
);
|
|
375
|
+
const replayBadgeConfigurationJsonKey = gennerateJsonKey(
|
|
376
|
+
storyBlockConfiguration?.replayBadgeConfiguration
|
|
377
|
+
);
|
|
340
378
|
|
|
341
379
|
let key = `gShareBaseURL:${gShareBaseURL}`;
|
|
342
380
|
if (Platform.OS === 'ios') {
|
|
@@ -391,18 +429,24 @@ const StoryBlock: ForwardRefRenderFunction<
|
|
|
391
429
|
key += `_buttonConfiguration.pauseButton:${generateButtonInfoString(
|
|
392
430
|
buttonConfiguration?.pauseButton
|
|
393
431
|
)}`;
|
|
432
|
+
if (Platform.OS === 'android') {
|
|
433
|
+
key += `_videoPlayerLogoConfiguration:${videoPlayerLogoConfigurationJsonKey}`;
|
|
434
|
+
}
|
|
394
435
|
key += `_showVideoDetailTitle:${showVideoDetailTitle}`;
|
|
395
436
|
|
|
396
437
|
key += `_requiresAds:${requiresAds}`;
|
|
397
438
|
key += `_adsFetchTimeout:${adsFetchTimeout}`;
|
|
398
439
|
key += `_vastAttributes:${vastAttributesString}`;
|
|
399
|
-
key += `
|
|
440
|
+
key += `_productInfoViewConfiguration:${productInfoViewConfigurationJsonKey}`;
|
|
441
|
+
key += `_replayBadgeConfiguration:${replayBadgeConfigurationJsonKey}`;
|
|
400
442
|
|
|
401
443
|
return key;
|
|
402
444
|
};
|
|
403
445
|
|
|
404
446
|
const key = generateKey();
|
|
405
447
|
|
|
448
|
+
console.log('story block key', key);
|
|
449
|
+
|
|
406
450
|
useImperativeHandle(
|
|
407
451
|
forwardedRef,
|
|
408
452
|
() => {
|
|
@@ -414,12 +458,14 @@ const StoryBlock: ForwardRefRenderFunction<
|
|
|
414
458
|
if (Platform.OS === 'android') {
|
|
415
459
|
commandId = commandId.toString();
|
|
416
460
|
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
commandId,
|
|
421
|
-
[]
|
|
461
|
+
let reactTag: number | null = findNodeHandle(nativeNodeHandle);
|
|
462
|
+
FWLoggerUtil.log(
|
|
463
|
+
`StoryBlock sendCommand: ${command} commandId: ${commandId} nativeNodeHandle: ${nativeNodeHandle} reactTag: ${reactTag}`
|
|
422
464
|
);
|
|
465
|
+
if (!nativeNodeHandle || !reactTag) {
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
UIManager.dispatchViewManagerCommand(reactTag, commandId, []);
|
|
423
469
|
};
|
|
424
470
|
return {
|
|
425
471
|
play: () => {
|
|
@@ -431,6 +477,18 @@ const StoryBlock: ForwardRefRenderFunction<
|
|
|
431
477
|
openFullscreen: () => {
|
|
432
478
|
sendCommand('openFullscreen');
|
|
433
479
|
},
|
|
480
|
+
onViewportEntered: () => {
|
|
481
|
+
if (Platform.OS !== 'ios') {
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
sendCommand('onViewportEntered');
|
|
485
|
+
},
|
|
486
|
+
onViewportLeft: () => {
|
|
487
|
+
if (Platform.OS !== 'ios') {
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
sendCommand('onViewportLeft');
|
|
491
|
+
},
|
|
434
492
|
};
|
|
435
493
|
},
|
|
436
494
|
[]
|
|
@@ -497,6 +555,9 @@ const StoryBlock: ForwardRefRenderFunction<
|
|
|
497
555
|
setTimeout(() => {
|
|
498
556
|
const viewId = findNodeHandle(nativeComponentRef.current);
|
|
499
557
|
FWLoggerUtil.log(`StoryBlock createFragment viewId: ${viewId}`);
|
|
558
|
+
if (!viewId) {
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
500
561
|
UIManager.dispatchViewManagerCommand(
|
|
501
562
|
viewId,
|
|
502
563
|
UIManager.getViewManagerConfig(
|
|
@@ -535,6 +596,7 @@ const StoryBlock: ForwardRefRenderFunction<
|
|
|
535
596
|
onStoryBlockDidStopPictureInPicture={
|
|
536
597
|
handleStoryBlockDidStopPictureInPicture
|
|
537
598
|
}
|
|
599
|
+
onStoryBlockGetFeedId={handleStoryBlockGetFeedId}
|
|
538
600
|
/>
|
|
539
601
|
);
|
|
540
602
|
};
|