react-native-firework-sdk 2.0.0 → 2.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FireworkVideoUI.xcframework/Info.plist +40 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Headers/FireworkVideoUI-Swift.h +280 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Headers/FireworkVideoUI.h +18 -0
- 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 +1327 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.private.swiftinterface +41 -0
- 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 +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/module.modulemap +11 -0
- 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 +556 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Headers/FireworkVideoUI.h +18 -0
- 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 +1327 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +41 -0
- 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 +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json +1327 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +41 -0
- 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 +41 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/module.modulemap +11 -0
- package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +245 -0
- package/README.md +1 -1
- package/android/build.gradle +5 -4
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +6 -0
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/StoryBlockFragment.kt +129 -0
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/StoryBlockFrameLayout.kt +90 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModelDeserializer.kt +3 -3
- package/android/src/main/java/com/fireworksdk/bridge/models/FWEventName.kt +5 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModelDeserializer.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfiguration.kt +18 -5
- package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfigurationDeserializer.kt +36 -8
- package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModelDeserializer.kt +3 -3
- package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResult.kt +17 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResultDeserializer.kt +33 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModelDeserializer.kt +14 -12
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelDeserializer.kt +11 -7
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedSource.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlaybackDetails.kt +8 -8
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt +19 -12
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoShoppingProductDeserializer.kt +11 -11
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +131 -45
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +11 -3
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWVideoShoppingInterface.kt +2 -2
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWLiveStreamModule.kt +45 -4
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWNavigatorModule.kt +9 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +83 -50
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +112 -36
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +16 -6
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +26 -32
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWGlobalDataUtil.kt +10 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWLanguageUtil.kt +48 -16
- package/android/src/main/res/layout/fw_bridge_story_block.xml +24 -0
- package/ios/Components/StoryBlock.swift +32 -2
- package/ios/Components/StoryBlockManager.m +33 -0
- package/ios/Components/StoryBlockManager.swift +4 -0
- package/ios/Components/VideoFeed.swift +16 -32
- package/ios/Components/VideoFeedManager.m +12 -6
- package/ios/Components/VideoFeedManager.swift +4 -0
- package/ios/Components/VideoPlayerConfiguration.swift +1 -0
- package/ios/FireworkSdk.xcodeproj/project.pbxproj +276 -212
- package/ios/FireworkVideoUI/FireworkVideoUI/FireworkVideoUI.docc/FireworkVideoUI.md +13 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/FireworkVideoUI.h +18 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/AppLanguageManager.swift +147 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/Bundle+AppLanguage.swift +58 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/NumberFormatter+AppLanguage.swift +25 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/URLSession+AppLanguage.swift +69 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIImageView+AppLanguage.swift +91 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UILabel+AppLanguage.swift +98 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UITextField+AppLanguage.swift +97 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UITextView+AppLanguage.swift +97 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIView+AppLanguage.swift +38 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIViewController+AppLanguage.swift +46 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIWindow+AppLanguage.swift +26 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/LanguageUtil.swift +43 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/Foundation/NSObject+LayoutFlip.swift +42 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/CALayer+LayoutFlip.swift +160 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/UILabel+LayoutFlip.swift +35 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/UIView+LayoutFlip.swift +199 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/LayoutFlipManager.swift +59 -0
- package/ios/{Utils/DispatchQueue+FWOnce.swift → FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/Foundation/DispatchQueue+Once.swift} +5 -5
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/Foundation/String+Base64.swift +18 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/UIKit/UIView+UIHierarchy.swift +46 -0
- package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Swizzle.swift +37 -0
- package/ios/FireworkVideoUI/FireworkVideoUI.xcodeproj/project.pbxproj +766 -0
- package/ios/FireworkVideoUI/FireworkVideoUI.xcworkspace/contents.xcworkspacedata +10 -0
- package/ios/FireworkVideoUI/FireworkVideoUI.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/FireworkVideoUI/FireworkVideoUITests/FireworkVideoUITests.swift +37 -0
- package/ios/FireworkVideoUI/Podfile +15 -0
- package/ios/FireworkVideoUI/Podfile.lock +16 -0
- package/ios/Models/NativeToRN/FireworkEventName.swift +7 -1
- package/ios/Models/NativeToRN/FireworkSDK+Json.swift +5 -1
- package/ios/Models/RNToNative/RCTConvert+Shopping.swift +21 -0
- package/ios/Models/RNToNative/RCTConvert+StoryBlock.swift +2 -1
- package/ios/Models/RNToNative/RCTConvert+VideoFeed.swift +29 -1
- package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +13 -101
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +34 -16
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +1 -0
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +48 -2
- package/ios/Modules/FireworkSDKModule/SDKInitOptions.swift +0 -1
- package/ios/Modules/LiveStream/LiveStreamModule.swift +1 -0
- package/ios/Modules/Shopping/ProductInfoViewConfiguration.swift +7 -2
- package/ios/Modules/Shopping/ShoppingCTAResult.swift +16 -0
- package/ios/Modules/Shopping/ShoppingModule.m +2 -1
- package/ios/Modules/Shopping/ShoppingModule.swift +92 -34
- package/ios/Support/MultiHostStreaming/FWMultiHostStreaming.podspec +22 -0
- package/ios/Support/MultiHostStreaming/Sources/MultiHostStreamingSDK.swift +17 -0
- package/ios/Utils/{UINavigationController+FWSwizzle.swift → Extensions/Swizzle/UINavigationController+FWSwizzle.swift} +9 -8
- package/ios/Utils/FWSwizzleLoader.m +6 -1
- package/ios/Utils/FWSwizzleLoader.swift +13 -0
- package/ios/react_native_firework_sdk.h +1 -0
- package/ios/scripts/react_native_firework_sdk_pods.rb +27 -0
- package/lib/commonjs/FireworkSDK.js +55 -15
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/LiveStream.js +2 -2
- package/lib/commonjs/LiveStream.js.map +1 -1
- package/lib/commonjs/VideoShopping.js +21 -38
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/StoryBlock.js +193 -128
- package/lib/commonjs/components/StoryBlock.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +17 -5
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/FWEventName.js +3 -0
- package/lib/commonjs/models/FWEventName.js.map +1 -1
- package/lib/commonjs/models/ShoppingCTAResult.js +2 -0
- package/lib/commonjs/models/VideoPlaybackEventName.js +3 -0
- package/lib/commonjs/models/VideoPlaybackEventName.js.map +1 -1
- package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
- package/lib/commonjs/modules/ShoppingModule.js.map +1 -1
- package/lib/module/FireworkSDK.js +54 -15
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/LiveStream.js +2 -2
- package/lib/module/LiveStream.js.map +1 -1
- package/lib/module/VideoShopping.js +21 -40
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/StoryBlock.js +183 -133
- package/lib/module/components/StoryBlock.js.map +1 -1
- package/lib/module/components/VideoFeed.js +16 -5
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/FWEventName.js +3 -0
- package/lib/module/models/FWEventName.js.map +1 -1
- package/lib/module/models/ShoppingCTAResult.js +2 -0
- package/lib/module/models/VideoPlaybackEventName.js +3 -0
- package/lib/module/models/VideoPlaybackEventName.js.map +1 -1
- package/lib/module/modules/FireworkSDKModule.js.map +1 -1
- package/lib/module/modules/ShoppingModule.js.map +1 -1
- package/lib/typescript/FireworkSDK.d.ts +15 -8
- package/lib/typescript/LiveStream.d.ts +2 -2
- package/lib/typescript/VideoShopping.d.ts +10 -12
- package/lib/typescript/components/StoryBlock.d.ts +25 -24
- package/lib/typescript/components/VideoFeed.d.ts +7 -0
- package/lib/typescript/index.d.ts +6 -6
- package/lib/typescript/models/FWEventName.d.ts +3 -0
- package/lib/typescript/models/FWEvents.d.ts +14 -1
- package/lib/typescript/models/ProductInfoViewConfiguration.d.ts +12 -8
- package/lib/typescript/models/SDKInitOptions.d.ts +6 -1
- package/lib/typescript/models/ShoppingCTAResult.d.ts +11 -0
- package/lib/typescript/models/StoryBlockSource.d.ts +1 -1
- package/lib/typescript/models/VideoFeedSource.d.ts +1 -1
- package/lib/typescript/models/VideoPlaybackDetails.d.ts +16 -0
- package/lib/typescript/models/VideoPlaybackEventName.d.ts +13 -1
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +4 -0
- package/lib/typescript/modules/FireworkSDKModule.d.ts +1 -2
- package/lib/typescript/modules/ShoppingModule.d.ts +2 -1
- package/package.json +8 -3
- package/react-native-firework-sdk.podspec +31 -24
- package/src/FireworkSDK.ts +54 -15
- package/src/LiveStream.ts +2 -2
- package/src/VideoShopping.ts +41 -54
- package/src/components/StoryBlock.tsx +210 -98
- package/src/components/VideoFeed.tsx +23 -4
- package/src/index.ts +15 -9
- package/src/models/FWEventName.ts +3 -0
- package/src/models/FWEvents.ts +14 -1
- package/src/models/ProductInfoViewConfiguration.ts +13 -8
- package/src/models/SDKInitOptions.ts +6 -1
- package/src/models/ShoppingCTAResult.ts +11 -0
- package/src/models/StoryBlockSource.ts +2 -1
- package/src/models/VideoFeedSource.ts +2 -1
- package/src/models/VideoPlaybackDetails.ts +16 -0
- package/src/models/VideoPlaybackEventName.ts +13 -1
- package/src/models/VideoPlayerConfiguration.ts +4 -0
- package/src/modules/FireworkSDKModule.ts +1 -2
- package/src/modules/ShoppingModule.ts +5 -5
- package/android/src/main/java/com/fireworksdk/bridge/constants/FWCommandConstant.kt +0 -6
- package/ios/Utils/FWSwizzleUtil.swift +0 -29
- package/ios/Utils/UIView+ParentViewController.swift +0 -21
- package/lib/commonjs/models/AddToCartResult.js +0 -2
- package/lib/module/models/AddToCartResult.js +0 -2
- package/lib/typescript/models/AddToCartResult.d.ts +0 -10
- package/src/models/AddToCartResult.ts +0 -10
- /package/ios/Utils/{String+Color.swift → Extensions/String+Color.swift} +0 -0
- /package/ios/Utils/{UIView+Constraints.swift → Extensions/UIView+Constraints.swift} +0 -0
- /package/ios/Utils/{UIViewController+AttachChild.swift → Extensions/UIViewController+AttachChild.swift} +0 -0
- /package/lib/commonjs/models/{AddToCartResult.js.map → ShoppingCTAResult.js.map} +0 -0
- /package/lib/module/models/{AddToCartResult.js.map → ShoppingCTAResult.js.map} +0 -0
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
import type IOSFontInfo from './IOSFontInfo';
|
|
2
|
-
export
|
|
2
|
+
export type ShoppingCTAButtonText = 'addToCart' | 'shopNow';
|
|
3
|
+
export interface ShoppingCTAButtonConfiguration {
|
|
3
4
|
/**
|
|
4
|
-
* The
|
|
5
|
+
* The text of shopping CTA button.
|
|
6
|
+
*/
|
|
7
|
+
text?: ShoppingCTAButtonText;
|
|
8
|
+
/**
|
|
9
|
+
* The background color of CTA button.
|
|
5
10
|
*/
|
|
6
11
|
backgroundColor?: string;
|
|
7
12
|
/**
|
|
8
|
-
* The text color of
|
|
13
|
+
* The text color of CTA button.
|
|
9
14
|
*/
|
|
10
15
|
textColor?: string;
|
|
11
16
|
/**
|
|
12
|
-
* The font size of
|
|
17
|
+
* The font size of CTA button.
|
|
13
18
|
*/
|
|
14
19
|
fontSize?: number;
|
|
15
20
|
/**
|
|
16
21
|
* The iOS font info of "Add to cart" button.
|
|
17
22
|
* The property is ignored when fontSize is not set.
|
|
18
|
-
* Only supported on iOS.
|
|
19
23
|
*/
|
|
20
24
|
iOSFontInfo?: IOSFontInfo;
|
|
21
25
|
}
|
|
@@ -24,11 +28,11 @@ export interface LinkButtonConfiguration {
|
|
|
24
28
|
}
|
|
25
29
|
export default interface ProductInfoViewConfiguration {
|
|
26
30
|
/**
|
|
27
|
-
* Configuration of
|
|
31
|
+
* Configuration of shopping CTA button. Only supported on iOS.
|
|
28
32
|
*/
|
|
29
|
-
|
|
33
|
+
ctaButton?: ShoppingCTAButtonConfiguration;
|
|
30
34
|
/**
|
|
31
|
-
* Configuration of link button next to "Add to cart" button.
|
|
35
|
+
* Configuration of link button next to "Add to cart" button.
|
|
32
36
|
*/
|
|
33
37
|
linkButton?: LinkButtonConfiguration;
|
|
34
38
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export type VideoLaunchBehavior = 'default' | 'muteOnFirstLaunch';
|
|
2
2
|
export default interface SDKInitOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Custom value to identify the current user.
|
|
5
|
+
*/
|
|
3
6
|
userId?: string;
|
|
4
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Behavior occurring after video is launched.
|
|
9
|
+
*/
|
|
5
10
|
videoLaunchBehavior?: VideoLaunchBehavior;
|
|
6
11
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default interface ShoppingCTAResult {
|
|
2
|
+
/**
|
|
3
|
+
* The result of shopping CTA button.
|
|
4
|
+
*/
|
|
5
|
+
res: 'success' | 'fail';
|
|
6
|
+
/**
|
|
7
|
+
* We will show a toast to display the tips.
|
|
8
|
+
* If the property is undefined or empty string, we don't show a toast.
|
|
9
|
+
*/
|
|
10
|
+
tips?: string;
|
|
11
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type StoryBlockSource = 'discover' | 'channel' | 'playlist' | 'dynamicContent';
|
|
1
|
+
export type StoryBlockSource = 'discover' | 'channel' | 'playlist' | 'dynamicContent' | 'hashtagPlaylist';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type VideoFeedSource = 'discover' | 'channel' | 'playlist' | 'playlistGroup' | 'dynamicContent';
|
|
1
|
+
export type VideoFeedSource = 'discover' | 'channel' | 'playlist' | 'playlistGroup' | 'dynamicContent' | 'hashtagPlaylist';
|
|
@@ -27,4 +27,20 @@ export default interface VideoPlaybackDetails {
|
|
|
27
27
|
* Indicates if the video is associated with a call-to-action (CTA).
|
|
28
28
|
*/
|
|
29
29
|
hasCTA?: boolean | null;
|
|
30
|
+
/**
|
|
31
|
+
* The amount of time the video was playing at the time of the event.
|
|
32
|
+
*/
|
|
33
|
+
progress?: number | null;
|
|
34
|
+
/**
|
|
35
|
+
* The type of the CTA button clicked: "buy" "download" "view" "book".
|
|
36
|
+
*/
|
|
37
|
+
ctaActionType?: string | null;
|
|
38
|
+
/**
|
|
39
|
+
* The url of the CTA button clicked.
|
|
40
|
+
*/
|
|
41
|
+
ctaActionURL?: string | null;
|
|
42
|
+
/**
|
|
43
|
+
* The associated feed ID
|
|
44
|
+
*/
|
|
45
|
+
feedId?: string | null;
|
|
30
46
|
}
|
|
@@ -7,6 +7,14 @@ declare enum VideoPlaybackEventName {
|
|
|
7
7
|
* Video started.
|
|
8
8
|
*/
|
|
9
9
|
Start = "fw:video:start",
|
|
10
|
+
/**
|
|
11
|
+
* Video paused.
|
|
12
|
+
*/
|
|
13
|
+
Pause = "fw:video:pause",
|
|
14
|
+
/**
|
|
15
|
+
* Video resume.
|
|
16
|
+
*/
|
|
17
|
+
Resume = "fw:video:resume",
|
|
10
18
|
/**
|
|
11
19
|
* Video reached 25%.
|
|
12
20
|
*/
|
|
@@ -24,7 +32,11 @@ declare enum VideoPlaybackEventName {
|
|
|
24
32
|
*/
|
|
25
33
|
Complete = "fw:video:complete",
|
|
26
34
|
/**
|
|
27
|
-
*
|
|
35
|
+
* Ad video started playing.
|
|
36
|
+
*/
|
|
37
|
+
AdStart = "fw:video:ad-start",
|
|
38
|
+
/**
|
|
39
|
+
* Ad video completed playing.
|
|
28
40
|
*/
|
|
29
41
|
AdEnd = "fw:video:ad-end",
|
|
30
42
|
/**
|
|
@@ -69,4 +69,8 @@ export default interface VideoPlayerConfiguration {
|
|
|
69
69
|
* Specifies the delay before the highlight animation occurs. Only supported on iOS.
|
|
70
70
|
*/
|
|
71
71
|
ctaHighlightDelay?: VideoPlayerCTADelay;
|
|
72
|
+
/**
|
|
73
|
+
* The share base URL of the video.
|
|
74
|
+
*/
|
|
75
|
+
shareBaseURL?: string;
|
|
72
76
|
}
|
|
@@ -11,8 +11,7 @@ interface IFireworkSDKModule extends NativeModule {
|
|
|
11
11
|
setVideoPlaybackEventEnabled(enabled: boolean): void;
|
|
12
12
|
setAdBadgeConfiguration(config?: AdBadgeConfiguration): Promise<any>;
|
|
13
13
|
trackPurchase(parameters: TrackPurchaseParameters): void;
|
|
14
|
-
changeAppLanguage(language
|
|
15
|
-
restart(): Promise<any>;
|
|
14
|
+
changeAppLanguage(language?: string | null): Promise<boolean>;
|
|
16
15
|
}
|
|
17
16
|
declare const FireworkSDKModuleEventEmitter: NativeEventEmitter;
|
|
18
17
|
export { FireworkSDKModuleEventEmitter };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { NativeEventEmitter, NativeModule } from 'react-native';
|
|
2
2
|
import type Product from '../models/Product';
|
|
3
3
|
import type ProductInfoViewConfiguration from '../models/ProductInfoViewConfiguration';
|
|
4
|
+
import type ShoppingCTAResult from '../models/ShoppingCTAResult';
|
|
4
5
|
interface IShoppingModule extends NativeModule {
|
|
5
6
|
init(): void;
|
|
6
7
|
updateVideoProducts(products: Product[], callbackId: number | string): void;
|
|
7
|
-
|
|
8
|
+
updateShoppingCTAResult(result: ShoppingCTAResult, callbackId: number | string): void;
|
|
8
9
|
setCartIconVisible(visible: boolean): void;
|
|
9
10
|
setCartItemCount(count: number): void;
|
|
10
11
|
setCustomClickCartIconEnabled(enabled: boolean): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-firework-sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.2.0-beta.1",
|
|
4
4
|
"description": "Firework React Native SDK",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -13,13 +13,18 @@
|
|
|
13
13
|
"ios",
|
|
14
14
|
"cpp",
|
|
15
15
|
"react-native-firework-sdk.podspec",
|
|
16
|
+
"FireworkVideoUI.xcframework",
|
|
16
17
|
"!lib/typescript/example",
|
|
17
18
|
"!android/build",
|
|
18
19
|
"!ios/build",
|
|
20
|
+
"!ios/FireworkVideoUI/build",
|
|
21
|
+
"!ios/FireworkVideoUI/Pods",
|
|
22
|
+
"!ios/FireworkVideoUI/scripts",
|
|
19
23
|
"!**/__tests__",
|
|
20
24
|
"!**/__fixtures__",
|
|
21
25
|
"!**/__mocks__",
|
|
22
|
-
"!docs/"
|
|
26
|
+
"!docs/",
|
|
27
|
+
"!README_PUBLIC_REPO.md"
|
|
23
28
|
],
|
|
24
29
|
"scripts": {
|
|
25
30
|
"test": "jest",
|
|
@@ -34,7 +39,7 @@
|
|
|
34
39
|
"android"
|
|
35
40
|
],
|
|
36
41
|
"repository": "",
|
|
37
|
-
"author": "",
|
|
42
|
+
"author": "Loop Now Technologies, Inc.",
|
|
38
43
|
"license": "Apache-2.0",
|
|
39
44
|
"bugs": {
|
|
40
45
|
"url": "https://github.com/loopsocial/react-native-firework-sdk/issues"
|
|
@@ -1,31 +1,38 @@
|
|
|
1
|
-
require
|
|
1
|
+
require 'json'
|
|
2
2
|
|
|
3
|
-
package = JSON.parse(File.read(File.join(__dir__,
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
4
|
|
|
5
5
|
Pod::Spec.new do |s|
|
|
6
|
-
s.name =
|
|
7
|
-
s.version = package[
|
|
8
|
-
s.summary = package[
|
|
9
|
-
s.homepage = package[
|
|
10
|
-
s.license =
|
|
11
|
-
s.authors = package[
|
|
6
|
+
s.name = 'react-native-firework-sdk'
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = package['description']
|
|
9
|
+
s.homepage = package['homepage']
|
|
10
|
+
s.license = 'Apache License, Version 2.0'
|
|
11
|
+
s.authors = package['author']
|
|
12
12
|
|
|
13
|
-
s.platforms = { :
|
|
14
|
-
s.source = { :
|
|
13
|
+
s.platforms = { ios: '12.0' }
|
|
14
|
+
s.source = { git: 'https://github.com/loopsocial/bogano.git', tag: "#{s.version}" }
|
|
15
15
|
|
|
16
16
|
s.swift_version = '5.0'
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
cp $module_header_path
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
s.
|
|
30
|
-
|
|
17
|
+
s.script_phase = { name: 'Copy module header files', script: '
|
|
18
|
+
module_header_path="${PODS_TARGET_SRCROOT}/ios/react_native_firework_sdk.h"
|
|
19
|
+
target_header_directory="${PODS_ROOT}/Headers/Public/react_native_firework_sdk/"
|
|
20
|
+
echo "module_header_path $module_header_path"
|
|
21
|
+
echo "target_header_directory $target_header_directory"
|
|
22
|
+
if [ -d $target_header_directory ]
|
|
23
|
+
then
|
|
24
|
+
cp -f $module_header_path $target_header_directory
|
|
25
|
+
fi
|
|
26
|
+
', execution_position: :before_compile }
|
|
27
|
+
|
|
28
|
+
s.source_files = 'ios/**/*.{h,m,mm,swift}'
|
|
29
|
+
s.exclude_files = [
|
|
30
|
+
'ios/Support/**/*',
|
|
31
|
+
'ios/FireworkVideoUI/**/*'
|
|
32
|
+
]
|
|
33
|
+
s.preserve_paths = "FireworkVideoUI.xcframework"
|
|
34
|
+
s.vendored_frameworks = "FireworkVideoUI.xcframework"
|
|
35
|
+
|
|
36
|
+
s.dependency 'React-Core'
|
|
37
|
+
s.dependency 'FireworkVideo', '1.9.0'
|
|
31
38
|
end
|
package/src/FireworkSDK.ts
CHANGED
|
@@ -57,7 +57,7 @@ class FireworkSDK {
|
|
|
57
57
|
private _onCustomCTAClick: CustomCTAClickCallback | undefined;
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
* The callback of video playback.
|
|
60
|
+
* The callback of video playback.
|
|
61
61
|
*/
|
|
62
62
|
public get onVideoPlayback(): VideoPlaybackCallback | undefined {
|
|
63
63
|
return this._onVideoPlayback;
|
|
@@ -69,11 +69,17 @@ class FireworkSDK {
|
|
|
69
69
|
private _onVideoPlayback?: VideoPlaybackCallback | undefined;
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* The global share base URL of the video.
|
|
73
|
+
* The {@link VideoPlayerConfiguration.shareBaseURL} in {@link VideoPlayerConfiguration} will override this.
|
|
73
74
|
*/
|
|
74
|
-
public
|
|
75
|
+
public get shareBaseURL(): string | undefined {
|
|
75
76
|
return this._shareBaseURL;
|
|
76
77
|
}
|
|
78
|
+
public set shareBaseURL(value: string | undefined) {
|
|
79
|
+
FireworkSDKModule.setShareBaseURL(value ?? '').then(() => {
|
|
80
|
+
this.updateInternalShareBaseURL(value);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
77
83
|
private _shareBaseURL: string | undefined;
|
|
78
84
|
|
|
79
85
|
/**
|
|
@@ -100,6 +106,11 @@ class FireworkSDK {
|
|
|
100
106
|
}
|
|
101
107
|
private _adBadgeConfiguration: AdBadgeConfiguration | undefined;
|
|
102
108
|
|
|
109
|
+
public get appLanguage(): string | undefined | null {
|
|
110
|
+
return this._appLanguage;
|
|
111
|
+
}
|
|
112
|
+
private _appLanguage: string | undefined | null;
|
|
113
|
+
|
|
103
114
|
/**
|
|
104
115
|
* Defaults to false.
|
|
105
116
|
* You can enable debug logs by setting this property to true.
|
|
@@ -114,7 +125,7 @@ class FireworkSDK {
|
|
|
114
125
|
/**
|
|
115
126
|
* Get video launch behavior.
|
|
116
127
|
*/
|
|
117
|
-
public
|
|
128
|
+
public get videoLaunchBehavior(): VideoLaunchBehavior | undefined {
|
|
118
129
|
return this._videoLaunchBehavior;
|
|
119
130
|
}
|
|
120
131
|
private _videoLaunchBehavior: VideoLaunchBehavior | undefined;
|
|
@@ -198,6 +209,19 @@ class FireworkSDK {
|
|
|
198
209
|
this.onVideoFeedClick(event ?? {});
|
|
199
210
|
}
|
|
200
211
|
});
|
|
212
|
+
|
|
213
|
+
if (Platform.OS === 'ios') {
|
|
214
|
+
this.eventEmitter.addListener(
|
|
215
|
+
FWEventName.NativeAppLanguageUpdated,
|
|
216
|
+
(event) => {
|
|
217
|
+
FWLoggerUtil.log(
|
|
218
|
+
`Receive NativeAppLanguageUpdated event appLanguage: ${event.appLanguage}`
|
|
219
|
+
);
|
|
220
|
+
const language = event.appLanguage;
|
|
221
|
+
this.updateInternalAppLanguage(language);
|
|
222
|
+
}
|
|
223
|
+
);
|
|
224
|
+
}
|
|
201
225
|
}
|
|
202
226
|
|
|
203
227
|
/**
|
|
@@ -208,12 +232,6 @@ class FireworkSDK {
|
|
|
208
232
|
FWLoggerUtil.log('Call FireworkSDK init method');
|
|
209
233
|
|
|
210
234
|
FireworkSDKModule.init(options).then(() => {
|
|
211
|
-
const shareBaseURLChanged = this._shareBaseURL !== options?.shareBaseURL;
|
|
212
|
-
this._shareBaseURL = options?.shareBaseURL;
|
|
213
|
-
if (shareBaseURLChanged) {
|
|
214
|
-
this.eventEmitter.emit(FWEventName.ShareBaseURLUpdated);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
235
|
const videoLaunchBehaviorUpdated =
|
|
218
236
|
this._videoLaunchBehavior !== options?.videoLaunchBehavior;
|
|
219
237
|
this._videoLaunchBehavior = options?.videoLaunchBehavior;
|
|
@@ -245,18 +263,39 @@ class FireworkSDK {
|
|
|
245
263
|
}
|
|
246
264
|
|
|
247
265
|
/**
|
|
248
|
-
* Change App level language. Only supported on
|
|
249
|
-
* @param {string} language Such as en, ar and en-US
|
|
250
|
-
*
|
|
266
|
+
* Change App level language. Only supported on iOS.
|
|
267
|
+
* @param {string | undefined | null} language Such as en, ar and en-US
|
|
268
|
+
* If language is null or undefined or empty string, SDK will use system language.
|
|
269
|
+
* @returns {Promise<boolean>} The result of changing app language.
|
|
251
270
|
*/
|
|
252
|
-
public async changeAppLanguage(language
|
|
253
|
-
if (Platform.OS === '
|
|
271
|
+
public async changeAppLanguage(language?: string | null): Promise<boolean> {
|
|
272
|
+
if (Platform.OS === 'ios') {
|
|
254
273
|
const result = await FireworkSDKModule.changeAppLanguage(language);
|
|
274
|
+
if (result) {
|
|
275
|
+
this.updateInternalAppLanguage(language);
|
|
276
|
+
}
|
|
255
277
|
return result;
|
|
256
278
|
}
|
|
257
279
|
|
|
258
280
|
return false;
|
|
259
281
|
}
|
|
282
|
+
|
|
283
|
+
private updateInternalAppLanguage(language?: string | null) {
|
|
284
|
+
const valueHasChanged = this._appLanguage !== language;
|
|
285
|
+
this._appLanguage = language;
|
|
286
|
+
if (valueHasChanged) {
|
|
287
|
+
this.eventEmitter.emit(FWEventName.AppLanguageUpdated);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
private updateInternalShareBaseURL(shareBaseURL?: string) {
|
|
292
|
+
const shareBaseURLChanged = this._shareBaseURL !== shareBaseURL;
|
|
293
|
+
console.log('updateInternalShareBaseURL shareBaseURL', shareBaseURL);
|
|
294
|
+
this._shareBaseURL = shareBaseURL;
|
|
295
|
+
if (shareBaseURLChanged) {
|
|
296
|
+
this.eventEmitter.emit(FWEventName.ShareBaseURLUpdated);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
260
299
|
}
|
|
261
300
|
|
|
262
301
|
export default FireworkSDK;
|
package/src/LiveStream.ts
CHANGED
|
@@ -16,11 +16,11 @@ class LiveStream {
|
|
|
16
16
|
private static _instance?: LiveStream;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* The callback of live stream event.
|
|
19
|
+
* The callback of live stream event.
|
|
20
20
|
*/
|
|
21
21
|
public onLiveStreamEvent?: onLiveStreamEventCallback;
|
|
22
22
|
/**
|
|
23
|
-
* The callback of live stream chat event.
|
|
23
|
+
* The callback of live stream chat event.
|
|
24
24
|
*/
|
|
25
25
|
public onLiveStreamChatEvent?: onLiveStreamChatEventCallback;
|
|
26
26
|
|
package/src/VideoShopping.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { NativeEventEmitter, Platform } from 'react-native';
|
|
2
2
|
|
|
3
|
-
import type AddToCartResult from './models/AddToCartResult';
|
|
4
3
|
import { FWEventName } from './models/FWEventName';
|
|
5
4
|
import type {
|
|
6
|
-
AddToCartEvent,
|
|
7
5
|
CustomClickLinkButtonEvent,
|
|
6
|
+
ShoppingCTAEvent,
|
|
8
7
|
UpdateProductDetailsEvent,
|
|
9
8
|
} from './models/FWEvents';
|
|
10
9
|
import type Product from './models/Product';
|
|
@@ -13,10 +12,11 @@ import ShoppingModule, {
|
|
|
13
12
|
ShoppingModuleEventEmitter,
|
|
14
13
|
} from './modules/ShoppingModule';
|
|
15
14
|
import FWLoggerUtil from './utils/FWLoggerUtil';
|
|
15
|
+
import type ShoppingCTAResult from './models/ShoppingCTAResult';
|
|
16
16
|
|
|
17
|
-
export type
|
|
18
|
-
event:
|
|
19
|
-
) => Promise<
|
|
17
|
+
export type ShoppingCTACallback = (
|
|
18
|
+
event: ShoppingCTAEvent
|
|
19
|
+
) => Promise<ShoppingCTAResult>;
|
|
20
20
|
|
|
21
21
|
export type CustomClickCartIconCallback = () => Promise<void>;
|
|
22
22
|
|
|
@@ -35,12 +35,10 @@ class VideoShopping {
|
|
|
35
35
|
private static _instance?: VideoShopping;
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* This callback is triggered when the user clicks the "Add to cart" button.
|
|
39
|
-
*
|
|
40
|
-
* The host apps can return an AddToCartResult object to tell FireworkSDK the result of adding to cart.
|
|
41
|
-
* If the host apps want to customize the processing logic of clicking "Add to cart" button, they could return null or undefined in the callback.
|
|
38
|
+
* This callback is triggered when the user clicks the "Add to cart" or "Shop now" button.
|
|
39
|
+
* The host app can return a ShoppingCTAResult object to tell SDK how to handle the result.
|
|
42
40
|
*/
|
|
43
|
-
public
|
|
41
|
+
public onShoppingCTA?: ShoppingCTACallback;
|
|
44
42
|
|
|
45
43
|
/**
|
|
46
44
|
* This callback is triggered when the user clicks the shopping cart icon.
|
|
@@ -82,8 +80,8 @@ class VideoShopping {
|
|
|
82
80
|
private _cartIconVisible: boolean = true;
|
|
83
81
|
|
|
84
82
|
/**
|
|
85
|
-
* The
|
|
86
|
-
*
|
|
83
|
+
* The configuration of product info view.
|
|
84
|
+
* Please refer to {@link ProductInfoViewConfiguration} for more details.
|
|
87
85
|
*/
|
|
88
86
|
public get productInfoViewConfiguration():
|
|
89
87
|
| ProductInfoViewConfiguration
|
|
@@ -95,9 +93,7 @@ class VideoShopping {
|
|
|
95
93
|
value: ProductInfoViewConfiguration | undefined
|
|
96
94
|
) {
|
|
97
95
|
this._productInfoViewConfiguration = value;
|
|
98
|
-
|
|
99
|
-
ShoppingModule.setProductInfoViewConfiguration(value ?? {});
|
|
100
|
-
}
|
|
96
|
+
ShoppingModule.setProductInfoViewConfiguration(value ?? {});
|
|
101
97
|
}
|
|
102
98
|
|
|
103
99
|
private _productInfoViewConfiguration?:
|
|
@@ -106,7 +102,7 @@ class VideoShopping {
|
|
|
106
102
|
|
|
107
103
|
/**
|
|
108
104
|
* This callback is triggered when the user clicks
|
|
109
|
-
* the link button next to Add to cart button.
|
|
105
|
+
* the link button next to Add to cart button.
|
|
110
106
|
*
|
|
111
107
|
* The host app can customize the click event processing logic of
|
|
112
108
|
* the link button by setting the callback.
|
|
@@ -120,9 +116,7 @@ class VideoShopping {
|
|
|
120
116
|
value: CustomClickLinkButtonCallback | undefined
|
|
121
117
|
) {
|
|
122
118
|
this._onCustomClickLinkButton = value;
|
|
123
|
-
|
|
124
|
-
ShoppingModule.setCustomClickLinkButtonEnabled(!!value);
|
|
125
|
-
}
|
|
119
|
+
ShoppingModule.setCustomClickLinkButtonEnabled(!!value);
|
|
126
120
|
}
|
|
127
121
|
private _onCustomClickLinkButton?: CustomClickLinkButtonCallback | undefined;
|
|
128
122
|
|
|
@@ -140,12 +134,15 @@ class VideoShopping {
|
|
|
140
134
|
}
|
|
141
135
|
|
|
142
136
|
private constructor() {
|
|
143
|
-
this.eventEmitter.addListener(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
137
|
+
this.eventEmitter.addListener(
|
|
138
|
+
FWEventName.ShoppingCTAButtonClick,
|
|
139
|
+
(event) => {
|
|
140
|
+
FWLoggerUtil.log(
|
|
141
|
+
`Receive ShoppingCTA event productId: ${event?.productId} unitId: ${event?.unitId} url: ${event?.url}`
|
|
142
|
+
);
|
|
143
|
+
this.handleShoppingCTAEvent(event);
|
|
144
|
+
}
|
|
145
|
+
);
|
|
149
146
|
|
|
150
147
|
this.eventEmitter.addListener(FWEventName.ClickCartIcon, () => {
|
|
151
148
|
FWLoggerUtil.log('Receive ClickCartIcon event');
|
|
@@ -161,17 +158,15 @@ class VideoShopping {
|
|
|
161
158
|
|
|
162
159
|
this.eventEmitter.addListener(FWEventName.LogMessage, () => {});
|
|
163
160
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
);
|
|
174
|
-
}
|
|
161
|
+
this.eventEmitter.addListener(
|
|
162
|
+
FWEventName.CustomLinkButtonClick,
|
|
163
|
+
(event) => {
|
|
164
|
+
FWLoggerUtil.log(
|
|
165
|
+
`Receive CustomLinkButtonClick event url: ${event?.url}`
|
|
166
|
+
);
|
|
167
|
+
this.handleCustomLinkButtonClickEvent(event);
|
|
168
|
+
}
|
|
169
|
+
);
|
|
175
170
|
}
|
|
176
171
|
|
|
177
172
|
/**
|
|
@@ -186,30 +181,22 @@ class VideoShopping {
|
|
|
186
181
|
ShoppingModule.setCartItemCount(count);
|
|
187
182
|
}
|
|
188
183
|
|
|
189
|
-
private async
|
|
184
|
+
private async handleShoppingCTAEvent(event: any) {
|
|
190
185
|
const callbackId = event.callbackId;
|
|
191
186
|
delete event.callbackId;
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
result.res,
|
|
198
|
-
result.tips,
|
|
199
|
-
callbackId
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
} else {
|
|
203
|
-
if (callbackId) {
|
|
204
|
-
if (Platform.OS === 'ios') {
|
|
205
|
-
ShoppingModule.clearCallbackId(callbackId, FWEventName.AddToCart);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
187
|
+
|
|
188
|
+
if (this.onShoppingCTA) {
|
|
189
|
+
const result = await this.onShoppingCTA(event as ShoppingCTAEvent);
|
|
190
|
+
if (callbackId) {
|
|
191
|
+
ShoppingModule.updateShoppingCTAResult(result, callbackId);
|
|
208
192
|
}
|
|
209
193
|
} else {
|
|
210
194
|
if (callbackId) {
|
|
211
195
|
if (Platform.OS === 'ios') {
|
|
212
|
-
ShoppingModule.clearCallbackId(
|
|
196
|
+
ShoppingModule.clearCallbackId(
|
|
197
|
+
callbackId,
|
|
198
|
+
FWEventName.ShoppingCTAButtonClick
|
|
199
|
+
);
|
|
213
200
|
}
|
|
214
201
|
}
|
|
215
202
|
}
|