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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//
|
|
2
|
+
// FireworkVideoUITests.swift
|
|
3
|
+
// FireworkVideoUITests
|
|
4
|
+
//
|
|
5
|
+
// Created by linjie jiang on 4/25/23.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import XCTest
|
|
9
|
+
@testable import FireworkVideoUI
|
|
10
|
+
|
|
11
|
+
final class FireworkVideoUITests: XCTestCase {
|
|
12
|
+
|
|
13
|
+
override func setUpWithError() throws {
|
|
14
|
+
// Put setup code here. This method is called before the invocation of each test method in the class.
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
override func tearDownWithError() throws {
|
|
18
|
+
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
func testExample() throws {
|
|
22
|
+
// This is an example of a functional test case.
|
|
23
|
+
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
|
24
|
+
// Any test you write for XCTest can be annotated as throws and async.
|
|
25
|
+
// Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
|
|
26
|
+
// Mark your test async to allow awaiting for asynchronous code to complete.
|
|
27
|
+
// Check the results with assertions afterwards.
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
func testPerformanceExample() throws {
|
|
31
|
+
// This is an example of a performance test case.
|
|
32
|
+
self.measure {
|
|
33
|
+
// Put the code you want to measure the time of here.
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Uncomment the next line to define a global platform for your project
|
|
2
|
+
platform :ios, '12.1'
|
|
3
|
+
|
|
4
|
+
target 'FireworkVideoUI' do
|
|
5
|
+
# Comment the next line if you don't want to use dynamic frameworks
|
|
6
|
+
use_frameworks!
|
|
7
|
+
|
|
8
|
+
# Pods for FireworkVideoUI
|
|
9
|
+
pod 'FireworkVideo', '1.9.0'
|
|
10
|
+
|
|
11
|
+
target 'FireworkVideoUITests' do
|
|
12
|
+
# Pods for testing
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
PODS:
|
|
2
|
+
- FireworkVideo (1.9.0)
|
|
3
|
+
|
|
4
|
+
DEPENDENCIES:
|
|
5
|
+
- FireworkVideo (= 1.9.0)
|
|
6
|
+
|
|
7
|
+
SPEC REPOS:
|
|
8
|
+
trunk:
|
|
9
|
+
- FireworkVideo
|
|
10
|
+
|
|
11
|
+
SPEC CHECKSUMS:
|
|
12
|
+
FireworkVideo: 77edd3eb890c09a0656c8599bee874a38aefec53
|
|
13
|
+
|
|
14
|
+
PODFILE CHECKSUM: fc28c17eb5d44ab66c794e84553cdc6abe3b5426
|
|
15
|
+
|
|
16
|
+
COCOAPODS: 1.12.1
|
|
@@ -16,16 +16,21 @@ enum FWEventName: String, CaseIterable {
|
|
|
16
16
|
case shareBaseURLUpdated = "fw:share-base-url-updated" // emitted in JS side
|
|
17
17
|
case videoLaunchBehaviorUpdated = "fw:video-launch-behavior-updated" // emitted in JS side
|
|
18
18
|
case adBadgeConfigurationUpdated = "fw:ad-badge-configuration-updated" // emitted in JS side
|
|
19
|
+
case appLanguageUpdated = "fw:app-language-updated" // emitted in JS side
|
|
20
|
+
case nativeAppLanguageUpdated = "fw:native-app-language-updated" // emitted in native side
|
|
19
21
|
case logMessage = "fw:log-message"
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
enum VideoPlaybackSubEventName: String {
|
|
23
25
|
case impression = "fw:video:impression"
|
|
24
26
|
case start = "fw:video:start"
|
|
27
|
+
case pause = "fw:video:pause"
|
|
28
|
+
case resume = "fw:video:resume"
|
|
25
29
|
case firstQuartile = "fw:video:first-quartile"
|
|
26
30
|
case midpoint = "fw:video:midpoint"
|
|
27
31
|
case thirdQuartile = "fw:video:third-quartile"
|
|
28
32
|
case complete = "fw:video:complete"
|
|
33
|
+
case adStart = "fw:video:ad-start"
|
|
29
34
|
case adEnd = "fw:video:ad-end"
|
|
30
35
|
case clickCTA = "fw:video:click-cta"
|
|
31
36
|
case clickShare = "fw:video:click-share"
|
|
@@ -35,9 +40,10 @@ enum VideoPlaybackSubEventName: String {
|
|
|
35
40
|
enum ShoppingEventName: String, CaseIterable {
|
|
36
41
|
case updateProductDetails = "fw:shopping:update-product-details"
|
|
37
42
|
case willDisplayProduct = "fw:shopping:will-display-product"
|
|
38
|
-
case
|
|
43
|
+
case ctaButtonClick = "fw:shopping:cta-button-click"
|
|
39
44
|
case clickCartIcon = "fw:shopping:click-cart-icon"
|
|
40
45
|
case logMessage = "fw:log-message"
|
|
46
|
+
case customLinkButtonClick = "fw:shopping:custom-link-button-click"
|
|
41
47
|
}
|
|
42
48
|
|
|
43
49
|
/// Live stream event
|
|
@@ -34,7 +34,11 @@ extension VideoPlaybackDetails {
|
|
|
34
34
|
"width": playerSize.width,
|
|
35
35
|
"height": playerSize.height
|
|
36
36
|
],
|
|
37
|
-
"hasCTA": hasCTA
|
|
37
|
+
"hasCTA": hasCTA,
|
|
38
|
+
"progress": progress,
|
|
39
|
+
"ctaActionType": ctaActionType ?? "",
|
|
40
|
+
"ctaActionURL": ctaActionURL ?? "",
|
|
41
|
+
"feedId": feedId ?? "",
|
|
38
42
|
]
|
|
39
43
|
}
|
|
40
44
|
}
|
|
@@ -63,4 +63,25 @@ extension RCTConvert {
|
|
|
63
63
|
|
|
64
64
|
return result
|
|
65
65
|
}
|
|
66
|
+
|
|
67
|
+
static func buildShoppingCTAResult(_ result: [String: Any]?)
|
|
68
|
+
-> ShoppingCTAResult? {
|
|
69
|
+
guard let rResult = result else {
|
|
70
|
+
return nil
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
let jsonData = try? JSONSerialization.data(withJSONObject: rResult, options: .prettyPrinted)
|
|
74
|
+
guard let rJsonData = jsonData else {
|
|
75
|
+
return nil
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
var ctaResult: ShoppingCTAResult?
|
|
79
|
+
do {
|
|
80
|
+
ctaResult = try JSONDecoder().decode(ShoppingCTAResult.self, from: rJsonData)
|
|
81
|
+
} catch let error {
|
|
82
|
+
print(error.localizedDescription)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return ctaResult
|
|
86
|
+
}
|
|
66
87
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
9
|
+
import FireworkVideo
|
|
9
10
|
|
|
10
11
|
extension VideFeedSourceType {
|
|
11
12
|
static var sourceTypeMapper: [String: VideFeedSourceType] {
|
|
@@ -14,7 +15,8 @@ extension VideFeedSourceType {
|
|
|
14
15
|
"channel": .channel,
|
|
15
16
|
"playlist": .playlist,
|
|
16
17
|
"playlistGroup": .playlistGroup,
|
|
17
|
-
"dynamicContent": .dynamicContent
|
|
18
|
+
"dynamicContent": .dynamicContent,
|
|
19
|
+
"hashtagPlaylist": .hashtagPlaylist
|
|
18
20
|
]
|
|
19
21
|
}
|
|
20
22
|
}
|
|
@@ -87,4 +89,30 @@ extension RCTConvert {
|
|
|
87
89
|
|
|
88
90
|
return try? JSONDecoder().decode(AdConfiguration.self, from: rJsonData)
|
|
89
91
|
}
|
|
92
|
+
|
|
93
|
+
@nonobjc
|
|
94
|
+
public static func getFireworkVideoAdConfiguration(
|
|
95
|
+
_ adConfiguration: AdConfiguration?
|
|
96
|
+
) -> FireworkVideo.AdConfiguration? {
|
|
97
|
+
guard let feedAdConfiguration = adConfiguration else {
|
|
98
|
+
return nil
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
var resultAdConfiguration = FireworkVideo.AdConfiguration()
|
|
102
|
+
if let requiresAds = feedAdConfiguration.requiresAds {
|
|
103
|
+
resultAdConfiguration.requiresAds = requiresAds
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if let adsFetchTimeout = feedAdConfiguration.adsFetchTimeout {
|
|
107
|
+
resultAdConfiguration.adsFetchTimeout = adsFetchTimeout
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if let vastAttributes = feedAdConfiguration.vastAttributes {
|
|
111
|
+
resultAdConfiguration.vastAttributes = vastAttributes.map({ attribute in
|
|
112
|
+
return URLQueryItem(name: attribute.name ?? "", value: attribute.value ?? "")
|
|
113
|
+
})
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return resultAdConfiguration
|
|
117
|
+
}
|
|
90
118
|
}
|
|
@@ -5,10 +5,13 @@
|
|
|
5
5
|
// Created by Big Bear Xiong on 2022/4/21.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
|
-
// swiftlint:disable file_length
|
|
9
|
-
|
|
10
8
|
import FireworkVideo
|
|
11
9
|
|
|
10
|
+
private let FWExitButtonImageNames: [String] = [
|
|
11
|
+
"closeX",
|
|
12
|
+
"down-arrow-light"
|
|
13
|
+
]
|
|
14
|
+
|
|
12
15
|
private struct PlayerInfo {
|
|
13
16
|
enum PlayerMode: Int {
|
|
14
17
|
case fullscreen, floating
|
|
@@ -226,20 +229,10 @@ class FWNavigatorModule: RCTEventEmitter, FWNavigator {
|
|
|
226
229
|
func startFloatingPlayer(
|
|
227
230
|
_ resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock
|
|
228
231
|
) {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
if playerInfo.mode == .fullscreen {
|
|
235
|
-
do {
|
|
236
|
-
try playerInfo.playerVC.startPictureInPicture()
|
|
237
|
-
resolver(true)
|
|
238
|
-
} catch {
|
|
239
|
-
resolver(false)
|
|
240
|
-
}
|
|
241
|
-
} else {
|
|
242
|
-
// current player is already in floating mode.
|
|
232
|
+
do {
|
|
233
|
+
try PictureInPictureController.start()
|
|
234
|
+
resolver(true)
|
|
235
|
+
} catch {
|
|
243
236
|
resolver(false)
|
|
244
237
|
}
|
|
245
238
|
}
|
|
@@ -298,78 +291,6 @@ extension FWNavigatorModule {
|
|
|
298
291
|
return nil
|
|
299
292
|
}
|
|
300
293
|
|
|
301
|
-
private static func getWindowList() -> [UIWindow] {
|
|
302
|
-
var windowList: [UIWindow] = []
|
|
303
|
-
if #available(iOS 13.0, *) {
|
|
304
|
-
for scene in UIApplication.shared.connectedScenes {
|
|
305
|
-
if let currentSene = scene as? UIWindowScene {
|
|
306
|
-
for window in currentSene.windows {
|
|
307
|
-
windowList.append(window)
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
} else {
|
|
312
|
-
for window in UIApplication.shared.windows {
|
|
313
|
-
windowList.append(window)
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
return windowList
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
private static func getFurthestAncestorController(_ controller: UIViewController) -> UIViewController {
|
|
321
|
-
guard let parentVC = controller.parent else {
|
|
322
|
-
return controller
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
return getFurthestAncestorController(parentVC)
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
private static func getPlayerViewController(_ viewController: UIViewController) -> PlayerViewController? {
|
|
329
|
-
if let playerVC = viewController as? PlayerViewController {
|
|
330
|
-
return playerVC
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
for childVC in viewController.children {
|
|
334
|
-
if let playerVC = getPlayerViewController(childVC) {
|
|
335
|
-
return playerVC
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
return nil
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
private static func getPlayerInfo() -> PlayerInfo? {
|
|
343
|
-
let windowList: [UIWindow] = getWindowList()
|
|
344
|
-
|
|
345
|
-
if let floatingPlayerWindow = windowList.first(where: { window in
|
|
346
|
-
NSStringFromClass(type(of: window)) == "FireworkVideo.FloatingPlayerController"
|
|
347
|
-
}) {
|
|
348
|
-
if let rootVC = floatingPlayerWindow.rootViewController,
|
|
349
|
-
let playerVC = getPlayerViewController(rootVC) {
|
|
350
|
-
return PlayerInfo(playerVC: playerVC, mode: .floating)
|
|
351
|
-
}
|
|
352
|
-
return nil
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
if let keyWindow = windowList.first(where: { window in
|
|
356
|
-
return window.isKeyWindow
|
|
357
|
-
}) {
|
|
358
|
-
if let rootVC = keyWindow.rootViewController,
|
|
359
|
-
let presentedVC = rootVC.presentedViewController {
|
|
360
|
-
let furthestAncestorController = getFurthestAncestorController(presentedVC)
|
|
361
|
-
|
|
362
|
-
if let playerVC = getPlayerViewController(furthestAncestorController) {
|
|
363
|
-
return PlayerInfo(playerVC: playerVC, mode: .fullscreen)
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
return nil
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
return nil
|
|
371
|
-
}
|
|
372
|
-
|
|
373
294
|
private static func isIOSSDKViewController(_ controller: UIViewController?) -> Bool {
|
|
374
295
|
guard let controller = controller else {
|
|
375
296
|
return false
|
|
@@ -386,19 +307,10 @@ extension FWNavigatorModule {
|
|
|
386
307
|
|
|
387
308
|
extension FWNavigatorModule {
|
|
388
309
|
static func stopFloatingPlayer() -> Bool {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
if playerInfo.mode == .floating {
|
|
394
|
-
do {
|
|
395
|
-
try playerInfo.playerVC.stopPictureInPicture()
|
|
396
|
-
return true
|
|
397
|
-
} catch {
|
|
398
|
-
return false
|
|
399
|
-
}
|
|
400
|
-
} else {
|
|
401
|
-
// current player is in fullscreen player
|
|
310
|
+
do {
|
|
311
|
+
try PictureInPictureController.stop()
|
|
312
|
+
return true
|
|
313
|
+
} catch {
|
|
402
314
|
return false
|
|
403
315
|
}
|
|
404
316
|
}
|
|
@@ -9,14 +9,6 @@ import FireworkVideo
|
|
|
9
9
|
import Foundation
|
|
10
10
|
|
|
11
11
|
extension FireworkSDKModule: FireworkVideoPlaybackDelegate {
|
|
12
|
-
func fireworkVideoDidPause(_ videoPlayback: VideoPlaybackDetails) {
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
func fireworkVideoDidResume(_ videoPlayback: VideoPlaybackDetails) {
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
12
|
func fireworkVideoDidRecordImpression(_ videoPlayback: VideoPlaybackDetails) {
|
|
21
13
|
guard enableVideoPlayBackEvent else { return }
|
|
22
14
|
sendEvent(
|
|
@@ -37,6 +29,26 @@ extension FireworkSDKModule: FireworkVideoPlaybackDelegate {
|
|
|
37
29
|
])
|
|
38
30
|
}
|
|
39
31
|
|
|
32
|
+
func fireworkVideoDidPause(_ videoPlayback: VideoPlaybackDetails) {
|
|
33
|
+
guard enableVideoPlayBackEvent else { return }
|
|
34
|
+
sendEvent(
|
|
35
|
+
withName: FWEventName.videoPlayback.rawValue,
|
|
36
|
+
body: [
|
|
37
|
+
"eventName": VideoPlaybackSubEventName.pause.rawValue,
|
|
38
|
+
"info": videoPlayback.jsObject
|
|
39
|
+
])
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
func fireworkVideoDidResume(_ videoPlayback: VideoPlaybackDetails) {
|
|
43
|
+
guard enableVideoPlayBackEvent else { return }
|
|
44
|
+
sendEvent(
|
|
45
|
+
withName: FWEventName.videoPlayback.rawValue,
|
|
46
|
+
body: [
|
|
47
|
+
"eventName": VideoPlaybackSubEventName.resume.rawValue,
|
|
48
|
+
"info": videoPlayback.jsObject
|
|
49
|
+
])
|
|
50
|
+
}
|
|
51
|
+
|
|
40
52
|
func fireworkVideoReachedFirstQuartile(_ videoPlayback: VideoPlaybackDetails) {
|
|
41
53
|
guard enableVideoPlayBackEvent else { return }
|
|
42
54
|
sendEvent(
|
|
@@ -77,36 +89,42 @@ extension FireworkSDKModule: FireworkVideoPlaybackDelegate {
|
|
|
77
89
|
])
|
|
78
90
|
}
|
|
79
91
|
|
|
80
|
-
func
|
|
92
|
+
func fireworkVideoDidStartPlayingAd(_ videoPlayback: VideoPlaybackDetails) {
|
|
81
93
|
guard enableVideoPlayBackEvent else { return }
|
|
82
94
|
sendEvent(
|
|
83
95
|
withName: FWEventName.videoPlayback.rawValue,
|
|
84
96
|
body: [
|
|
85
|
-
"eventName": VideoPlaybackSubEventName.
|
|
97
|
+
"eventName": VideoPlaybackSubEventName.adStart.rawValue,
|
|
86
98
|
"info": videoPlayback.jsObject
|
|
87
99
|
])
|
|
88
100
|
}
|
|
89
101
|
|
|
90
|
-
func
|
|
102
|
+
func fireworkVideoDidFinishPlayingAd(_ videoPlayback: VideoPlaybackDetails) {
|
|
91
103
|
guard enableVideoPlayBackEvent else { return }
|
|
92
104
|
sendEvent(
|
|
93
105
|
withName: FWEventName.videoPlayback.rawValue,
|
|
94
106
|
body: [
|
|
95
|
-
"eventName": VideoPlaybackSubEventName.
|
|
107
|
+
"eventName": VideoPlaybackSubEventName.adEnd.rawValue,
|
|
96
108
|
"info": videoPlayback.jsObject
|
|
97
109
|
])
|
|
98
110
|
}
|
|
99
111
|
|
|
100
|
-
func
|
|
101
|
-
|
|
112
|
+
func fireworkVideoDidTapCTAButton(_ videoPlayback: VideoPlaybackDetails) {
|
|
113
|
+
guard enableVideoPlayBackEvent else { return }
|
|
114
|
+
sendEvent(
|
|
115
|
+
withName: FWEventName.videoPlayback.rawValue,
|
|
116
|
+
body: [
|
|
117
|
+
"eventName": VideoPlaybackSubEventName.clickCTA.rawValue,
|
|
118
|
+
"info": videoPlayback.jsObject
|
|
119
|
+
])
|
|
102
120
|
}
|
|
103
121
|
|
|
104
|
-
func
|
|
122
|
+
func fireworkVideoDidTapShareButton(_ videoPlayback: VideoPlaybackDetails) {
|
|
105
123
|
guard enableVideoPlayBackEvent else { return }
|
|
106
124
|
sendEvent(
|
|
107
125
|
withName: FWEventName.videoPlayback.rawValue,
|
|
108
126
|
body: [
|
|
109
|
-
"eventName": VideoPlaybackSubEventName.
|
|
127
|
+
"eventName": VideoPlaybackSubEventName.clickShare.rawValue,
|
|
110
128
|
"info": videoPlayback.jsObject
|
|
111
129
|
])
|
|
112
130
|
}
|
|
@@ -19,5 +19,6 @@ RCT_EXTERN_METHOD(setVideoPlaybackEventEnabled:(BOOL)enabled)
|
|
|
19
19
|
RCT_EXTERN_METHOD(setAdBadgeConfiguration:(NSDictionary *)config resolver: (RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
20
20
|
RCT_EXTERN_METHOD(setAppComponentName:(NSString *)name resolver: (RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
21
21
|
RCT_EXTERN_METHOD(trackPurchase:(NSDictionary *)parameters)
|
|
22
|
+
RCT_EXTERN_METHOD(changeAppLanguage:(NSString * __nullable)language resolver: (RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
22
23
|
|
|
23
24
|
@end
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
// The FireworkSDKModule Wrap native FireworkVideoSDK class,then expose to JavaScript in Objective-C
|
|
8
8
|
|
|
9
9
|
import FireworkVideo
|
|
10
|
+
#if canImport(FireworkVideoUI)
|
|
11
|
+
import FireworkVideoUI
|
|
12
|
+
#endif
|
|
10
13
|
|
|
11
14
|
var gShareBaseURL: String?
|
|
12
15
|
var gAdBadgeConfiguration: AdBadgeConfiguration?
|
|
@@ -23,6 +26,14 @@ class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
|
|
|
23
26
|
/// Decide whether to send video playback event to RN.
|
|
24
27
|
var enableVideoPlayBackEvent: Bool = false
|
|
25
28
|
|
|
29
|
+
override init() {
|
|
30
|
+
super.init()
|
|
31
|
+
_ = AppLanguageManager.shared
|
|
32
|
+
NotificationCenter.default.addObserver(
|
|
33
|
+
self, selector: #selector(FireworkSDKModule.onAppLanguageChanged),
|
|
34
|
+
name: AppLanguageManager.NotificationName.AppLanguageChanged, object: nil)
|
|
35
|
+
}
|
|
36
|
+
|
|
26
37
|
override func supportedEvents() -> [String]! {
|
|
27
38
|
FWEventName.allCases.map { $0.rawValue }
|
|
28
39
|
}
|
|
@@ -44,6 +55,18 @@ class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
|
|
|
44
55
|
#if DEBUG
|
|
45
56
|
let formatter = DateFormatter()
|
|
46
57
|
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
|
|
58
|
+
let iOSSDKBundle = Bundle(for: FireworkVideoSDK.self)
|
|
59
|
+
|
|
60
|
+
let messageForLocalizations = """
|
|
61
|
+
[iOS] localizations information \(formatter.string(from: Date()))
|
|
62
|
+
AppleLanguages: \((UserDefaults.standard.object(forKey: "AppleLanguages") as? [String]) ?? [])
|
|
63
|
+
Bundle.main.localizations \(Bundle.main.localizations)
|
|
64
|
+
Bundle.main.preferredLocalizations \(Bundle.main.preferredLocalizations)
|
|
65
|
+
iOSSDKBundle.localizations \(iOSSDKBundle.localizations)
|
|
66
|
+
iOSSDKBundle.preferredLocalizations \(iOSSDKBundle.preferredLocalizations)
|
|
67
|
+
"""
|
|
68
|
+
print("[react-native-firework-sdk] [swift] \(messageForLocalizations)")
|
|
69
|
+
sendEvent(withName: FWEventName.logMessage.rawValue, body: ["message": messageForLocalizations])
|
|
47
70
|
|
|
48
71
|
let message = "[iOS] Call initializeSDK \(formatter.string(from: Date()))"
|
|
49
72
|
print("[react-native-firework-sdk] [swift] \(message)")
|
|
@@ -52,13 +75,11 @@ class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
|
|
|
52
75
|
#endif
|
|
53
76
|
let sdkInitOptions = RCTConvert.sdkInitOptions(options)
|
|
54
77
|
gVideoLaunchBehavior = sdkInitOptions?.videoLaunchBehavior
|
|
55
|
-
gShareBaseURL = sdkInitOptions?.shareBaseURL
|
|
56
78
|
|
|
57
79
|
FireworkVideoSDK.initializeSDK(delegate: self, userID: sdkInitOptions?.userId)
|
|
58
80
|
FireworkVideoSDK.ctaDelegate = self
|
|
59
81
|
FireworkVideoSDK.eventTracking.videoPlaybackDelegate = self
|
|
60
82
|
FireworkVideoSDK.eventTracking.feedDelegate = self
|
|
61
|
-
|
|
62
83
|
resolver([:])
|
|
63
84
|
}
|
|
64
85
|
|
|
@@ -83,6 +104,8 @@ class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
|
|
|
83
104
|
return
|
|
84
105
|
}
|
|
85
106
|
|
|
107
|
+
_ = AppLanguageManager.shared
|
|
108
|
+
|
|
86
109
|
VideoFeedViewController.openVideoPlayer(with: urlString, feedContentConfig, presentedVC) { _ in
|
|
87
110
|
|
|
88
111
|
}
|
|
@@ -157,6 +180,21 @@ class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
|
|
|
157
180
|
)
|
|
158
181
|
}
|
|
159
182
|
|
|
183
|
+
@objc(changeAppLanguage:resolver:rejecter:)
|
|
184
|
+
func changeAppLanguage(
|
|
185
|
+
_ language: String?, resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock
|
|
186
|
+
) {
|
|
187
|
+
#if DEBUG
|
|
188
|
+
let formatter = DateFormatter()
|
|
189
|
+
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
|
|
190
|
+
let message = "[iOS] Call changeAppLanguage: \(language ?? "") \(formatter.string(from: Date()))"
|
|
191
|
+
sendEvent(withName: FWEventName.logMessage.rawValue, body: ["message": message])
|
|
192
|
+
#endif
|
|
193
|
+
|
|
194
|
+
let result = AppLanguageManager.shared.changeAppLanguage(language)
|
|
195
|
+
resolver(result)
|
|
196
|
+
}
|
|
197
|
+
|
|
160
198
|
// MARK: - FireworkVideoSDKDelegate
|
|
161
199
|
func fireworkVideoDidLoadSuccessfully() {
|
|
162
200
|
#if DEBUG
|
|
@@ -198,6 +236,14 @@ class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
|
|
|
198
236
|
]
|
|
199
237
|
])
|
|
200
238
|
}
|
|
239
|
+
|
|
240
|
+
@objc func onAppLanguageChanged() {
|
|
241
|
+
sendEvent(
|
|
242
|
+
withName: FWEventName.nativeAppLanguageUpdated.rawValue,
|
|
243
|
+
body: [
|
|
244
|
+
"appLanguage": AppLanguageManager.shared.appLanguage ?? ""
|
|
245
|
+
])
|
|
246
|
+
}
|
|
201
247
|
}
|
|
202
248
|
|
|
203
249
|
extension FireworkSDKModule {
|
|
@@ -27,6 +27,7 @@ class LiveStreamModule: RCTEventEmitter, FireworkLiveStreamEventDelegate {
|
|
|
27
27
|
func initialize() {
|
|
28
28
|
FireworkVideoSDK.eventTracking.liveStreamEventDelegate = self
|
|
29
29
|
}
|
|
30
|
+
|
|
30
31
|
func fireworkLiveStreamUserDidJoin(_ liveStream: LiveStreamEventDetails) {
|
|
31
32
|
sendEvent(
|
|
32
33
|
withName: LiveStreamEventName.livestream.rawValue,
|
|
@@ -8,16 +8,21 @@
|
|
|
8
8
|
import Foundation
|
|
9
9
|
|
|
10
10
|
struct ProductInfoViewConfiguration: Codable {
|
|
11
|
-
var
|
|
11
|
+
var ctaButton: CTAButtonConfiguration?
|
|
12
12
|
var linkButton: LinkButtonConfiguration?
|
|
13
13
|
|
|
14
|
-
struct
|
|
14
|
+
struct CTAButtonConfiguration: Codable {
|
|
15
|
+
var text: CTAButtonText?
|
|
15
16
|
var backgroundColor: String?
|
|
16
17
|
var textColor: String?
|
|
17
18
|
var fontSize: Double?
|
|
18
19
|
var iOSFontInfo: FontInfo?
|
|
19
20
|
}
|
|
20
21
|
|
|
22
|
+
enum CTAButtonText: String, Codable {
|
|
23
|
+
case addToCart, shopNow
|
|
24
|
+
}
|
|
25
|
+
|
|
21
26
|
struct LinkButtonConfiguration: Codable {
|
|
22
27
|
var isHidden: Bool?
|
|
23
28
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ShoppingCTAResult.swift
|
|
3
|
+
//
|
|
4
|
+
// Created by linjie jiang on 2023/3/20.
|
|
5
|
+
//
|
|
6
|
+
|
|
7
|
+
import Foundation
|
|
8
|
+
|
|
9
|
+
struct ShoppingCTAResult: Codable {
|
|
10
|
+
var res: ShoppingCTAResultRes?
|
|
11
|
+
var tips: String?
|
|
12
|
+
|
|
13
|
+
enum ShoppingCTAResultRes: String, Codable {
|
|
14
|
+
case success, fail
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -13,10 +13,11 @@ _RCT_EXTERN_REMAP_METHOD(init, initialize, NO)
|
|
|
13
13
|
RCT_EXTERN_METHOD(setCartIconVisible:(BOOL)visible)
|
|
14
14
|
RCT_EXTERN_METHOD(setCartItemCount:(int)itemCounts)
|
|
15
15
|
RCT_EXTERN_METHOD(updateVideoProducts:(NSArray *)products cbId:(nonnull NSNumber *)cbId)
|
|
16
|
-
RCT_EXTERN_METHOD(updateAddToCartStatus:(NSString *)res tips:(nullable NSString *)tips cbId:(nonnull NSNumber *)cbId)
|
|
17
16
|
RCT_EXTERN_METHOD(jumpToCartPage:(nonnull NSNumber *)cbId props:(NSDictionary *)props)
|
|
18
17
|
RCT_EXTERN_METHOD(setCustomClickCartIconEnabled:(BOOL)enabled resolver: (RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
19
18
|
RCT_EXTERN_METHOD(setProductInfoViewConfiguration:(NSDictionary *)config)
|
|
20
19
|
RCT_EXTERN_METHOD(clearCallbackId:(nonnull NSNumber *)cbId eventName:(nonnull NSString *)name)
|
|
20
|
+
RCT_EXTERN_METHOD(setCustomClickLinkButtonEnabled:(BOOL)enabled resolver: (RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
21
|
+
RCT_EXTERN_METHOD(updateShoppingCTAResult:(NSDictionary *)result cbId:(nonnull NSNumber *)cbId)
|
|
21
22
|
|
|
22
23
|
@end
|