react-native-firework-sdk 1.2.0-beta.8 → 1.2.0-beta.9
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/build.gradle +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +2 -2
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModel.kt +2 -1
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWVideoPlayerUtils.kt +12 -2
- package/ios/FireworkSdk.xcodeproj/project.pbxproj +4 -0
- package/ios/Modules/FWNavigatorModule/FWNavigatorContainerViewController.swift +11 -3
- package/ios/Modules/FWNavigatorModule/FWNavigatorModule.m +2 -2
- package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +4 -11
- package/ios/Modules/FWNavigatorModule/FWNavigatorProtocol.swift +2 -2
- package/ios/Modules/FireworkSDKModule/FWCustomCTALinkContentContainerViewController.swift +31 -0
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+CTA.swift +6 -14
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +1 -2
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +4 -12
- package/lib/commonjs/FWNavigator.js +13 -7
- package/lib/commonjs/FWNavigator.js.map +1 -1
- package/lib/commonjs/FireworkSDK.js +10 -22
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/components/CustomCTALinkContentContainer.js +43 -0
- package/lib/commonjs/components/CustomCTALinkContentContainer.js.map +1 -0
- package/lib/commonjs/components/NavigationContainer.js +40 -0
- package/lib/commonjs/components/NavigationContainer.js.map +1 -0
- package/lib/commonjs/components/VideoFeed.js +3 -1
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js +8 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modules/FWNavigatorModule.js.map +1 -1
- package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
- package/lib/module/FWNavigator.js +14 -8
- package/lib/module/FWNavigator.js.map +1 -1
- package/lib/module/FireworkSDK.js +9 -21
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/components/CustomCTALinkContentContainer.js +26 -0
- package/lib/module/components/CustomCTALinkContentContainer.js.map +1 -0
- package/lib/module/components/NavigationContainer.js +23 -0
- package/lib/module/components/NavigationContainer.js.map +1 -0
- package/lib/module/components/VideoFeed.js +3 -1
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/modules/FWNavigatorModule.js.map +1 -1
- package/lib/module/modules/FireworkSDKModule.js.map +1 -1
- package/lib/typescript/FWNavigator.d.ts +7 -8
- package/lib/typescript/FireworkSDK.d.ts +6 -11
- package/lib/typescript/components/CustomCTALinkContentContainer.d.ts +6 -0
- package/lib/typescript/components/NavigationContainer.d.ts +6 -0
- package/lib/typescript/models/VideoFeedConfiguration.d.ts +4 -0
- package/lib/typescript/modules/FWNavigatorModule.d.ts +1 -3
- package/lib/typescript/modules/FireworkSDKModule.d.ts +1 -2
- package/package.json +1 -1
- package/src/FWNavigator.tsx +11 -12
- package/src/FireworkSDK.ts +18 -22
- package/src/components/CustomCTALinkContentContainer.tsx +28 -0
- package/src/components/NavigationContainer.tsx +24 -0
- package/src/components/VideoFeed.tsx +2 -0
- package/src/index.tsx +10 -0
- package/src/models/VideoFeedConfiguration.ts +4 -0
- package/src/modules/FWNavigatorModule.ts +1 -1
- package/src/modules/FireworkSDKModule.ts +1 -2
package/android/build.gradle
CHANGED
|
@@ -168,7 +168,7 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
|
|
|
168
168
|
dependencies {
|
|
169
169
|
|
|
170
170
|
// optional 1: firework sdk release verison
|
|
171
|
-
def firework_sdk_version = 'v5.12.
|
|
171
|
+
def firework_sdk_version = 'v5.12.2'
|
|
172
172
|
implementation "com.github.loopsocial:firework_sdk:$firework_sdk_version"
|
|
173
173
|
|
|
174
174
|
// optional 2: firework sdk local version,
|
|
@@ -155,7 +155,7 @@ class FWVideoFeed(
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
// set Feed Configuration
|
|
158
|
-
FWVideoPlayerUtils.setVideoFeedConfig(videoFeedView, videoFeedConfiguration)
|
|
158
|
+
FWVideoPlayerUtils.setVideoFeedConfig(context, videoFeedView, videoFeedConfiguration)
|
|
159
159
|
// set Player Configuration
|
|
160
160
|
FWVideoPlayerUtils.setVideoPlayerConfig(videoPlayerConfiguration)
|
|
161
161
|
}
|
|
@@ -188,7 +188,7 @@ class FWVideoFeed(
|
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
// set Feed Configuration
|
|
191
|
-
FWVideoPlayerUtils.setPlaylistGroupFeedConfig(playlistGroupFeedView, videoFeedConfiguration)
|
|
191
|
+
FWVideoPlayerUtils.setPlaylistGroupFeedConfig(context, playlistGroupFeedView, videoFeedConfiguration)
|
|
192
192
|
// set Player Configuration
|
|
193
193
|
FWVideoPlayerUtils.setVideoPlayerConfig(videoPlayerConfiguration)
|
|
194
194
|
}
|
|
@@ -10,7 +10,8 @@ data class FWVideoFeedConfigModel(
|
|
|
10
10
|
var title: FWTitleModel? = null,
|
|
11
11
|
var titlePosition: String? = null,
|
|
12
12
|
var playIcon: FWPlayIconModel? = null,
|
|
13
|
-
var showAdBadge: Boolean? = null
|
|
13
|
+
var showAdBadge: Boolean? = null,
|
|
14
|
+
var customLayoutName: String? = null
|
|
14
15
|
) : Parcelable {
|
|
15
16
|
|
|
16
17
|
@Parcelize
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package com.fireworksdk.bridge.utils
|
|
2
2
|
|
|
3
|
+
import android.content.Context
|
|
3
4
|
import android.graphics.Color
|
|
4
5
|
import com.loopnow.fireworklibrary.VideoPlayerProperties
|
|
5
6
|
import com.fireworksdk.bridge.constants.FWVideoPlayerConstant
|
|
@@ -45,7 +46,11 @@ object FWVideoPlayerUtils {
|
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
fun setPlaylistGroupFeedConfig(feedView: PlaylistGroupFeedView?, config: FWVideoFeedConfigModel?) {
|
|
49
|
+
fun setPlaylistGroupFeedConfig(context: Context, feedView: PlaylistGroupFeedView?, config: FWVideoFeedConfigModel?) {
|
|
50
|
+
config?.customLayoutName?.let {
|
|
51
|
+
val layout = context.resources.getIdentifier(it, "layout", context.packageName)
|
|
52
|
+
feedView?.setCustomLayout(layout)
|
|
53
|
+
}
|
|
49
54
|
val backgroundColor = config?.backgroundColor
|
|
50
55
|
if (!backgroundColor.isNullOrBlank()) {
|
|
51
56
|
feedView?.setBackgroundColor(Color.parseColor(backgroundColor))
|
|
@@ -63,7 +68,12 @@ object FWVideoPlayerUtils {
|
|
|
63
68
|
VideoFeedProperties.displayAdLabel = config?.showAdBadge == true
|
|
64
69
|
}
|
|
65
70
|
|
|
66
|
-
fun setVideoFeedConfig(feedView: VideoFeedView?, config: FWVideoFeedConfigModel?) {
|
|
71
|
+
fun setVideoFeedConfig(context: Context, feedView: VideoFeedView?, config: FWVideoFeedConfigModel?) {
|
|
72
|
+
config?.customLayoutName?.let {
|
|
73
|
+
val layout = context.resources.getIdentifier(it, "layout", context.packageName)
|
|
74
|
+
feedView?.setCustomLayout(layout)
|
|
75
|
+
}
|
|
76
|
+
|
|
67
77
|
val backgroundColor = config?.backgroundColor
|
|
68
78
|
if (!backgroundColor.isNullOrBlank()) {
|
|
69
79
|
feedView?.setBackgroundColor(Color.parseColor(backgroundColor))
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
8975239E2817DEF80070EBB6 /* FireworkSDKModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 897523832817DEF80070EBB6 /* FireworkSDKModule.m */; };
|
|
38
38
|
8975239F2817DEF80070EBB6 /* LiveStreamModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523852817DEF80070EBB6 /* LiveStreamModule.swift */; };
|
|
39
39
|
897523A02817DEF80070EBB6 /* LiveStreamModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 897523862817DEF80070EBB6 /* LiveStreamModule.m */; };
|
|
40
|
+
89BA1734283619FE00C2287A /* FWCustomCTALinkContentContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89BA1733283619FE00C2287A /* FWCustomCTALinkContentContainerViewController.swift */; };
|
|
40
41
|
/* End PBXBuildFile section */
|
|
41
42
|
|
|
42
43
|
/* Begin PBXCopyFilesBuildPhase section */
|
|
@@ -85,6 +86,7 @@
|
|
|
85
86
|
897523832817DEF80070EBB6 /* FireworkSDKModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FireworkSDKModule.m; sourceTree = "<group>"; };
|
|
86
87
|
897523852817DEF80070EBB6 /* LiveStreamModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiveStreamModule.swift; sourceTree = "<group>"; };
|
|
87
88
|
897523862817DEF80070EBB6 /* LiveStreamModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LiveStreamModule.m; sourceTree = "<group>"; };
|
|
89
|
+
89BA1733283619FE00C2287A /* FWCustomCTALinkContentContainerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FWCustomCTALinkContentContainerViewController.swift; sourceTree = "<group>"; };
|
|
88
90
|
/* End PBXFileReference section */
|
|
89
91
|
|
|
90
92
|
/* Begin PBXFrameworksBuildPhase section */
|
|
@@ -212,6 +214,7 @@
|
|
|
212
214
|
897523812817DEF80070EBB6 /* AdBadgeConfiguration.swift */,
|
|
213
215
|
897523822817DEF80070EBB6 /* FireworkSDKModule+CTA.swift */,
|
|
214
216
|
897523832817DEF80070EBB6 /* FireworkSDKModule.m */,
|
|
217
|
+
89BA1733283619FE00C2287A /* FWCustomCTALinkContentContainerViewController.swift */,
|
|
215
218
|
);
|
|
216
219
|
path = FireworkSDKModule;
|
|
217
220
|
sourceTree = "<group>";
|
|
@@ -301,6 +304,7 @@
|
|
|
301
304
|
8975239A2817DEF80070EBB6 /* FireworkSDKModule+EventTracking.swift in Sources */,
|
|
302
305
|
8975239E2817DEF80070EBB6 /* FireworkSDKModule.m in Sources */,
|
|
303
306
|
897523962817DEF80070EBB6 /* ProductInfoViewConfiguration.swift in Sources */,
|
|
307
|
+
89BA1734283619FE00C2287A /* FWCustomCTALinkContentContainerViewController.swift in Sources */,
|
|
304
308
|
8975238D2817DEF80070EBB6 /* RCTConvert+VideoFeed.swift in Sources */,
|
|
305
309
|
8975238C2817DEF80070EBB6 /* RCTConvert+Shopping.swift in Sources */,
|
|
306
310
|
897523602817DEEE0070EBB6 /* VideoFeed.swift in Sources */,
|
|
@@ -8,8 +8,16 @@
|
|
|
8
8
|
import UIKit
|
|
9
9
|
|
|
10
10
|
class FWNavigatorContainerViewController: UIViewController {
|
|
11
|
-
var
|
|
12
|
-
|
|
11
|
+
var callbackId: String!
|
|
12
|
+
|
|
13
|
+
init(callbackId: String) {
|
|
14
|
+
self.callbackId = callbackId
|
|
15
|
+
super.init(nibName: nil, bundle: nil)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
required init?(coder: NSCoder) {
|
|
19
|
+
super.init(coder: coder)
|
|
20
|
+
}
|
|
13
21
|
|
|
14
22
|
override func viewDidLoad() {
|
|
15
23
|
super.viewDidLoad()
|
|
@@ -17,7 +25,7 @@ class FWNavigatorContainerViewController: UIViewController {
|
|
|
17
25
|
}
|
|
18
26
|
|
|
19
27
|
private func loadContent() {
|
|
20
|
-
let rctRootView = RCTRootView.init(bridge: RCTBridge.current(), moduleName:
|
|
28
|
+
let rctRootView = RCTRootView.init(bridge: RCTBridge.current(), moduleName: "FWNavigationContainer", initialProperties: ["callbackId": callbackId ?? ""])
|
|
21
29
|
view.addSubview(rctRootView)
|
|
22
30
|
rctRootView.translatesAutoresizingMaskIntoConstraints = false
|
|
23
31
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// FWNavigatorModule.m
|
|
3
3
|
// react-native-firework-sdk
|
|
4
4
|
//
|
|
5
|
-
// Created by
|
|
5
|
+
// Created by 熊韦华 on 2022/4/22.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
// The FireworkNavigatorModule exposes instances of Objective-C (native) classes to JavaScript (JS) as JS objects
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
@interface RCT_EXTERN_REMAP_MODULE(FWNavigatorModule, FWNavigatorModule, NSObject)
|
|
13
13
|
|
|
14
|
-
RCT_EXTERN_METHOD(pushNativeContainer:(
|
|
14
|
+
RCT_EXTERN_METHOD(pushNativeContainer:(NSString *)callbackId resolver:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
15
15
|
RCT_EXTERN_METHOD(popNativeContainer:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
16
16
|
|
|
17
17
|
@end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// File.swift
|
|
3
3
|
// react-native-firework-sdk
|
|
4
4
|
//
|
|
5
|
-
// Created by
|
|
5
|
+
// Created by 熊韦华 on 2022/4/21.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
import FireworkVideo
|
|
@@ -18,7 +18,7 @@ class FWNavigatorModule: RCTEventEmitter, FWNavigator {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
@objc(pushNativeContainer:resolver:rejecter:)
|
|
21
|
-
func pushNativeContainer(_
|
|
21
|
+
func pushNativeContainer(_ callbackId: String?, resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock) {
|
|
22
22
|
#if DEBUG
|
|
23
23
|
let formatter = DateFormatter()
|
|
24
24
|
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
|
|
@@ -26,12 +26,7 @@ class FWNavigatorModule: RCTEventEmitter, FWNavigator {
|
|
|
26
26
|
#endif
|
|
27
27
|
|
|
28
28
|
DispatchQueue.main.async {
|
|
29
|
-
guard let
|
|
30
|
-
resolver(false)
|
|
31
|
-
return
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
guard let appComponentName = gAppComponentName else {
|
|
29
|
+
guard let callbackId = callbackId else {
|
|
35
30
|
resolver(false)
|
|
36
31
|
return
|
|
37
32
|
}
|
|
@@ -45,14 +40,12 @@ class FWNavigatorModule: RCTEventEmitter, FWNavigator {
|
|
|
45
40
|
self.sendEvent(withName: FWEventName.LogMessage.rawValue, body: ["message": "[iOS] Before creating containerViewController \(formatter.string(from: Date()))"])
|
|
46
41
|
#endif
|
|
47
42
|
|
|
48
|
-
let containerViewController = FWNavigatorContainerViewController()
|
|
43
|
+
let containerViewController = FWNavigatorContainerViewController(callbackId: callbackId)
|
|
49
44
|
|
|
50
45
|
#if DEBUG
|
|
51
46
|
self.sendEvent(withName: FWEventName.LogMessage.rawValue, body: ["message": "[iOS] After creating containerViewController \(formatter.string(from: Date()))"])
|
|
52
47
|
#endif
|
|
53
48
|
|
|
54
|
-
containerViewController.moduleName = appComponentName
|
|
55
|
-
containerViewController.properties = props
|
|
56
49
|
containerViewController.modalPresentationStyle = .fullScreen
|
|
57
50
|
|
|
58
51
|
#if DEBUG
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
// FWNavigatorProtocol.swift
|
|
3
3
|
// react-native-firework-sdk
|
|
4
4
|
//
|
|
5
|
-
// Created by
|
|
5
|
+
// Created by 熊韦华 on 2022/4/21.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
9
9
|
|
|
10
10
|
protocol FWNavigator {
|
|
11
|
-
func pushNativeContainer(_
|
|
11
|
+
func pushNativeContainer(_ callbackId: String?, resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock)
|
|
12
12
|
func popNativeContainer(resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock)
|
|
13
13
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//
|
|
2
|
+
// FWCustomCTALinkContentContainerViewController.swift
|
|
3
|
+
// FireworkSdk
|
|
4
|
+
//
|
|
5
|
+
// Created by linjie jiang on 2022/5/19.
|
|
6
|
+
// Copyright © 2022 Facebook. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
import UIKit
|
|
10
|
+
|
|
11
|
+
class FWCustomCTALinkContentContainerViewController: UIViewController {
|
|
12
|
+
var url: String?
|
|
13
|
+
|
|
14
|
+
override func viewDidLoad() {
|
|
15
|
+
super.viewDidLoad()
|
|
16
|
+
loadContent()
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
private func loadContent() {
|
|
20
|
+
let rctRootView = RCTRootView.init(bridge: RCTBridge.current(), moduleName: "FWCustomCTALinkContentContainer", initialProperties: ["url": url ?? ""])
|
|
21
|
+
view.addSubview(rctRootView)
|
|
22
|
+
rctRootView.translatesAutoresizingMaskIntoConstraints = false
|
|
23
|
+
|
|
24
|
+
NSLayoutConstraint.activate([
|
|
25
|
+
rctRootView.leftAnchor.constraint(equalTo: view.leftAnchor),
|
|
26
|
+
rctRootView.topAnchor.constraint(equalTo: view.topAnchor),
|
|
27
|
+
rctRootView.rightAnchor.constraint(equalTo: view.rightAnchor),
|
|
28
|
+
rctRootView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
|
|
29
|
+
])
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -18,23 +18,15 @@ extension FireworkSDKModule: FireworkVideoCTADelegate {
|
|
|
18
18
|
|
|
19
19
|
sendEvent(withName: FWEventName.CustomCTAClick.rawValue, body: ["url": url.absoluteString])
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
let containerViewController = FWNavigatorContainerViewController()
|
|
27
|
-
containerViewController.moduleName = moduleName
|
|
28
|
-
containerViewController.properties = [
|
|
29
|
-
"initialRouteName": initialRouteName,
|
|
30
|
-
"initialParams": ["url": url.absoluteString]
|
|
31
|
-
]
|
|
32
|
-
containerViewController.modalPresentationStyle = .fullScreen
|
|
33
|
-
presentedVC.present(containerViewController, animated: true) {
|
|
21
|
+
if customCTALinkContentRenderEnabled, let presentedVC = RCTPresentedViewController() {
|
|
22
|
+
let customCTALinkContentContainerVC = FWCustomCTALinkContentContainerViewController()
|
|
23
|
+
customCTALinkContentContainerVC.modalPresentationStyle = .fullScreen
|
|
24
|
+
customCTALinkContentContainerVC.url = url.absoluteString
|
|
25
|
+
presentedVC.present(customCTALinkContentContainerVC, animated: true) {
|
|
34
26
|
|
|
35
27
|
}
|
|
36
28
|
}
|
|
37
29
|
|
|
38
|
-
return customCTAClickEnabled ||
|
|
30
|
+
return customCTAClickEnabled || customCTALinkContentRenderEnabled
|
|
39
31
|
}
|
|
40
32
|
}
|
|
@@ -13,10 +13,9 @@
|
|
|
13
13
|
_RCT_EXTERN_REMAP_METHOD(init, initializeSDK:(NSString * __nullable)userId, NO)
|
|
14
14
|
RCT_EXTERN_METHOD(openVideoPlayer:(NSString *)url config:(NSDictionary *)config)
|
|
15
15
|
RCT_EXTERN_METHOD(setCustomCTAClickEnabled:(BOOL)enabled)
|
|
16
|
-
RCT_EXTERN_METHOD(
|
|
16
|
+
RCT_EXTERN_METHOD(setCustomCTALinkContentRenderEnabled:(BOOL)enabled)
|
|
17
17
|
RCT_EXTERN_METHOD(setShareBaseURL:(NSString *)url resolver: (RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
18
18
|
RCT_EXTERN_METHOD(setVideoPlaybackEventEnabled:(BOOL)enabled)
|
|
19
19
|
RCT_EXTERN_METHOD(setAdBadgeConfiguration:(NSDictionary *)config resolver: (RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
20
|
-
RCT_EXTERN_METHOD(setAppComponentName:(NSString *)name resolver: (RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
21
20
|
|
|
22
21
|
@end
|
|
@@ -11,14 +11,13 @@ import FireworkVideo
|
|
|
11
11
|
|
|
12
12
|
var gShareBaseURL: String?
|
|
13
13
|
var gAdBadgeConfiguration: AdBadgeConfiguration?
|
|
14
|
-
var gAppComponentName: String?
|
|
15
14
|
|
|
16
15
|
@objc(FireworkSDKModule)
|
|
17
16
|
class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
|
|
18
17
|
// var shareBaseURL: String?
|
|
19
18
|
var customCTAClickEnabled: Bool = false
|
|
20
19
|
|
|
21
|
-
var
|
|
20
|
+
var customCTALinkContentRenderEnabled: Bool = false
|
|
22
21
|
|
|
23
22
|
/// Decide whether to send video playback event to RN.
|
|
24
23
|
var enableVideoPlayBackEvent: Bool = false
|
|
@@ -74,10 +73,9 @@ class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
|
|
|
74
73
|
customCTAClickEnabled = enabled
|
|
75
74
|
}
|
|
76
75
|
|
|
77
|
-
@objc(
|
|
78
|
-
func
|
|
79
|
-
|
|
80
|
-
resolver([:])
|
|
76
|
+
@objc(setCustomCTALinkContentRenderEnabled:)
|
|
77
|
+
func setCustomCTALinkContentRenderEnabled(_ enabled: Bool) {
|
|
78
|
+
customCTALinkContentRenderEnabled = enabled
|
|
81
79
|
}
|
|
82
80
|
|
|
83
81
|
@objc(setShareBaseURL:resolver:rejecter:)
|
|
@@ -96,12 +94,6 @@ class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
|
|
|
96
94
|
gAdBadgeConfiguration = RCTConvert.adBadgeConfiguration(config)
|
|
97
95
|
resolver([:])
|
|
98
96
|
}
|
|
99
|
-
|
|
100
|
-
@objc(setAppComponentName:resolver:rejecter:)
|
|
101
|
-
func setAppComponentName(_ name: String, resolver: RCTPromiseResolveBlock, rejecter: RCTPromiseRejectBlock) {
|
|
102
|
-
gAppComponentName = name
|
|
103
|
-
resolver([:])
|
|
104
|
-
}
|
|
105
97
|
|
|
106
98
|
// MARK: - FireworkVideoSDKDelegate
|
|
107
99
|
func fireworkVideoDidLoadSuccessfully() {
|
|
@@ -32,20 +32,26 @@ class FWNavigator {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
constructor() {
|
|
35
|
+
_defineProperty(this, "_currentCallbackId", 0);
|
|
36
|
+
|
|
37
|
+
_defineProperty(this, "navigatorPages", new Map());
|
|
38
|
+
|
|
35
39
|
_FWNavigatorModule.FWNavigatorModuleEventEmitter.addListener(_FWEventName.FWEventName.LogMessage, () => {});
|
|
36
40
|
}
|
|
37
41
|
/**
|
|
38
|
-
* Push
|
|
39
|
-
*
|
|
40
|
-
* @
|
|
41
|
-
* @returns {Promise<boolean>} The result of pushing RN page from native page.
|
|
42
|
+
* Push RN page from native page. The RN page is embedded in a native container.
|
|
43
|
+
* @param {React.ReactNode} page The RN page.
|
|
44
|
+
* @returns {Promise<boolean>} The result of pushing RN page from native page
|
|
42
45
|
*/
|
|
43
46
|
|
|
44
47
|
|
|
45
|
-
pushNativeContainer(
|
|
46
|
-
_FWLoggerUtil.default.log(`Enter
|
|
48
|
+
pushNativeContainer(page) {
|
|
49
|
+
_FWLoggerUtil.default.log(`Enter pushNativeContainer`);
|
|
47
50
|
|
|
48
|
-
|
|
51
|
+
this._currentCallbackId = this._currentCallbackId + 1;
|
|
52
|
+
const callbackId = `${this._currentCallbackId}`;
|
|
53
|
+
this.navigatorPages.set(callbackId, page);
|
|
54
|
+
return _FWNavigatorModule.default.pushNativeContainer(callbackId);
|
|
49
55
|
}
|
|
50
56
|
/**
|
|
51
57
|
* Pop top-most native container. The native container embed the RN page.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FWNavigator.tsx"],"names":["FWNavigator","getInstance","_instance","constructor","FWNavigatorModuleEventEmitter","addListener","FWEventName","LogMessage","pushNativeContainer","
|
|
1
|
+
{"version":3,"sources":["FWNavigator.tsx"],"names":["FWNavigator","getInstance","_instance","constructor","Map","FWNavigatorModuleEventEmitter","addListener","FWEventName","LogMessage","pushNativeContainer","page","FWLoggerUtil","log","_currentCallbackId","callbackId","navigatorPages","set","FWNavigatorModule","popNativeContainer"],"mappings":";;;;;;;AAAA;;AACA;;AAGA;;;;;;;;;;AAEA;AACA;AACA;AACA,MAAMA,WAAN,CAAkB;AAKS,SAAXC,WAAW,GAAgB;AACvC,QAAI,CAACD,WAAW,CAACE,SAAjB,EAA4B;AAC1BF,MAAAA,WAAW,CAACE,SAAZ,GAAwB,IAAIF,WAAJ,EAAxB;AACD;;AACD,WAAOA,WAAW,CAACE,SAAnB;AACD;;AAEOC,EAAAA,WAAW,GAAG;AAAA,gDAVe,CAUf;;AAAA,4CATE,IAAIC,GAAJ,EASF;;AACpBC,qDAA8BC,WAA9B,CAA0CC,yBAAYC,UAAtD,EAAkE,MAAM,CAAE,CAA1E;AACD;AAED;AACF;AACA;AACA;AACA;;;AACSC,EAAAA,mBAAmB,CAACC,IAAD,EAA0C;AAClEC,0BAAaC,GAAb,CAAkB,2BAAlB;;AACA,SAAKC,kBAAL,GAA0B,KAAKA,kBAAL,GAA0B,CAApD;AACA,UAAMC,UAAU,GAAI,GAAE,KAAKD,kBAAmB,EAA9C;AACA,SAAKE,cAAL,CAAoBC,GAApB,CAAwBF,UAAxB,EAAoCJ,IAApC;AACA,WAAOO,2BAAkBR,mBAAlB,CAAsCK,UAAtC,CAAP;AACD;AAED;AACF;AACA;AACA;;;AACSI,EAAAA,kBAAkB,GAAqB;AAC5C,WAAOD,2BAAkBC,kBAAlB,EAAP;AACD;;AAnCe;;gBAAZlB,W;;eAsCSA,W","sourcesContent":["import { FWEventName } from './models/FWEventName';\nimport FWNavigatorModule, {\n FWNavigatorModuleEventEmitter,\n} from './modules/FWNavigatorModule';\nimport FWLoggerUtil from './utils/FWLoggerUtil';\n\n/**\n * You can use this class for pushing RN page from the native page.\n */\nclass FWNavigator {\n private static _instance?: FWNavigator;\n private _currentCallbackId: number = 0;\n public navigatorPages = new Map<string, React.ReactNode>();\n\n public static getInstance(): FWNavigator {\n if (!FWNavigator._instance) {\n FWNavigator._instance = new FWNavigator();\n }\n return FWNavigator._instance!;\n }\n\n private constructor() {\n FWNavigatorModuleEventEmitter.addListener(FWEventName.LogMessage, () => {});\n }\n\n /**\n * Push RN page from native page. The RN page is embedded in a native container.\n * @param {React.ReactNode} page The RN page.\n * @returns {Promise<boolean>} The result of pushing RN page from native page\n */\n public pushNativeContainer(page: React.ReactNode): Promise<boolean> {\n FWLoggerUtil.log(`Enter pushNativeContainer`);\n this._currentCallbackId = this._currentCallbackId + 1;\n const callbackId = `${this._currentCallbackId}`;\n this.navigatorPages.set(callbackId, page);\n return FWNavigatorModule.pushNativeContainer(callbackId);\n }\n\n /**\n * Pop top-most native container. The native container embed the RN page.\n * @returns {Promise<boolean>} The result of poping top-most native container.\n */\n public popNativeContainer(): Promise<boolean> {\n return FWNavigatorModule.popNativeContainer();\n }\n}\n\nexport default FWNavigator;\n"]}
|
|
@@ -57,16 +57,19 @@ class FireworkSDK {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
* The custom CTA link content
|
|
60
|
+
* The custom render method of CTA link content.
|
|
61
|
+
* We will show a native container to display the element returned by the render method.
|
|
61
62
|
*/
|
|
62
|
-
get
|
|
63
|
-
return this.
|
|
63
|
+
get customCTALinkContentRender() {
|
|
64
|
+
return this._customCTALinkContentRender;
|
|
64
65
|
}
|
|
65
66
|
|
|
66
|
-
set
|
|
67
|
-
|
|
67
|
+
set customCTALinkContentRender(value) {
|
|
68
|
+
_FWLoggerUtil.default.log(`Set customCTALinkContentRender ${!!value}`);
|
|
68
69
|
|
|
69
|
-
|
|
70
|
+
this._customCTALinkContentRender = value;
|
|
71
|
+
|
|
72
|
+
_FireworkSDKModule.default.setCustomCTALinkContentRenderEnabled(value ? true : false);
|
|
70
73
|
}
|
|
71
74
|
|
|
72
75
|
/**
|
|
@@ -112,19 +115,6 @@ class FireworkSDK {
|
|
|
112
115
|
});
|
|
113
116
|
}
|
|
114
117
|
|
|
115
|
-
/**
|
|
116
|
-
* The app component name.
|
|
117
|
-
*/
|
|
118
|
-
get appComponentName() {
|
|
119
|
-
return this._appComponentName;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
set appComponentName(value) {
|
|
123
|
-
this._appComponentName = value;
|
|
124
|
-
|
|
125
|
-
_FireworkSDKModule.default.setAppComponentName(value);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
118
|
get eventEmitter() {
|
|
129
119
|
return _FireworkSDKModule.FireworkSDKModuleEventEmitter;
|
|
130
120
|
}
|
|
@@ -173,7 +163,7 @@ class FireworkSDK {
|
|
|
173
163
|
|
|
174
164
|
_defineProperty(this, "_onCustomCTAClick", void 0);
|
|
175
165
|
|
|
176
|
-
_defineProperty(this, "
|
|
166
|
+
_defineProperty(this, "_customCTALinkContentRender", void 0);
|
|
177
167
|
|
|
178
168
|
_defineProperty(this, "_onVideoPlayback", void 0);
|
|
179
169
|
|
|
@@ -181,8 +171,6 @@ class FireworkSDK {
|
|
|
181
171
|
|
|
182
172
|
_defineProperty(this, "_adBadgeConfiguration", void 0);
|
|
183
173
|
|
|
184
|
-
_defineProperty(this, "_appComponentName", void 0);
|
|
185
|
-
|
|
186
174
|
this.eventEmitter.addListener(_FWEventName.FWEventName.SDKInit, event => {
|
|
187
175
|
_FWLoggerUtil.default.log(`Receive SDKInit event ${event === null || event === void 0 ? void 0 : event.error}`);
|
|
188
176
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["FireworkSDK.ts"],"names":["FireworkSDK","onCustomCTAClick","_onCustomCTAClick","value","FWLoggerUtil","log","FireworkSDKModule","setCustomCTAClickEnabled","customCTALinkContentPageRouteName","_customCTALinkContentPageRouteName","setCustomCTALinkContentPageRouteName","onVideoPlayback","_onVideoPlayback","setVideoPlaybackEventEnabled","shareBaseURL","_shareBaseURL","setShareBaseURL","then","eventEmitter","emit","FWEventName","ShareBaseURLUpdated","adBadgeConfiguration","_adBadgeConfiguration","setAdBadgeConfiguration","AdBadgeConfigurationUpdated","appComponentName","_appComponentName","setAppComponentName","FireworkSDKModuleEventEmitter","shopping","VideoShopping","getInstance","liveStream","LiveStream","navigator","FWNavigator","_instance","constructor","addListener","SDKInit","event","error","onSDKInit","LogMessage","logNativeMessage","message","CustomCTAClick","url","VideoPlayback","eventName","VideoFeedClick","info","id","onVideoFeedClick","init","userId","ShoppingModule","LiveStreamModule","openVideoPlayer","config"],"mappings":";;;;;;;AACA;;AAGA;;AAQA;;AAGA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAUA;AACA;AACA;AACA,MAAMA,WAAN,CAAkB;AAGhB;AACF;AACA;;AAGE;AACF;AACA;;AAGE;AACF;AACA;AAC6B,MAAhBC,gBAAgB,GAAuC;AAChE,WAAO,KAAKC,iBAAZ;AACD;;AAC0B,MAAhBD,gBAAgB,CAACE,KAAD,EAA4C;AACrEC,0BAAaC,GAAb,CAAkB,iCAAgC,CAAC,CAACF,KAAM,EAA1D;;AACA,SAAKD,iBAAL,GAAyBC,KAAzB;;AACAG,+BAAkBC,wBAAlB,CAA2CJ,KAAK,GAAG,IAAH,GAAU,KAA1D;AACD;;AAGD;AACF;AACA;AAC8C,MAAjCK,iCAAiC,GAAuB;AACjE,WAAO,KAAKC,kCAAZ;AACD;;AAC2C,MAAjCD,iCAAiC,CAACL,KAAD,EAA4B;AACtE,SAAKM,kCAAL,GAA0CN,KAA1C;;AACAG,+BAAkBI,oCAAlB,CAAuDP,KAAvD;AACD;;AAGD;AACF;AACA;AAC4B,MAAfQ,eAAe,GAAsC;AAC9D,WAAO,KAAKC,gBAAZ;AACD;;AACyB,MAAfD,eAAe,CAACR,KAAD,EAA2C;AACnE,SAAKS,gBAAL,GAAwBT,KAAxB;;AACAG,+BAAkBO,4BAAlB,CAA+CV,KAAK,GAAG,IAAH,GAAU,KAA9D;AACD;;AAGD;AACF;AACA;AACyB,MAAZW,Y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AQA,SAAKvB,YAAL,CAAkBqB,WAAlB,CAA8BnB,yBAAY+B,cAA1C,EAA2DV,KAAD,IAAW;AACnErC,4BAAaC,GAAb,CAAkB,gCAA+BoC,KAAhC,aAAgCA,KAAhC,uBAAgCA,KAAK,CAAEW,IAAP,CAAYC,EAAG,EAAhE;;AAEA,UAAI,KAAKC,gBAAT,EAA2B;AACzB,aAAKA,gBAAL,CAAsBb,KAAtB,aAAsBA,KAAtB,cAAsBA,KAAtB,GAA+B,EAA/B;AACD;AACF,KAND;AAOD;AAED;AACF;AACA;AACA;;;AACSc,EAAAA,IAAI,CAACC,MAAD,EAAkB;AAC3BlD,+BAAkBiD,IAAlB,CAAuBC,MAAvB;;AACAC,4BAAeF,IAAf;;AACAG,8BAAiBH,IAAjB;AACD;AAED;AACF;AACA;AACA;AACA;;;AACSI,EAAAA,eAAe,CAACX,GAAD,EAAcY,MAAd,EAAiD;AACrEtD,+BAAkBqD,eAAlB,CAAkCX,GAAlC,EAAuCY,MAAvC,aAAuCA,MAAvC,cAAuCA,MAAvC,GAAiD,EAAjD;AACD;;AAtLe;;gBAAZ5D,W;;eAyLSA,W","sourcesContent":["import type { NativeEventEmitter } from 'react-native';\nimport LiveStream from './LiveStream';\n\nimport type AdBadgeConfiguration from './models/AdBadgeConfiguration';\nimport { FWEventName } from './models/FWEventName';\nimport type {\n CustomCTAClickEvent,\n SDKInitEvent,\n VideoFeedClickEvent,\n VideoPlaybackEvent,\n} from './models/FWEvents';\nimport type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport FireworkSDKModule, {\n FireworkSDKModuleEventEmitter,\n} from './modules/FireworkSDKModule';\nimport LiveStreamModule from './modules/LiveStreamModule';\nimport ShoppingModule from './modules/ShoppingModule';\nimport VideoShopping from './VideoShopping';\nimport FWNavigator from './FWNavigator';\nimport FWLoggerUtil from './utils/FWLoggerUtil';\n\nexport type SDKInitCallback = (event: SDKInitEvent) => void;\nexport type CustomCTAClickCallback = (event: CustomCTAClickEvent) => void;\nexport type CustomCTALinkContentRender = (\n event: CustomCTAClickEvent\n) => React.ReactNode | null;\nexport type VideoPlaybackCallback = (event: VideoPlaybackEvent) => void;\nexport type VideoFeedClickCallback = (event: VideoFeedClickEvent) => void;\n\n/**\n * Entry class of Firework SDK, which supports the sdk initialization and global configuration.\n */\nclass FireworkSDK {\n private static _instance?: FireworkSDK;\n\n /**\n * The callback of SDK initialization.\n */\n public onSDKInit?: SDKInitCallback;\n\n /**\n * the callback of clicking Video Feed.\n */\n public onVideoFeedClick?: VideoFeedClickCallback;\n\n /**\n * The callback of clicking custom CTA.\n */\n public get onCustomCTAClick(): CustomCTAClickCallback | undefined {\n return this._onCustomCTAClick;\n }\n public set onCustomCTAClick(value: CustomCTAClickCallback | undefined) {\n FWLoggerUtil.log(`Set onCustomCTAClick callback ${!!value}`);\n this._onCustomCTAClick = value;\n FireworkSDKModule.setCustomCTAClickEnabled(value ? true : false);\n }\n private _onCustomCTAClick: CustomCTAClickCallback | undefined;\n\n /**\n * The custom CTA link content page route name.\n */\n public get customCTALinkContentPageRouteName(): string | undefined {\n return this._customCTALinkContentPageRouteName;\n }\n public set customCTALinkContentPageRouteName(value: string | undefined) {\n this._customCTALinkContentPageRouteName = value;\n FireworkSDKModule.setCustomCTALinkContentPageRouteName(value);\n }\n private _customCTALinkContentPageRouteName: string | undefined;\n\n /**\n * The callback of video playback.\n */\n public get onVideoPlayback(): VideoPlaybackCallback | undefined {\n return this._onVideoPlayback;\n }\n public set onVideoPlayback(value: VideoPlaybackCallback | undefined) {\n this._onVideoPlayback = value;\n FireworkSDKModule.setVideoPlaybackEventEnabled(value ? true : false);\n }\n private _onVideoPlayback?: VideoPlaybackCallback | undefined;\n\n /**\n * The share base URL of videos.\n */\n public get shareBaseURL(): string | undefined {\n return this._shareBaseURL;\n }\n public set shareBaseURL(value: string | undefined) {\n this._shareBaseURL = value;\n FireworkSDKModule.setShareBaseURL(value).then(() => {\n this.eventEmitter.emit(FWEventName.ShareBaseURLUpdated);\n });\n }\n private _shareBaseURL: string | undefined;\n\n /**\n * The configuration for ad badges.\n */\n public get adBadgeConfiguration(): AdBadgeConfiguration | undefined {\n return this._adBadgeConfiguration;\n }\n public set adBadgeConfiguration(value: AdBadgeConfiguration | undefined) {\n this._adBadgeConfiguration = value;\n FireworkSDKModule.setAdBadgeConfiguration(value).then(() => {\n this.eventEmitter.emit(FWEventName.AdBadgeConfigurationUpdated);\n });\n }\n private _adBadgeConfiguration: AdBadgeConfiguration | undefined;\n\n /**\n * The app component name.\n */\n public get appComponentName(): string | undefined {\n return this._appComponentName;\n }\n public set appComponentName(value: string | undefined) {\n this._appComponentName = value;\n FireworkSDKModule.setAppComponentName(value);\n }\n private _appComponentName: string | undefined;\n\n private get eventEmitter(): NativeEventEmitter {\n return FireworkSDKModuleEventEmitter;\n }\n\n /**\n * Get VideoShopping object.\n */\n public get shopping(): VideoShopping {\n return VideoShopping.getInstance();\n }\n\n /**\n * Get LiveStream object.\n */\n public get liveStream(): LiveStream {\n return LiveStream.getInstance();\n }\n\n /**\n * Get FWNavigator object.\n */\n public get navigator(): FWNavigator {\n return FWNavigator.getInstance();\n }\n\n /**\n * Get global single instance of FireworkSDK class.\n * @returns FireworkSDK\n */\n public static getInstance() {\n if (!FireworkSDK._instance) {\n FireworkSDK._instance = new FireworkSDK();\n }\n\n return FireworkSDK._instance!;\n }\n\n private constructor() {\n this.eventEmitter.addListener(FWEventName.SDKInit, (event) => {\n FWLoggerUtil.log(`Receive SDKInit event ${event?.error}`);\n\n if (this.onSDKInit) {\n this.onSDKInit(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.LogMessage, (event) => {\n FWLoggerUtil.logNativeMessage(event.message);\n });\n\n this.eventEmitter.addListener(FWEventName.CustomCTAClick, (event) => {\n FWLoggerUtil.log(`Receive CustomCTAClick url ${event?.url}`);\n\n if (this.onCustomCTAClick) {\n this.onCustomCTAClick(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.VideoPlayback, (event) => {\n FWLoggerUtil.log(`Receive VideoPlayback event ${event?.eventName}`);\n\n if (this.onVideoPlayback) {\n this.onVideoPlayback(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.VideoFeedClick, (event) => {\n FWLoggerUtil.log(`Receive VideoFeedClick event ${event?.info.id}`);\n\n if (this.onVideoFeedClick) {\n this.onVideoFeedClick(event ?? {});\n }\n });\n }\n\n /**\n * Initializes Firework SDK.\n * @param {string?} userId An id to uniquely identify device or user.\n */\n public init(userId?: string) {\n FireworkSDKModule.init(userId);\n ShoppingModule.init();\n LiveStreamModule.init();\n }\n\n /**\n * Open Video URL.\n * @param {string} url\n * @param {VideoPlayerConfiguration} config\n */\n public openVideoPlayer(url: string, config?: VideoPlayerConfiguration) {\n FireworkSDKModule.openVideoPlayer(url, config ?? {});\n }\n}\n\nexport default FireworkSDK;\n"]}
|
|
1
|
+
{"version":3,"sources":["FireworkSDK.ts"],"names":["FireworkSDK","onCustomCTAClick","_onCustomCTAClick","value","FWLoggerUtil","log","FireworkSDKModule","setCustomCTAClickEnabled","customCTALinkContentRender","_customCTALinkContentRender","setCustomCTALinkContentRenderEnabled","onVideoPlayback","_onVideoPlayback","setVideoPlaybackEventEnabled","shareBaseURL","_shareBaseURL","setShareBaseURL","then","eventEmitter","emit","FWEventName","ShareBaseURLUpdated","adBadgeConfiguration","_adBadgeConfiguration","setAdBadgeConfiguration","AdBadgeConfigurationUpdated","FireworkSDKModuleEventEmitter","shopping","VideoShopping","getInstance","liveStream","LiveStream","navigator","FWNavigator","_instance","constructor","addListener","SDKInit","event","error","onSDKInit","LogMessage","logNativeMessage","message","CustomCTAClick","url","VideoPlayback","eventName","VideoFeedClick","info","id","onVideoFeedClick","init","userId","ShoppingModule","LiveStreamModule","openVideoPlayer","config"],"mappings":";;;;;;;AACA;;AAGA;;AAQA;;AAGA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAUA;AACA;AACA;AACA,MAAMA,WAAN,CAAkB;AAGhB;A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kD,eAAlB,CAAkCX,GAAlC,EAAuCY,MAAvC,aAAuCA,MAAvC,cAAuCA,MAAvC,GAAiD,EAAjD;AACD;;AAlLe;;gBAAZzD,W;;eAqLSA,W","sourcesContent":["import type { NativeEventEmitter } from 'react-native';\nimport LiveStream from './LiveStream';\n\nimport type AdBadgeConfiguration from './models/AdBadgeConfiguration';\nimport { FWEventName } from './models/FWEventName';\nimport type {\n CustomCTAClickEvent,\n SDKInitEvent,\n VideoFeedClickEvent,\n VideoPlaybackEvent,\n} from './models/FWEvents';\nimport type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport FireworkSDKModule, {\n FireworkSDKModuleEventEmitter,\n} from './modules/FireworkSDKModule';\nimport LiveStreamModule from './modules/LiveStreamModule';\nimport ShoppingModule from './modules/ShoppingModule';\nimport VideoShopping from './VideoShopping';\nimport FWNavigator from './FWNavigator';\nimport FWLoggerUtil from './utils/FWLoggerUtil';\n\nexport type SDKInitCallback = (event: SDKInitEvent) => void;\nexport type CustomCTAClickCallback = (event: CustomCTAClickEvent) => void;\nexport type CustomCTALinkContentRender = (\n event: CustomCTAClickEvent\n) => React.ReactNode | null;\nexport type VideoPlaybackCallback = (event: VideoPlaybackEvent) => void;\nexport type VideoFeedClickCallback = (event: VideoFeedClickEvent) => void;\n\n/**\n * Entry class of Firework SDK, which supports the sdk initialization and global configuration.\n */\nclass FireworkSDK {\n private static _instance?: FireworkSDK;\n\n /**\n * The callback of SDK initialization.\n */\n public onSDKInit?: SDKInitCallback;\n\n /**\n * the callback of clicking Video Feed.\n */\n public onVideoFeedClick?: VideoFeedClickCallback;\n\n /**\n * The callback of clicking custom CTA.\n */\n public get onCustomCTAClick(): CustomCTAClickCallback | undefined {\n return this._onCustomCTAClick;\n }\n public set onCustomCTAClick(value: CustomCTAClickCallback | undefined) {\n FWLoggerUtil.log(`Set onCustomCTAClick callback ${!!value}`);\n this._onCustomCTAClick = value;\n FireworkSDKModule.setCustomCTAClickEnabled(value ? true : false);\n }\n private _onCustomCTAClick: CustomCTAClickCallback | undefined;\n\n /**\n * The custom render method of CTA link content.\n * We will show a native container to display the element returned by the render method.\n */\n public get customCTALinkContentRender():\n | CustomCTALinkContentRender\n | undefined {\n return this._customCTALinkContentRender;\n }\n public set customCTALinkContentRender(\n value: CustomCTALinkContentRender | undefined\n ) {\n FWLoggerUtil.log(`Set customCTALinkContentRender ${!!value}`);\n this._customCTALinkContentRender = value;\n FireworkSDKModule.setCustomCTALinkContentRenderEnabled(\n value ? true : false\n );\n }\n private _customCTALinkContentRender: CustomCTALinkContentRender | undefined;\n\n /**\n * The callback of video playback.\n */\n public get onVideoPlayback(): VideoPlaybackCallback | undefined {\n return this._onVideoPlayback;\n }\n public set onVideoPlayback(value: VideoPlaybackCallback | undefined) {\n this._onVideoPlayback = value;\n FireworkSDKModule.setVideoPlaybackEventEnabled(value ? true : false);\n }\n private _onVideoPlayback?: VideoPlaybackCallback | undefined;\n\n /**\n * The share base URL of videos.\n */\n public get shareBaseURL(): string | undefined {\n return this._shareBaseURL;\n }\n public set shareBaseURL(value: string | undefined) {\n this._shareBaseURL = value;\n FireworkSDKModule.setShareBaseURL(value).then(() => {\n this.eventEmitter.emit(FWEventName.ShareBaseURLUpdated);\n });\n }\n private _shareBaseURL: string | undefined;\n\n /**\n * The configuration for ad badges.\n */\n public get adBadgeConfiguration(): AdBadgeConfiguration | undefined {\n return this._adBadgeConfiguration;\n }\n public set adBadgeConfiguration(value: AdBadgeConfiguration | undefined) {\n this._adBadgeConfiguration = value;\n FireworkSDKModule.setAdBadgeConfiguration(value).then(() => {\n this.eventEmitter.emit(FWEventName.AdBadgeConfigurationUpdated);\n });\n }\n private _adBadgeConfiguration?: AdBadgeConfiguration | undefined;\n\n private get eventEmitter(): NativeEventEmitter {\n return FireworkSDKModuleEventEmitter;\n }\n\n /**\n * Get VideoShopping object.\n */\n public get shopping(): VideoShopping {\n return VideoShopping.getInstance();\n }\n\n /**\n * Get LiveStream object.\n */\n public get liveStream(): LiveStream {\n return LiveStream.getInstance();\n }\n\n /**\n * Get FWNavigator object.\n */\n public get navigator(): FWNavigator {\n return FWNavigator.getInstance();\n }\n\n /**\n * Get global single instance of FireworkSDK class.\n * @returns FireworkSDK\n */\n public static getInstance() {\n if (!FireworkSDK._instance) {\n FireworkSDK._instance = new FireworkSDK();\n }\n\n return FireworkSDK._instance!;\n }\n\n private constructor() {\n this.eventEmitter.addListener(FWEventName.SDKInit, (event) => {\n FWLoggerUtil.log(`Receive SDKInit event ${event?.error}`);\n\n if (this.onSDKInit) {\n this.onSDKInit(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.LogMessage, (event) => {\n FWLoggerUtil.logNativeMessage(event.message);\n });\n\n this.eventEmitter.addListener(FWEventName.CustomCTAClick, (event) => {\n FWLoggerUtil.log(`Receive CustomCTAClick url ${event?.url}`);\n\n if (this.onCustomCTAClick) {\n this.onCustomCTAClick(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.VideoPlayback, (event) => {\n FWLoggerUtil.log(`Receive VideoPlayback event ${event?.eventName}`);\n\n if (this.onVideoPlayback) {\n this.onVideoPlayback(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.VideoFeedClick, (event) => {\n FWLoggerUtil.log(`Receive VideoFeedClick event ${event?.info.id}`);\n\n if (this.onVideoFeedClick) {\n this.onVideoFeedClick(event ?? {});\n }\n });\n }\n\n /**\n * Initializes Firework SDK.\n * @param {string?} userId An id to uniquely identify device or user.\n */\n public init(userId?: string) {\n FireworkSDKModule.init(userId);\n ShoppingModule.init();\n LiveStreamModule.init();\n }\n\n /**\n * Open Video URL.\n * @param {string} url\n * @param {VideoPlayerConfiguration} config\n */\n public openVideoPlayer(url: string, config?: VideoPlayerConfiguration) {\n FireworkSDKModule.openVideoPlayer(url, config ?? {});\n }\n}\n\nexport default FireworkSDK;\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _FWLoggerUtil = _interopRequireDefault(require("../utils/FWLoggerUtil"));
|
|
13
|
+
|
|
14
|
+
var _FireworkSDK = _interopRequireDefault(require("../FireworkSDK"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
const CustomCTALinkContentContainer = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
url = ''
|
|
21
|
+
} = _ref;
|
|
22
|
+
|
|
23
|
+
_FWLoggerUtil.default.log(`CustomCTALinkContentContainer url: ${url}`);
|
|
24
|
+
|
|
25
|
+
const customCTALinkContentRender = _FireworkSDK.default.getInstance().customCTALinkContentRender;
|
|
26
|
+
|
|
27
|
+
let content = customCTALinkContentRender === null || customCTALinkContentRender === void 0 ? void 0 : customCTALinkContentRender({
|
|
28
|
+
url
|
|
29
|
+
});
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
31
|
+
style: styles.container
|
|
32
|
+
}, content);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
var _default = CustomCTALinkContentContainer;
|
|
36
|
+
exports.default = _default;
|
|
37
|
+
|
|
38
|
+
const styles = _reactNative.StyleSheet.create({
|
|
39
|
+
container: {
|
|
40
|
+
flex: 1
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=CustomCTALinkContentContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["CustomCTALinkContentContainer.tsx"],"names":["CustomCTALinkContentContainer","url","FWLoggerUtil","log","customCTALinkContentRender","FireworkSDK","getInstance","content","styles","container","StyleSheet","create","flex"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAEA;;;;AAMA,MAAMA,6BAA6B,GAAG,QAEK;AAAA,MAFJ;AACrCC,IAAAA,GAAG,GAAG;AAD+B,GAEI;;AACzCC,wBAAaC,GAAb,CAAkB,sCAAqCF,GAAI,EAA3D;;AACA,QAAMG,0BAA0B,GAC9BC,qBAAYC,WAAZ,GAA0BF,0BAD5B;;AAEA,MAAIG,OAAO,GAAGH,0BAAH,aAAGA,0BAAH,uBAAGA,0BAA0B,CAAG;AAAEH,IAAAA;AAAF,GAAH,CAAxC;AACA,sBAAO,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAEO,MAAM,CAACC;AAApB,KAAgCF,OAAhC,CAAP;AACD,CARD;;eAUeP,6B;;;AAEf,MAAMQ,MAAM,GAAGE,wBAAWC,MAAX,CAAkB;AAC/BF,EAAAA,SAAS,EAAE;AACTG,IAAAA,IAAI,EAAE;AADG;AADoB,CAAlB,CAAf","sourcesContent":["import React from 'react';\n\nimport { StyleSheet, View } from 'react-native';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\n\nimport FireworkSDK from '../FireworkSDK';\n\nexport interface ICustomCTALinkContentContainerProps {\n url?: string;\n}\n\nconst CustomCTALinkContentContainer = ({\n url = '',\n}: ICustomCTALinkContentContainerProps) => {\n FWLoggerUtil.log(`CustomCTALinkContentContainer url: ${url}`);\n const customCTALinkContentRender =\n FireworkSDK.getInstance().customCTALinkContentRender;\n let content = customCTALinkContentRender?.({ url });\n return <View style={styles.container}>{content}</View>;\n};\n\nexport default CustomCTALinkContentContainer;\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _FWNavigator = _interopRequireDefault(require("../FWNavigator"));
|
|
13
|
+
|
|
14
|
+
var _FWLoggerUtil = _interopRequireDefault(require("../utils/FWLoggerUtil"));
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
const NavigationContainer = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
callbackId
|
|
21
|
+
} = _ref;
|
|
22
|
+
|
|
23
|
+
_FWLoggerUtil.default.log('Render NavigationContainer');
|
|
24
|
+
|
|
25
|
+
const page = _FWNavigator.default.getInstance().navigatorPages.get(callbackId !== null && callbackId !== void 0 ? callbackId : '');
|
|
26
|
+
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
28
|
+
style: styles.container
|
|
29
|
+
}, page);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const styles = _reactNative.StyleSheet.create({
|
|
33
|
+
container: {
|
|
34
|
+
flex: 1
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
var _default = NavigationContainer;
|
|
39
|
+
exports.default = _default;
|
|
40
|
+
//# sourceMappingURL=NavigationContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["NavigationContainer.tsx"],"names":["NavigationContainer","callbackId","FWLoggerUtil","log","page","FWNavigator","getInstance","navigatorPages","get","styles","container","StyleSheet","create","flex"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;AACA;;;;AAMA,MAAMA,mBAAmB,GAAG,QAA+C;AAAA,MAA9C;AAAEC,IAAAA;AAAF,GAA8C;;AACzEC,wBAAaC,GAAb,CAAiB,4BAAjB;;AACA,QAAMC,IAAI,GAAGC,qBAAYC,WAAZ,GAA0BC,cAA1B,CAAyCC,GAAzC,CAA6CP,UAA7C,aAA6CA,UAA7C,cAA6CA,UAA7C,GAA2D,EAA3D,CAAb;;AACA,sBAAO,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAEQ,MAAM,CAACC;AAApB,KAAgCN,IAAhC,CAAP;AACD,CAJD;;AAMA,MAAMK,MAAM,GAAGE,wBAAWC,MAAX,CAAkB;AAC/BF,EAAAA,SAAS,EAAE;AACTG,IAAAA,IAAI,EAAE;AADG;AADoB,CAAlB,CAAf;;eAMeb,mB","sourcesContent":["import React from 'react';\n\nimport { StyleSheet, View } from 'react-native';\n\nimport FWNavigator from '../FWNavigator';\nimport FWLoggerUtil from '../utils/FWLoggerUtil';\n\nexport interface INavigationContainerProps {\n callbackId?: string;\n}\n\nconst NavigationContainer = ({ callbackId }: INavigationContainerProps) => {\n FWLoggerUtil.log('Render NavigationContainer');\n const page = FWNavigator.getInstance().navigatorPages.get(callbackId ?? '');\n return <View style={styles.container}>{page}</View>;\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n});\n\nexport default NavigationContainer;\n"]}
|
|
@@ -80,7 +80,7 @@ class VideoFeed extends _react.default.Component {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
render() {
|
|
83
|
-
var _videoFeedConfigurati, _videoFeedConfigurati2, _videoFeedConfigurati3, _FireworkSDK$getInsta, _FireworkSDK$getInsta2, _adBadgeConfiguration, _adBadgeConfiguration2, _adBadgeConfiguration3;
|
|
83
|
+
var _videoFeedConfigurati, _videoFeedConfigurati2, _videoFeedConfigurati3, _videoFeedConfigurati4, _FireworkSDK$getInsta, _FireworkSDK$getInsta2, _adBadgeConfiguration, _adBadgeConfiguration2, _adBadgeConfiguration3;
|
|
84
84
|
|
|
85
85
|
const {
|
|
86
86
|
source,
|
|
@@ -92,6 +92,7 @@ class VideoFeed extends _react.default.Component {
|
|
|
92
92
|
} = this.props;
|
|
93
93
|
const titleHidden = (_videoFeedConfigurati = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : (_videoFeedConfigurati2 = videoFeedConfiguration.title) === null || _videoFeedConfigurati2 === void 0 ? void 0 : _videoFeedConfigurati2.hidden) !== null && _videoFeedConfigurati !== void 0 ? _videoFeedConfigurati : false;
|
|
94
94
|
const titlePosition = (_videoFeedConfigurati3 = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : videoFeedConfiguration.titlePosition) !== null && _videoFeedConfigurati3 !== void 0 ? _videoFeedConfigurati3 : 'nested';
|
|
95
|
+
const customLayoutName = (_videoFeedConfigurati4 = videoFeedConfiguration === null || videoFeedConfiguration === void 0 ? void 0 : videoFeedConfiguration.customLayoutName) !== null && _videoFeedConfigurati4 !== void 0 ? _videoFeedConfigurati4 : '';
|
|
95
96
|
const shareBaseURL = (_FireworkSDK$getInsta = _FireworkSDK.default.getInstance().shareBaseURL) !== null && _FireworkSDK$getInsta !== void 0 ? _FireworkSDK$getInsta : '';
|
|
96
97
|
const adBadgeConfiguration = (_FireworkSDK$getInsta2 = _FireworkSDK.default.getInstance().adBadgeConfiguration) !== null && _FireworkSDK$getInsta2 !== void 0 ? _FireworkSDK$getInsta2 : {};
|
|
97
98
|
const adBadgeTextType = (_adBadgeConfiguration = adBadgeConfiguration.badgeTextType) !== null && _adBadgeConfiguration !== void 0 ? _adBadgeConfiguration : '';
|
|
@@ -107,6 +108,7 @@ class VideoFeed extends _react.default.Component {
|
|
|
107
108
|
key += `_mode:${mode}`;
|
|
108
109
|
key += `_titleHidden:${titleHidden}`;
|
|
109
110
|
key += `_titlePosition:${titlePosition}`;
|
|
111
|
+
key += `_customLayoutName:${customLayoutName}`;
|
|
110
112
|
key += `_shareBaseURL:${shareBaseURL}`;
|
|
111
113
|
key += `_adBadgeTextType:${adBadgeTextType}`;
|
|
112
114
|
key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;
|