react-native-firework-sdk 2.4.1-beta.1 → 2.4.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.
Files changed (48) hide show
  1. package/FireworkVideoUI.xcframework/Info.plist +5 -5
  2. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  3. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Info.plist +0 -0
  4. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  5. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Info.plist +0 -0
  6. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +1 -1
  7. package/android/src/main/AndroidManifest.xml +4 -0
  8. package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +4 -1
  9. package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWNavigatorInterface.kt +2 -0
  10. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWNavigatorModule.kt +41 -13
  11. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +1 -1
  12. package/android/src/main/java/com/fireworksdk/bridge/reactnative/pages/FWContianerActivity.kt +61 -0
  13. package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +1 -0
  14. package/android/src/main/java/com/fireworksdk/bridge/utils/FWGlobalDataUtil.kt +0 -2
  15. package/android/src/main/java/com/fireworksdk/bridge/utils/FWStoryBlockUtil.kt +30 -0
  16. package/android/src/main/res/layout/fw_bridge_fragment_container.xml +8 -0
  17. package/ios/FireworkSdk.xcodeproj/project.pbxproj +12 -0
  18. package/ios/Models/RNToNative/RCTConvert+FWNavigatorModule.swift +21 -0
  19. package/ios/Models/RNToNative/RCTConvert+FireworkSDKModule.swift +3 -30
  20. package/ios/Models/RNToNative/RCTConvert+StoryBlock.swift +2 -2
  21. package/ios/Models/RNToNative/RCTConvert+VideoFeed.swift +5 -5
  22. package/ios/Modules/FWNavigatorModule/FWNavigatorModule.m +2 -2
  23. package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +59 -4
  24. package/ios/Modules/FWNavigatorModule/FWRNContainerViewController.swift +33 -0
  25. package/ios/Modules/FWNavigatorModule/PushRNContainerParams.swift +14 -0
  26. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +30 -14
  27. package/lib/commonjs/FWNavigator.js +21 -0
  28. package/lib/commonjs/FWNavigator.js.map +1 -1
  29. package/lib/commonjs/index.js.map +1 -1
  30. package/lib/commonjs/models/PushRNContainerParams.js +2 -0
  31. package/lib/commonjs/models/PushRNContainerParams.js.map +1 -0
  32. package/lib/commonjs/modules/FWNavigatorModule.js.map +1 -1
  33. package/lib/module/FWNavigator.js +21 -0
  34. package/lib/module/FWNavigator.js.map +1 -1
  35. package/lib/module/index.js.map +1 -1
  36. package/lib/module/models/PushRNContainerParams.js +2 -0
  37. package/lib/module/models/PushRNContainerParams.js.map +1 -0
  38. package/lib/module/modules/FWNavigatorModule.js +1 -2
  39. package/lib/module/modules/FWNavigatorModule.js.map +1 -1
  40. package/lib/typescript/FWNavigator.d.ts +14 -0
  41. package/lib/typescript/index.d.ts +3 -1
  42. package/lib/typescript/models/PushRNContainerParams.d.ts +8 -0
  43. package/lib/typescript/modules/FWNavigatorModule.d.ts +3 -0
  44. package/package.json +1 -1
  45. package/src/FWNavigator.ts +20 -0
  46. package/src/index.ts +4 -0
  47. package/src/models/PushRNContainerParams.ts +9 -0
  48. package/src/modules/FWNavigatorModule.ts +5 -2
@@ -6,30 +6,30 @@
6
6
  <array>
7
7
  <dict>
8
8
  <key>LibraryIdentifier</key>
9
- <string>ios-arm64_x86_64-simulator</string>
9
+ <string>ios-arm64</string>
10
10
  <key>LibraryPath</key>
11
11
  <string>FireworkVideoUI.framework</string>
12
12
  <key>SupportedArchitectures</key>
13
13
  <array>
14
14
  <string>arm64</string>
15
- <string>x86_64</string>
16
15
  </array>
17
16
  <key>SupportedPlatform</key>
18
17
  <string>ios</string>
19
- <key>SupportedPlatformVariant</key>
20
- <string>simulator</string>
21
18
  </dict>
22
19
  <dict>
23
20
  <key>LibraryIdentifier</key>
24
- <string>ios-arm64</string>
21
+ <string>ios-arm64_x86_64-simulator</string>
25
22
  <key>LibraryPath</key>
26
23
  <string>FireworkVideoUI.framework</string>
27
24
  <key>SupportedArchitectures</key>
28
25
  <array>
29
26
  <string>arm64</string>
27
+ <string>x86_64</string>
30
28
  </array>
31
29
  <key>SupportedPlatform</key>
32
30
  <string>ios</string>
31
+ <key>SupportedPlatformVariant</key>
32
+ <string>simulator</string>
33
33
  </dict>
34
34
  </array>
35
35
  <key>CFBundlePackageType</key>
@@ -14,7 +14,7 @@
14
14
  </data>
15
15
  <key>Info.plist</key>
16
16
  <data>
17
- C8MyQq+1X70fFHoZll4cue3nO+w=
17
+ lnnYD7r18hc09qUb74T6hGCkqIU=
18
18
  </data>
19
19
  <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
20
20
  <data>
@@ -5,6 +5,10 @@
5
5
 
6
6
  <application>
7
7
 
8
+ <activity
9
+ android:name="com.fireworksdk.bridge.reactnative.pages.FWContainerActivity"
10
+ />
11
+
8
12
  <provider
9
13
  android:authorities="${applicationId}.fwBridgeProvider"
10
14
  android:name="com.fireworksdk.bridge.FWInitializationProvider"
@@ -20,6 +20,7 @@ import com.fireworksdk.bridge.reactnative.utils.FWEventUtils
20
20
  import com.fireworksdk.bridge.utils.FWFragmentUtil
21
21
  import com.fireworksdk.bridge.utils.FWGlobalDataUtil
22
22
  import com.fireworksdk.bridge.utils.FWLogUtils
23
+ import com.fireworksdk.bridge.utils.FWStoryBlockUtil
23
24
  import org.json.JSONObject
24
25
 
25
26
 
@@ -189,7 +190,9 @@ class FWStoryBlockManager : ViewGroupManager<StoryBlockFrameLayout>() {
189
190
 
190
191
  fragment.setOnFullScreenStateChangedListener { isFullScreen ->
191
192
  if (isFullScreen) {
192
- FWGlobalDataUtil.storyBlockFragment = fragment
193
+ FWStoryBlockUtil.addFullScreenStoryBlockFragment(fragment)
194
+ } else {
195
+ FWStoryBlockUtil.removeFullScreenStoryBlockFragment(fragment)
193
196
  }
194
197
  FWEventUtils.receiveStoryBlockFullScreenStateChangedEvent(
195
198
  reactContext,
@@ -5,6 +5,8 @@ import com.facebook.react.bridge.ReadableMap
5
5
 
6
6
  interface FWNavigatorInterface {
7
7
 
8
+ fun pushRNContainer(props: ReadableMap?, promise: Promise)
9
+ fun popRNContainer(promise: Promise)
8
10
  fun popNativeContainer(promise: Promise)
9
11
  fun canPopNativeContainer(promise: Promise)
10
12
  fun startFloatingPlayer(promise: Promise)
@@ -5,14 +5,40 @@ import com.facebook.react.bridge.*
5
5
  import com.firework.sdk.FireworkSdk
6
6
  import com.fireworksdk.bridge.FWInitializationProvider
7
7
  import com.fireworksdk.bridge.reactnative.models.FWNavigatorInterface
8
- import com.fireworksdk.bridge.utils.FWGlobalDataUtil
8
+ import com.fireworksdk.bridge.reactnative.pages.FWContainerActivity
9
9
  import com.fireworksdk.bridge.utils.FWLogUtils
10
+ import com.fireworksdk.bridge.utils.FWStoryBlockUtil
10
11
 
11
12
 
12
13
  class FWNavigatorModule(
13
14
  reactContext: ReactApplicationContext
14
15
  ) : ReactContextBaseJavaModule(reactContext), FWNavigatorInterface {
15
16
 
17
+ @ReactMethod
18
+ override fun pushRNContainer(props: ReadableMap?, promise: Promise) {
19
+ val activity = FWInitializationProvider.INSTANCE.resumedActivity
20
+ if (activity == null) {
21
+ promise.resolve(false)
22
+ return
23
+ }
24
+
25
+ UiThreadUtil.runOnUiThread {
26
+ activity.startActivity(FWContainerActivity.createIntent(activity, props?.toHashMap()))
27
+ }
28
+ promise.resolve(true)
29
+ }
30
+
31
+ @ReactMethod
32
+ override fun popRNContainer(promise: Promise) {
33
+ val activity = FWInitializationProvider.INSTANCE.resumedActivity
34
+ if (activity is FWContainerActivity) {
35
+ activity.finish()
36
+ promise.resolve(true)
37
+ return
38
+ }
39
+ promise.resolve(false)
40
+ }
41
+
16
42
  @ReactMethod
17
43
  override fun popNativeContainer(promise: Promise) {
18
44
  FWLogUtils.d { "FWNavigatorModule popNativeContainer" }
@@ -23,23 +49,25 @@ class FWNavigatorModule(
23
49
  return
24
50
  }
25
51
 
26
- if (isTaskRoot(activity)) {
27
- if (FWGlobalDataUtil.storyBlockFragment?.isFullScreen() == true) {
28
- UiThreadUtil.runOnUiThread {
29
- FWGlobalDataUtil.storyBlockFragment?.toggleFullScreen()
30
- }
31
- promise.resolve(true)
32
- return
52
+ val currentStoryBlockFragment = FWStoryBlockUtil.getCurrentFullScreenStoryBlockFragment()
53
+ if (currentStoryBlockFragment?.activity == activity) {
54
+ UiThreadUtil.runOnUiThread {
55
+ currentStoryBlockFragment.toggleFullScreen()
33
56
  }
34
-
35
- promise.resolve(false)
57
+ promise.resolve(true)
36
58
  return
37
59
  }
38
60
 
39
- UiThreadUtil.runOnUiThread {
40
- activity.finish()
61
+ if (activity.javaClass.name.equals("com.firework.player.pager.PlayerActivity")) {
62
+ UiThreadUtil.runOnUiThread {
63
+ activity.finish()
64
+ }
65
+
66
+ promise.resolve(true)
67
+ return
41
68
  }
42
- promise.resolve(true)
69
+
70
+ promise.resolve(false)
43
71
  }
44
72
 
45
73
  @ReactMethod
@@ -201,7 +201,7 @@ class FWVideoShoppingModule(
201
201
  }
202
202
 
203
203
  if (!resultModel.tips.isNullOrBlank()) {
204
- Toast.makeText(currentActivity, resultModel.tips, Toast.LENGTH_LONG).show()
204
+ Toast.makeText(reactApplicationContext, resultModel.tips, Toast.LENGTH_LONG).show()
205
205
  }
206
206
  }
207
207
 
@@ -0,0 +1,61 @@
1
+ package com.fireworksdk.bridge.reactnative.pages
2
+
3
+ import android.app.Activity
4
+ import android.content.Intent
5
+ import android.os.Bundle
6
+ import com.facebook.react.ReactActivity
7
+ import com.facebook.react.ReactActivityDelegate
8
+ import com.fireworksdk.bridge.utils.FWBundleUtils
9
+
10
+
11
+ class FWContainerActivity : ReactActivity() {
12
+
13
+ override fun getMainComponentName(): String {
14
+ return ""
15
+ }
16
+
17
+ override fun createReactActivityDelegate(): ReactActivityDelegate {
18
+ return FWContainerActivityDelegate(this, mainComponentName)
19
+ }
20
+
21
+ // https://cmichel.io/how-to-set-initial-props-in-react-native
22
+ class FWContainerActivityDelegate(
23
+ private val mActivity: ReactActivity,
24
+ mainComponentName: String?
25
+ ) :
26
+ ReactActivityDelegate(mActivity, mainComponentName) {
27
+ private var mInitialProps: Bundle? = null
28
+ override fun onCreate(savedInstanceState: Bundle?) {
29
+
30
+ val params = mActivity.intent.getSerializableExtra(KEY_PARAMS) as HashMap<String, Any?>?
31
+ mInitialProps = FWBundleUtils.mapToBundle(params)
32
+
33
+ super.onCreate(savedInstanceState)
34
+ }
35
+
36
+ override fun getMainComponentName(): String? {
37
+ val bundle = mActivity.intent.extras
38
+ return bundle?.getString(KEY_COMPONENT_NAME)
39
+ }
40
+
41
+ override fun getLaunchOptions(): Bundle? {
42
+ return mInitialProps
43
+ }
44
+ }
45
+
46
+ companion object {
47
+
48
+ private const val KEY_PARAMS = "params"
49
+ private const val KEY_COMPONENT_NAME = "componentName"
50
+
51
+ @Suppress("UNCHECKED_CAST")
52
+ fun createIntent(activity: Activity, params: HashMap<String, Any?>?): Intent {
53
+ val intent = Intent(activity, FWContainerActivity::class.java)
54
+ intent.putExtra(KEY_COMPONENT_NAME, params?.get("appKey") as String?)
55
+ intent.putExtra(KEY_PARAMS, params?.get("appProps") as HashMap<String, Any?>)
56
+ intent.flags = Intent.FLAG_ACTIVITY_NO_ANIMATION
57
+ activity.overridePendingTransition(0, 0)
58
+ return intent
59
+ }
60
+ }
61
+ }
@@ -373,6 +373,7 @@ object FWConfigUtil {
373
373
 
374
374
  private fun getDefaultPlayerOptionBuilder(): PlayerOption.Builder {
375
375
  return PlayerOption.Builder()
376
+ .enablePipMode(false)
376
377
  }
377
378
 
378
379
  private fun getDefaultBaseOptionBuilder(): BaseOption.Builder {
@@ -14,7 +14,5 @@ object FWGlobalDataUtil {
14
14
 
15
15
  var customClickLinkButtonEnabled: Boolean = false
16
16
 
17
- var storyBlockFragment by weakProperty<StoryBlockFragment?>()
18
-
19
17
  var shareBaseUrl: String? = null
20
18
  }
@@ -0,0 +1,30 @@
1
+ package com.fireworksdk.bridge.utils
2
+
3
+ import com.fireworksdk.bridge.components.storyblock.StoryBlockFragment
4
+
5
+ object FWStoryBlockUtil {
6
+
7
+ private val list = ArrayList<StoryBlockFragment>()
8
+
9
+ fun getCurrentFullScreenStoryBlockFragment(): StoryBlockFragment? {
10
+ while (list.size > 0) {
11
+ val fragment = list.last()
12
+ if (!fragment.isFullScreen()) {
13
+ list.removeLast()
14
+ } else {
15
+ return fragment
16
+ }
17
+ }
18
+ return null
19
+ }
20
+
21
+ fun addFullScreenStoryBlockFragment(fragment: StoryBlockFragment?) {
22
+ fragment ?: return
23
+ list.add(fragment)
24
+ }
25
+
26
+ fun removeFullScreenStoryBlockFragment(fragment: StoryBlockFragment?) {
27
+ fragment ?: return
28
+ list.remove(fragment)
29
+ }
30
+ }
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <FrameLayout
3
+ xmlns:android="http://schemas.android.com/apk/res/android"
4
+ android:id="@+id/fw_bridge_container"
5
+ android:layout_width="match_parent"
6
+ android:layout_height="match_parent">
7
+
8
+ </FrameLayout>
@@ -7,6 +7,9 @@
7
7
  objects = {
8
8
 
9
9
  /* Begin PBXBuildFile section */
10
+ 891F4AF62A67E12800A9E8DA /* FWRNContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 891F4AF52A67E12800A9E8DA /* FWRNContainerViewController.swift */; };
11
+ 891F4AF82A68DEDF00A9E8DA /* PushRNContainerParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = 891F4AF72A68DEDF00A9E8DA /* PushRNContainerParams.swift */; };
12
+ 891F4AFA2A68DF2B00A9E8DA /* RCTConvert+FWNavigatorModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 891F4AF92A68DF2B00A9E8DA /* RCTConvert+FWNavigatorModule.swift */; };
10
13
  897523872817DEF80070EBB6 /* (null) in Sources */ = {isa = PBXBuildFile; };
11
14
  897523882817DEF80070EBB6 /* (null) in Sources */ = {isa = PBXBuildFile; };
12
15
  897523892817DEF80070EBB6 /* (null) in Sources */ = {isa = PBXBuildFile; };
@@ -89,6 +92,9 @@
89
92
 
90
93
  /* Begin PBXFileReference section */
91
94
  1F6F718A2771B48100224AF3 /* FireworkSdk-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "FireworkSdk-Bridging-Header.h"; sourceTree = "<group>"; };
95
+ 891F4AF52A67E12800A9E8DA /* FWRNContainerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FWRNContainerViewController.swift; sourceTree = "<group>"; };
96
+ 891F4AF72A68DEDF00A9E8DA /* PushRNContainerParams.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushRNContainerParams.swift; sourceTree = "<group>"; };
97
+ 891F4AF92A68DF2B00A9E8DA /* RCTConvert+FWNavigatorModule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RCTConvert+FWNavigatorModule.swift"; sourceTree = "<group>"; };
92
98
  894FADB229BAD571000FB51A /* libFireworkSdk.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFireworkSdk.a; sourceTree = BUILT_PRODUCTS_DIR; };
93
99
  897523632817DEF80070EBB6 /* react_native_firework_sdk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = react_native_firework_sdk.h; sourceTree = "<group>"; };
94
100
  898873132A0A8E7E0089CD1C /* UIViewController+AttachChild.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+AttachChild.swift"; sourceTree = "<group>"; };
@@ -187,6 +193,8 @@
187
193
  children = (
188
194
  8988731D2A0A8E7E0089CD1C /* FWNavigatorModule.swift */,
189
195
  8988731E2A0A8E7E0089CD1C /* FWNavigatorModule.m */,
196
+ 891F4AF52A67E12800A9E8DA /* FWRNContainerViewController.swift */,
197
+ 891F4AF72A68DEDF00A9E8DA /* PushRNContainerParams.swift */,
190
198
  );
191
199
  path = FWNavigatorModule;
192
200
  sourceTree = "<group>";
@@ -251,6 +259,7 @@
251
259
  898873362A0A8E7E0089CD1C /* RCTConvert+FireworkSDKModule.swift */,
252
260
  898873372A0A8E7E0089CD1C /* RCTConvert+Shopping.swift */,
253
261
  898873382A0A8E7E0089CD1C /* RCTConvert+VideoFeed.swift */,
262
+ 891F4AF92A68DF2B00A9E8DA /* RCTConvert+FWNavigatorModule.swift */,
254
263
  );
255
264
  path = RNToNative;
256
265
  sourceTree = "<group>";
@@ -377,6 +386,7 @@
377
386
  897523902817DEF80070EBB6 /* (null) in Sources */,
378
387
  8988736D2A0A8E7E0089CD1C /* VideoFeedManager.m in Sources */,
379
388
  8988735A2A0A8E7E0089CD1C /* FireworkSDKModule+CTA.swift in Sources */,
389
+ 891F4AFA2A68DF2B00A9E8DA /* RCTConvert+FWNavigatorModule.swift in Sources */,
380
390
  898873472A0A8E7E0089CD1C /* UIView+Constraints.swift in Sources */,
381
391
  897523882817DEF80070EBB6 /* (null) in Sources */,
382
392
  897523982817DEF80070EBB6 /* (null) in Sources */,
@@ -394,10 +404,12 @@
394
404
  8975238D2817DEF80070EBB6 /* (null) in Sources */,
395
405
  8975238C2817DEF80070EBB6 /* (null) in Sources */,
396
406
  8988736B2A0A8E7E0089CD1C /* VideoFeed.swift in Sources */,
407
+ 891F4AF62A67E12800A9E8DA /* FWRNContainerViewController.swift in Sources */,
397
408
  898873522A0A8E7E0089CD1C /* ShoppingCTAResult.swift in Sources */,
398
409
  8975239D2817DEF80070EBB6 /* (null) in Sources */,
399
410
  898873562A0A8E7E0089CD1C /* SDKInitOptions.swift in Sources */,
400
411
  89DF27DE28A53A77003F3CCB /* (null) in Sources */,
412
+ 891F4AF82A68DEDF00A9E8DA /* PushRNContainerParams.swift in Sources */,
401
413
  897523892817DEF80070EBB6 /* (null) in Sources */,
402
414
  897523912817DEF80070EBB6 /* (null) in Sources */,
403
415
  8975238F2817DEF80070EBB6 /* (null) in Sources */,
@@ -0,0 +1,21 @@
1
+ //
2
+ // RCTConvert+FWNavigatorModule.swift
3
+ // FireworkSdk
4
+ //
5
+ // Created by linjie jiang on 7/20/23.
6
+ //
7
+
8
+ import Foundation
9
+
10
+ extension RCTConvert {
11
+ static func pushRNContainerParams(_ json: [String: Any]) -> PushRNContainerParams? {
12
+ if let appKey = json["appKey"] as? String {
13
+ let params = PushRNContainerParams()
14
+ params.appKey = appKey
15
+ params.appProps = json["appProps"] as? [String: Any]
16
+
17
+ return params
18
+ }
19
+ return nil
20
+ }
21
+ }
@@ -10,15 +10,6 @@ import Foundation
10
10
  import UIKit
11
11
 
12
12
  extension RCTConvert {
13
- static func videoPlayerContentConfiguration(_ config: [String: AnyObject])
14
- -> VideoPlayerContentConfiguration? {
15
- let videoPlayerConfig = RCTConvert.videoPlayerConfiguration(config)
16
-
17
- let finalConfig = VideoFeed.convertToVideoPlayerContentConfiguration(videoPlayerConfig)
18
-
19
- return finalConfig
20
- }
21
-
22
13
  static func videoPlayerStyle(_ style: String?) -> VideoPlayerContentConfiguration
23
14
  .VideoPlayerStyle? {
24
15
  guard let rStyle = style else {
@@ -43,25 +34,7 @@ extension RCTConvert {
43
34
  }
44
35
  }
45
36
 
46
- static func ctaButtonStyle(_ style: [String: AnyObject]?) -> ButtonContentConfiguration? {
47
- guard let rStyle = style else {
48
- return nil
49
- }
50
- var btnContentConfig = ButtonContentConfiguration()
51
- if let backgroundColor = rStyle["backgroundColor"] as? String {
52
- btnContentConfig.backgroundColor = backgroundColor.uicolor()
53
- }
54
- if let textColor = rStyle["textColor"] as? String {
55
- btnContentConfig.textColor = textColor.uicolor()
56
- }
57
- if let fontSize = rStyle["fontSize"] as? Double {
58
- btnContentConfig.font = UIFont.systemFont(ofSize: fontSize)
59
- }
60
-
61
- return btnContentConfig
62
- }
63
-
64
- static func adBadgeConfiguration(_ config: [String: AnyObject]?) -> AdBadgeConfiguration? {
37
+ static func adBadgeConfiguration(_ config: [String: Any]?) -> AdBadgeConfiguration? {
65
38
  guard let rConfig = config else {
66
39
  return nil
67
40
  }
@@ -81,7 +54,7 @@ extension RCTConvert {
81
54
  return result
82
55
  }
83
56
 
84
- static func trackPurchaseParameters(_ parameters: [String: AnyObject]?)
57
+ static func trackPurchaseParameters(_ parameters: [String: Any]?)
85
58
  -> TrackPurchaseParameters? {
86
59
  guard let rParameters = parameters else {
87
60
  return nil
@@ -103,7 +76,7 @@ extension RCTConvert {
103
76
  return result
104
77
  }
105
78
 
106
- static func sdkInitOptions(_ options: [String: AnyObject]?) -> SDKInitOptions? {
79
+ static func sdkInitOptions(_ options: [String: Any]?) -> SDKInitOptions? {
107
80
  guard let rOptions = options else {
108
81
  return nil
109
82
  }
@@ -30,9 +30,9 @@ extension RCTConvert {
30
30
  return StoryBlockSourceType.sourceTypeMapper[rType] ?? .discover
31
31
  }
32
32
 
33
- public static func storyBlockConfiguration(_ config: [String: AnyObject]?)
33
+ public static func storyBlockConfiguration(_ config: NSDictionary?)
34
34
  -> StoryBlockConfiguration? {
35
- guard let rConfig = config else {
35
+ guard let rConfig = config as? [String: Any] else {
36
36
  return nil
37
37
  }
38
38
 
@@ -50,9 +50,9 @@ extension RCTConvert {
50
50
  return VideoFeedMode.feedModeMapper[rType] ?? .row
51
51
  }
52
52
 
53
- public static func videoFeedConfiguration(_ config: [String: AnyObject]?)
53
+ public static func videoFeedConfiguration(_ config: NSDictionary?)
54
54
  -> VideoFeedConfiguration? {
55
- guard let rConfig = config else {
55
+ guard let rConfig = config as? [String: Any] else {
56
56
  return nil
57
57
  }
58
58
 
@@ -64,7 +64,7 @@ extension RCTConvert {
64
64
  return try? JSONDecoder().decode(VideoFeedConfiguration.self, from: rJsonData)
65
65
  }
66
66
 
67
- public static func videoPlayerConfiguration(_ config: [String: AnyObject]?)
67
+ public static func videoPlayerConfiguration(_ config: [String: Any]?)
68
68
  -> VideoPlayerConfiguration? {
69
69
  guard let rConfig = config else {
70
70
  return nil
@@ -78,8 +78,8 @@ extension RCTConvert {
78
78
  return try? JSONDecoder().decode(VideoPlayerConfiguration.self, from: rJsonData)
79
79
  }
80
80
 
81
- public static func adConfiguration(_ config: [String: AnyObject]?) -> AdConfiguration? {
82
- guard let rConfig = config else {
81
+ public static func adConfiguration(_ config: NSDictionary?) -> AdConfiguration? {
82
+ guard let rConfig = config as? [String: Any] else {
83
83
  return nil
84
84
  }
85
85
 
@@ -11,9 +11,9 @@
11
11
 
12
12
  @interface RCT_EXTERN_REMAP_MODULE(FWNavigatorModule, FWNavigatorModule, NSObject)
13
13
 
14
- RCT_EXTERN_METHOD(pushNativeContainer:(NSDictionary *)props resolver:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
14
+ RCT_EXTERN_METHOD(pushRNContainer:(NSDictionary *)params resolver:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
15
+ RCT_EXTERN_METHOD(popRNContainer:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
15
16
  RCT_EXTERN_METHOD(popNativeContainer:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
16
- RCT_EXTERN_METHOD(canPopNativeContainer:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
17
17
  RCT_EXTERN_METHOD(startFloatingPlayer:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
18
18
  RCT_EXTERN_METHOD(stopFloatingPlayer:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
19
19
 
@@ -5,6 +5,7 @@
5
5
  // Created by Big Bear Xiong on 2022/4/21.
6
6
  //
7
7
 
8
+ import UIKit
8
9
  import FireworkVideo
9
10
 
10
11
  private struct PlayerExitButtonInfo {
@@ -29,6 +30,61 @@ class FWNavigatorModule: RCTEventEmitter {
29
30
  return DispatchQueue.main
30
31
  }
31
32
 
33
+ @objc(pushRNContainer:resolver:rejecter:)
34
+ func pushRNContainer(
35
+ _ params: NSDictionary?,
36
+ resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock
37
+ ) {
38
+ guard let presentedVC = RCTPresentedViewController() else {
39
+ resolver(false)
40
+ return
41
+ }
42
+
43
+ guard let params = params as? [String: Any] else {
44
+ resolver(false)
45
+ return
46
+ }
47
+
48
+ guard let pushRNContainerParams = RCTConvert.pushRNContainerParams(params) else {
49
+ resolver(false)
50
+ return
51
+ }
52
+
53
+ guard let appKey = pushRNContainerParams.appKey, appKey.count > 0 else {
54
+ resolver(false)
55
+ return
56
+ }
57
+
58
+ let containerViewController = FWRNContainerViewController()
59
+ containerViewController.appKey = appKey
60
+ containerViewController.appProps = pushRNContainerParams.appProps ?? [:]
61
+ containerViewController.modalPresentationStyle = .fullScreen
62
+
63
+ // if presentedVC.modalPresentationStyle == .custom,
64
+ // let presentingVC = presentedVC.presentingViewController,
65
+ // presentingVC is FireworkVideo.PlayerViewController {
66
+ // containerViewController.modalPresentationStyle = .overFullScreen
67
+ // }
68
+
69
+ presentedVC.present(containerViewController, animated: true) {
70
+ resolver(true)
71
+ }
72
+ }
73
+
74
+ @objc(popRNContainer:rejecter:)
75
+ func popRNContainer(
76
+ _ resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock
77
+ ) {
78
+ if let containerVC = RCTPresentedViewController() as? FWRNContainerViewController,
79
+ containerVC.presentingViewController != nil {
80
+ containerVC.dismiss(animated: true) {
81
+ resolver(true)
82
+ }
83
+ } else {
84
+ resolver(false)
85
+ }
86
+ }
87
+
32
88
  @objc(popNativeContainer:rejecter:)
33
89
  func popNativeContainer(
34
90
  _ resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock
@@ -54,9 +110,9 @@ class FWNavigatorModule: RCTEventEmitter {
54
110
  }
55
111
  }
56
112
  }
57
- } else if let rootVC = RCTKeyWindow()?.rootViewController,
58
- let presentedVC = rootVC.presentedViewController,
59
- FWNavigatorModule.isIOSSDKViewController(presentedVC) {
113
+ } else if let presentedVC = RCTPresentedViewController(),
114
+ FWNavigatorModule.isIOSSDKViewController(presentedVC),
115
+ presentedVC.presentingViewController == RCTKeyWindow()?.rootViewController {
60
116
  if let buttonInfo = FWNavigatorModule.getPlayerExitButtonInfo(view: presentedVC.view) {
61
117
  if buttonInfo.type == .close {
62
118
  buttonInfo.button.sendActions(for: .touchUpInside)
@@ -121,7 +177,6 @@ extension FWNavigatorModule {
121
177
 
122
178
  private static func getPlayerExitButtonInfo(view: UIView) -> PlayerExitButtonInfo? {
123
179
  if let button = view as? UIButton, let image = button.image(for: .normal) {
124
- let iOSSDKBundle = Bundle(for: FireworkVideoSDK.self)
125
180
  if isTargetIOSSDKImage(image, targetImageName: "closeX") {
126
181
  return PlayerExitButtonInfo(button: button, type: .close)
127
182
  }
@@ -0,0 +1,33 @@
1
+ //
2
+ // FWRNContainerViewController.swift
3
+ // FireworkSdk
4
+ //
5
+ // Created by linjie jiang on 7/19/23.
6
+ // Copyright © 2023 Facebook. All rights reserved.
7
+ //
8
+
9
+ import UIKit
10
+
11
+ class FWRNContainerViewController: UIViewController {
12
+ var appKey: String = ""
13
+ var appProps: [String: Any] = [:]
14
+
15
+ override func viewDidLoad() {
16
+ super.viewDidLoad()
17
+ loadContent()
18
+ }
19
+
20
+ private func loadContent() {
21
+ let rctRootView = RCTRootView.init(
22
+ bridge: RCTBridge.current(), moduleName: appKey, initialProperties: appProps)
23
+ view.addSubview(rctRootView)
24
+ rctRootView.translatesAutoresizingMaskIntoConstraints = false
25
+
26
+ NSLayoutConstraint.activate([
27
+ rctRootView.leftAnchor.constraint(equalTo: view.leftAnchor),
28
+ rctRootView.topAnchor.constraint(equalTo: view.topAnchor),
29
+ rctRootView.rightAnchor.constraint(equalTo: view.rightAnchor),
30
+ rctRootView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
31
+ ])
32
+ }
33
+ }
@@ -0,0 +1,14 @@
1
+ //
2
+ // PushRNContainerParams.swift
3
+ // FireworkSdk
4
+ //
5
+ // Created by linjie jiang on 7/20/23.
6
+ // Copyright © 2023 Facebook. All rights reserved.
7
+ //
8
+
9
+ import Foundation
10
+
11
+ class PushRNContainerParams {
12
+ var appKey: String?
13
+ var appProps: [String: Any]?
14
+ }
@@ -45,7 +45,7 @@ class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
45
45
 
46
46
  @objc(initializeSDK:resolver:rejecter:)
47
47
  func initializeSDK(
48
- _ options: [String: AnyObject]? = nil,
48
+ _ options: NSDictionary? = nil,
49
49
  resolver: RCTPromiseResolveBlock,
50
50
  rejecter: RCTPromiseRejectBlock
51
51
  ) {
@@ -70,7 +70,10 @@ class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
70
70
 
71
71
  sendEvent(withName: FWEventName.logMessage.rawValue, body: ["message": message])
72
72
  #endif
73
- let sdkInitOptions = RCTConvert.sdkInitOptions(options)
73
+ var sdkInitOptions: SDKInitOptions?
74
+ if let options = options as? [String: Any] {
75
+ sdkInitOptions = RCTConvert.sdkInitOptions(options)
76
+ }
74
77
  gVideoLaunchBehavior = sdkInitOptions?.videoLaunchBehavior
75
78
 
76
79
  FireworkVideoSDK.initializeSDK(delegate: self, userID: sdkInitOptions?.userId)
@@ -81,20 +84,25 @@ class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
81
84
  }
82
85
 
83
86
  @objc(openVideoPlayer:config:)
84
- func openVideoPlayer(_ url: String, config: [String: AnyObject]) {
87
+ func openVideoPlayer(_ url: String, config: NSDictionary?) {
85
88
  guard let urlString = URL.init(string: url) else {
86
89
  return
87
90
  }
88
- let videoPlayerConfig = RCTConvert.videoPlayerConfiguration(config)
89
- let vpcConfig = VideoFeed.convertToVideoPlayerContentConfiguration(videoPlayerConfig)
90
91
 
92
+ var enablePictureInPicture: Bool?
91
93
  var feedContentConfig = VideoFeedContentConfiguration()
92
- if let vpcConfig = vpcConfig {
93
- feedContentConfig.playerView = vpcConfig
94
- }
94
+ if let config = config as? [String: Any] {
95
+ let videoPlayerConfig = RCTConvert.videoPlayerConfiguration(config)
96
+ enablePictureInPicture = videoPlayerConfig?.enablePictureInPicture
97
+ let vpcConfig = VideoFeed.convertToVideoPlayerContentConfiguration(videoPlayerConfig)
98
+
99
+ if let vpcConfig = vpcConfig {
100
+ feedContentConfig.playerView = vpcConfig
101
+ }
95
102
 
96
- if let adBadge = FireworkSDKModule.convertToFWAdBadgeConfiguration(gAdBadgeConfiguration) {
97
- feedContentConfig.adBadge = adBadge
103
+ if let adBadge = FireworkSDKModule.convertToFWAdBadgeConfiguration(gAdBadgeConfiguration) {
104
+ feedContentConfig.adBadge = adBadge
105
+ }
98
106
  }
99
107
 
100
108
  guard let presentedVC = RCTPresentedViewController() else {
@@ -105,11 +113,11 @@ class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
105
113
  with: urlString,
106
114
  feedContentConfig,
107
115
  presentedVC,
108
- videoPlayerConfig?.enablePictureInPicture ?? true) { _ in
116
+ enablePictureInPicture ?? false) { _ in
109
117
 
110
118
  }
111
119
  }
112
-
120
+
113
121
  @objc(setVideoFeedClickCallbackEnabled:)
114
122
  func setVideoFeedClickCallbackEnabled(_ enabled: Bool) {
115
123
  if enabled {
@@ -137,15 +145,23 @@ class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
137
145
 
138
146
  @objc(setAdBadgeConfiguration:resolver:rejecter:)
139
147
  func setAdBadgeConfiguration(
140
- _ config: [String: AnyObject]? = nil, resolver: RCTPromiseResolveBlock,
148
+ _ config: NSDictionary? = nil, resolver: RCTPromiseResolveBlock,
141
149
  rejecter: RCTPromiseRejectBlock
142
150
  ) {
151
+ guard let config = config as? [String: Any] else {
152
+ resolver([:])
153
+ return
154
+ }
143
155
  gAdBadgeConfiguration = RCTConvert.adBadgeConfiguration(config)
144
156
  resolver([:])
145
157
  }
146
158
 
147
159
  @objc(trackPurchase:)
148
- func trackPurchase(_ parameters: [String: AnyObject]?) {
160
+ func trackPurchase(_ parameters: NSDictionary?) {
161
+ guard let parameters = parameters as? [String: Any] else {
162
+ return
163
+ }
164
+
149
165
  guard let trackPurchaseParameters = RCTConvert.trackPurchaseParameters(parameters) else {
150
166
  #if DEBUG
151
167
  let formatter = DateFormatter()
@@ -36,6 +36,27 @@ class FWNavigator {
36
36
 
37
37
  _FWNavigatorModule.FWNavigatorModuleEventEmitter.addListener(_FWEventName.FWEventName.LogMessage, () => {});
38
38
  }
39
+ /**
40
+ * Push a new RN container.
41
+ * You could use this method to make a RN page on top of
42
+ * SDK full-screen player.
43
+ * @param params {PushRNContainerParams}
44
+ * @returns {Promise<boolean>} The result of pushing a new Container.
45
+ */
46
+
47
+
48
+ pushRNContainer(params) {
49
+ return _FWNavigatorModule.default.pushRNContainer(params);
50
+ }
51
+ /**
52
+ * Pop the RN container you pushed before.
53
+ * @returns {Promise<boolean>} The result of popping a new Container.
54
+ */
55
+
56
+
57
+ popRNContainer() {
58
+ return _FWNavigatorModule.default.popRNContainer();
59
+ }
39
60
  /**
40
61
  * Pop the native container. You could use the method to close the fullscreen player.
41
62
  * But if the enablePictureInPicture of the associated video feed is true,
@@ -1 +1 @@
1
- {"version":3,"sources":["FWNavigator.ts"],"names":["FWNavigator","getInstance","_instance","constructor","FWLoggerUtil","log","FWNavigatorModuleEventEmitter","addListener","FWEventName","LogMessage","popNativeContainer","FWNavigatorModule","startFloatingPlayer","stopFloatingPlayer"],"mappings":";;;;;;;AAAA;;AACA;;AAGA;;;;;;;;;;AAEA;AACA;AACA;AACA,MAAMA,WAAN,CAAkB;AAGS,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;AACpBC,0BAAaC,GAAb,CAAiB,yBAAjB;;AACAC,qDAA8BC,WAA9B,CAA0CC,yBAAYC,UAAtD,EAAkE,MAAM,CAAE,CAA1E;AACD;AAED;AACF;AACA;AACA;AACA;AACA;;;AACSC,EAAAA,kBAAkB,GAAqB;AAC5C,WAAOC,2BAAkBD,kBAAlB,EAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACkC,QAAnBE,mBAAmB,GAAqB;AACnD,WAAOD,2BAAkBC,mBAAlB,EAAP;AACD;AAED;AACF;AACA;;;AACiC,QAAlBC,kBAAkB,GAAkB;AAC/C,UAAMF,2BAAkBE,kBAAlB,EAAN;AACD;;AAvCe;;gBAAZb,W;;eA0CSA,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\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 FWLoggerUtil.log('FWNavigator constructor');\n FWNavigatorModuleEventEmitter.addListener(FWEventName.LogMessage, () => {});\n }\n\n /**\n * Pop the native container. You could use the method to close the fullscreen player.\n * But if the enablePictureInPicture of the associated video feed is true,\n * we can't close the fullscreen player.\n * @returns {Promise<boolean>} The result of popping the native container.\n */\n public popNativeContainer(): Promise<boolean> {\n return FWNavigatorModule.popNativeContainer();\n }\n\n /**\n * Change current fullscreen player to floating player.\n * @returns {Promise<boolean>} If the result is true, it means that the fullscreen\n * player is changed to floating player.\n */\n public async startFloatingPlayer(): Promise<boolean> {\n return FWNavigatorModule.startFloatingPlayer();\n }\n\n /**\n * Stop current floating player.\n */\n public async stopFloatingPlayer(): Promise<void> {\n await FWNavigatorModule.stopFloatingPlayer();\n }\n}\n\nexport default FWNavigator;\n"]}
1
+ {"version":3,"sources":["FWNavigator.ts"],"names":["FWNavigator","getInstance","_instance","constructor","FWLoggerUtil","log","FWNavigatorModuleEventEmitter","addListener","FWEventName","LogMessage","pushRNContainer","params","FWNavigatorModule","popRNContainer","popNativeContainer","startFloatingPlayer","stopFloatingPlayer"],"mappings":";;;;;;;AAAA;;AAEA;;AAGA;;;;;;;;;;AAEA;AACA;AACA;AACA,MAAMA,WAAN,CAAkB;AAGS,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;AACpBC,0BAAaC,GAAb,CAAiB,yBAAjB;;AACAC,qDAA8BC,WAA9B,CAA0CC,yBAAYC,UAAtD,EAAkE,MAAM,CAAE,CAA1E;AACD;AAED;AACF;AACA;AACA;AACA;AACA;AACA;;;AACSC,EAAAA,eAAe,CAACC,MAAD,EAAkD;AACtE,WAAOC,2BAAkBF,eAAlB,CAAkCC,MAAlC,CAAP;AACD;AAED;AACF;AACA;AACA;;;AACSE,EAAAA,cAAc,GAAqB;AACxC,WAAOD,2BAAkBC,cAAlB,EAAP;AACD;AAED;AACF;AACA;AACA;AACA;AACA;;;AACSC,EAAAA,kBAAkB,GAAqB;AAC5C,WAAOF,2BAAkBE,kBAAlB,EAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACkC,QAAnBC,mBAAmB,GAAqB;AACnD,WAAOH,2BAAkBG,mBAAlB,EAAP;AACD;AAED;AACF;AACA;;;AACiC,QAAlBC,kBAAkB,GAAkB;AAC/C,UAAMJ,2BAAkBI,kBAAlB,EAAN;AACD;;AA1De;;gBAAZhB,W;;eA6DSA,W","sourcesContent":["import { FWEventName } from './models/FWEventName';\nimport type PushRNContainerParams from './models/PushRNContainerParams';\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\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 FWLoggerUtil.log('FWNavigator constructor');\n FWNavigatorModuleEventEmitter.addListener(FWEventName.LogMessage, () => {});\n }\n\n /**\n * Push a new RN container.\n * You could use this method to make a RN page on top of\n * SDK full-screen player.\n * @param params {PushRNContainerParams}\n * @returns {Promise<boolean>} The result of pushing a new Container.\n */\n public pushRNContainer(params: PushRNContainerParams): Promise<boolean> {\n return FWNavigatorModule.pushRNContainer(params);\n }\n\n /**\n * Pop the RN container you pushed before.\n * @returns {Promise<boolean>} The result of popping a new Container.\n */\n public popRNContainer(): Promise<boolean> {\n return FWNavigatorModule.popRNContainer();\n }\n\n /**\n * Pop the native container. You could use the method to close the fullscreen player.\n * But if the enablePictureInPicture of the associated video feed is true,\n * we can't close the fullscreen player.\n * @returns {Promise<boolean>} The result of popping the native container.\n */\n public popNativeContainer(): Promise<boolean> {\n return FWNavigatorModule.popNativeContainer();\n }\n\n /**\n * Change current fullscreen player to floating player.\n * @returns {Promise<boolean>} If the result is true, it means that the fullscreen\n * player is changed to floating player.\n */\n public async startFloatingPlayer(): Promise<boolean> {\n return FWNavigatorModule.startFloatingPlayer();\n }\n\n /**\n * Stop current floating player.\n */\n public async stopFloatingPlayer(): Promise<void> {\n await FWNavigatorModule.stopFloatingPlayer();\n }\n}\n\nexport default FWNavigator;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["FireworkSDK"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAEA;;AAOA;;AACA;;AAKA;;AA0BA;;AAEA;;AA4BA;;AAgBA;;;;eAEeA,oB","sourcesContent":["import type {\n IStoryBlockMethods,\n IStoryBlockProps,\n} from './components/StoryBlock';\nimport StoryBlock from './components/StoryBlock';\nimport type { IVideoFeedProps, VideoFeedMode } from './components/VideoFeed';\nimport VideoFeed from './components/VideoFeed';\nimport type {\n CustomCTAClickCallback,\n SDKInitCallback,\n VideoFeedClickCallback,\n VideoPlaybackCallback,\n} from './FireworkSDK';\nimport FireworkSDK from './FireworkSDK';\nimport FWNavigator from './FWNavigator';\nimport type {\n onLiveStreamChatEventCallback,\n onLiveStreamEventCallback,\n} from './LiveStream';\nimport LiveStream from './LiveStream';\nimport type AdBadgeConfiguration from './models/AdBadgeConfiguration';\nimport type { AdBadgeTextType } from './models/AdBadgeConfiguration';\nimport type AdConfiguration from './models/AdConfiguration';\nimport type { VastAttribute } from './models/AdConfiguration';\nimport type AndroidFontInfo from './models/AndroidFontInfo';\nimport type FeedItemDetails from './models/FeedItemDetails';\nimport type FWError from './models/FWError';\nimport type {\n CustomClickLinkButtonEvent,\n CustomCTAClickEvent,\n LiveStreamChatEvent,\n LiveStreamEvent,\n SDKInitEvent,\n ShoppingCTAEvent,\n UpdateProductDetailsEvent,\n VideoFeedClickEvent,\n VideoPlaybackEvent,\n} from './models/FWEvents';\nimport type GradientDrawable from './models/GradientDrawable';\nimport type { GradientDrawableOrientation } from './models/GradientDrawable';\nimport type IOSFontInfo from './models/IOSFontInfo';\nimport type {\n IOSSystemFontStyle,\n IOSSystemFontWeight,\n} from './models/IOSFontInfo';\nimport LiveStreamChatEventName from './models/LiveStreamChatEventName';\nimport type LiveStreamEventDetails from './models/LiveStreamEventDetails';\nimport LiveStreamEventName from './models/LiveStreamEventName';\nimport type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';\nimport type OpenVideoPlayerConfiguration from './models/OpenVideoPlayerConfiguration';\nimport type Product from './models/Product';\nimport type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';\nimport type {\n LinkButtonConfiguration,\n ShoppingCTAButtonConfiguration,\n ShoppingCTAButtonText,\n} from './models/ProductInfoViewConfiguration';\nimport type ProductUnit from './models/ProductUnit';\nimport type { ProductPrice, ProductUnitOption } from './models/ProductUnit';\nimport type SDKInitOptions from './models/SDKInitOptions';\nimport type { VideoLaunchBehavior } from './models/SDKInitOptions';\nimport type ShoppingCTAResult from './models/ShoppingCTAResult';\nimport type { StoryBlockConfiguration } from './models/StoryBlockConfiguration';\nimport type { StoryBlockSource } from './models/StoryBlockSource';\nimport type TrackPurchaseParameters from './models/TrackPurchaseParameters';\nimport type VideoFeedConfiguration from './models/VideoFeedConfiguration';\nimport type {\n VideoFeedPadding,\n VideoFeedPlayIconConfiguration,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n} from './models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from './models/VideoFeedSource';\nimport type VideoPlaybackDetails from './models/VideoPlaybackDetails';\nimport type { VideoPlayerSize } from './models/VideoPlaybackDetails';\nimport VideoPlaybackEventName from './models/VideoPlaybackEventName';\nimport type { VideoPlayerCompleteAction } from './models/VideoPlayerCompleteAction';\nimport type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport type {\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n} from './models/VideoPlayerCTADelay';\nimport type { VideoPlayerCTAStyle } from './models/VideoPlayerCTAStyle';\nimport type { VideoPlayerCTAWidth } from './models/VideoPlayerCTAWidth';\nimport type { VideoPlayerStyle } from './models/VideoPlayerStyle';\nimport type {\n CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n ShoppingCTACallback,\n UpdateProductDetailsCallback,\n} from './VideoShopping';\nimport VideoShopping from './VideoShopping';\n\nexport default FireworkSDK;\n\nexport {\n AdBadgeConfiguration,\n AdBadgeTextType,\n AdConfiguration,\n AndroidFontInfo,\n CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n CustomClickLinkButtonEvent,\n CustomCTAClickCallback,\n CustomCTAClickEvent,\n FeedItemDetails,\n FireworkSDK,\n FWError,\n FWNavigator,\n GradientDrawable,\n GradientDrawableOrientation,\n IOSFontInfo,\n IOSSystemFontStyle,\n IOSSystemFontWeight,\n IStoryBlockMethods,\n IStoryBlockProps,\n IVideoFeedProps,\n LinkButtonConfiguration,\n LiveStream,\n LiveStreamChatEvent,\n LiveStreamChatEventName,\n LiveStreamEvent,\n LiveStreamEventDetails,\n LiveStreamEventName,\n LiveStreamMessageDetails,\n onLiveStreamChatEventCallback,\n onLiveStreamEventCallback,\n OpenVideoPlayerConfiguration,\n Product,\n ProductInfoViewConfiguration,\n ProductPrice,\n ProductUnit,\n ProductUnitOption,\n SDKInitCallback,\n SDKInitEvent,\n SDKInitOptions,\n ShoppingCTAButtonConfiguration,\n ShoppingCTAButtonText,\n ShoppingCTACallback,\n ShoppingCTAEvent,\n ShoppingCTAResult,\n StoryBlock,\n StoryBlockConfiguration,\n StoryBlockSource,\n TrackPurchaseParameters,\n UpdateProductDetailsCallback,\n UpdateProductDetailsEvent,\n VastAttribute,\n VideoFeed,\n VideoFeedClickCallback,\n VideoFeedClickEvent,\n VideoFeedConfiguration,\n VideoFeedMode,\n VideoFeedPadding,\n VideoFeedPlayIconConfiguration,\n VideoFeedSource,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n VideoLaunchBehavior,\n VideoPlaybackCallback,\n VideoPlaybackDetails,\n VideoPlaybackEvent,\n VideoPlaybackEventName,\n VideoPlayerCompleteAction,\n VideoPlayerConfiguration,\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n VideoPlayerCTAStyle,\n VideoPlayerCTAWidth,\n VideoPlayerSize,\n VideoPlayerStyle,\n VideoShopping,\n};\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":["FireworkSDK"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAEA;;AAOA;;AACA;;AAKA;;AA0BA;;AAEA;;AA8BA;;AAgBA;;;;eAEeA,oB","sourcesContent":["import type {\n IStoryBlockMethods,\n IStoryBlockProps,\n} from './components/StoryBlock';\nimport StoryBlock from './components/StoryBlock';\nimport type { IVideoFeedProps, VideoFeedMode } from './components/VideoFeed';\nimport VideoFeed from './components/VideoFeed';\nimport type {\n CustomCTAClickCallback,\n SDKInitCallback,\n VideoFeedClickCallback,\n VideoPlaybackCallback,\n} from './FireworkSDK';\nimport FireworkSDK from './FireworkSDK';\nimport FWNavigator from './FWNavigator';\nimport type {\n onLiveStreamChatEventCallback,\n onLiveStreamEventCallback,\n} from './LiveStream';\nimport LiveStream from './LiveStream';\nimport type AdBadgeConfiguration from './models/AdBadgeConfiguration';\nimport type { AdBadgeTextType } from './models/AdBadgeConfiguration';\nimport type AdConfiguration from './models/AdConfiguration';\nimport type { VastAttribute } from './models/AdConfiguration';\nimport type AndroidFontInfo from './models/AndroidFontInfo';\nimport type FeedItemDetails from './models/FeedItemDetails';\nimport type FWError from './models/FWError';\nimport type {\n CustomClickLinkButtonEvent,\n CustomCTAClickEvent,\n LiveStreamChatEvent,\n LiveStreamEvent,\n SDKInitEvent,\n ShoppingCTAEvent,\n UpdateProductDetailsEvent,\n VideoFeedClickEvent,\n VideoPlaybackEvent,\n} from './models/FWEvents';\nimport type GradientDrawable from './models/GradientDrawable';\nimport type { GradientDrawableOrientation } from './models/GradientDrawable';\nimport type IOSFontInfo from './models/IOSFontInfo';\nimport type {\n IOSSystemFontStyle,\n IOSSystemFontWeight,\n} from './models/IOSFontInfo';\nimport LiveStreamChatEventName from './models/LiveStreamChatEventName';\nimport type LiveStreamEventDetails from './models/LiveStreamEventDetails';\nimport LiveStreamEventName from './models/LiveStreamEventName';\nimport type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';\nimport type OpenVideoPlayerConfiguration from './models/OpenVideoPlayerConfiguration';\nimport type Product from './models/Product';\nimport type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';\nimport type {\n LinkButtonConfiguration,\n ShoppingCTAButtonConfiguration,\n ShoppingCTAButtonText,\n} from './models/ProductInfoViewConfiguration';\nimport type ProductUnit from './models/ProductUnit';\nimport type { ProductPrice, ProductUnitOption } from './models/ProductUnit';\nimport type PushRNContainerParams from './models/PushRNContainerParams';\nimport type { RNAppProps } from './models/PushRNContainerParams';\nimport type SDKInitOptions from './models/SDKInitOptions';\nimport type { VideoLaunchBehavior } from './models/SDKInitOptions';\nimport type ShoppingCTAResult from './models/ShoppingCTAResult';\nimport type { StoryBlockConfiguration } from './models/StoryBlockConfiguration';\nimport type { StoryBlockSource } from './models/StoryBlockSource';\nimport type TrackPurchaseParameters from './models/TrackPurchaseParameters';\nimport type VideoFeedConfiguration from './models/VideoFeedConfiguration';\nimport type {\n VideoFeedPadding,\n VideoFeedPlayIconConfiguration,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n} from './models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from './models/VideoFeedSource';\nimport type VideoPlaybackDetails from './models/VideoPlaybackDetails';\nimport type { VideoPlayerSize } from './models/VideoPlaybackDetails';\nimport VideoPlaybackEventName from './models/VideoPlaybackEventName';\nimport type { VideoPlayerCompleteAction } from './models/VideoPlayerCompleteAction';\nimport type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport type {\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n} from './models/VideoPlayerCTADelay';\nimport type { VideoPlayerCTAStyle } from './models/VideoPlayerCTAStyle';\nimport type { VideoPlayerCTAWidth } from './models/VideoPlayerCTAWidth';\nimport type { VideoPlayerStyle } from './models/VideoPlayerStyle';\nimport type {\n CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n ShoppingCTACallback,\n UpdateProductDetailsCallback,\n} from './VideoShopping';\nimport VideoShopping from './VideoShopping';\n\nexport default FireworkSDK;\n\nexport {\n AdBadgeConfiguration,\n AdBadgeTextType,\n AdConfiguration,\n AndroidFontInfo,\n CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n CustomClickLinkButtonEvent,\n CustomCTAClickCallback,\n CustomCTAClickEvent,\n FeedItemDetails,\n FireworkSDK,\n FWError,\n FWNavigator,\n GradientDrawable,\n GradientDrawableOrientation,\n IOSFontInfo,\n IOSSystemFontStyle,\n IOSSystemFontWeight,\n IStoryBlockMethods,\n IStoryBlockProps,\n IVideoFeedProps,\n LinkButtonConfiguration,\n LiveStream,\n LiveStreamChatEvent,\n LiveStreamChatEventName,\n LiveStreamEvent,\n LiveStreamEventDetails,\n LiveStreamEventName,\n LiveStreamMessageDetails,\n onLiveStreamChatEventCallback,\n onLiveStreamEventCallback,\n OpenVideoPlayerConfiguration,\n Product,\n ProductInfoViewConfiguration,\n ProductPrice,\n ProductUnit,\n ProductUnitOption,\n PushRNContainerParams,\n RNAppProps,\n SDKInitCallback,\n SDKInitEvent,\n SDKInitOptions,\n ShoppingCTAButtonConfiguration,\n ShoppingCTAButtonText,\n ShoppingCTACallback,\n ShoppingCTAEvent,\n ShoppingCTAResult,\n StoryBlock,\n StoryBlockConfiguration,\n StoryBlockSource,\n TrackPurchaseParameters,\n UpdateProductDetailsCallback,\n UpdateProductDetailsEvent,\n VastAttribute,\n VideoFeed,\n VideoFeedClickCallback,\n VideoFeedClickEvent,\n VideoFeedConfiguration,\n VideoFeedMode,\n VideoFeedPadding,\n VideoFeedPlayIconConfiguration,\n VideoFeedSource,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n VideoLaunchBehavior,\n VideoPlaybackCallback,\n VideoPlaybackDetails,\n VideoPlaybackEvent,\n VideoPlaybackEventName,\n VideoPlayerCompleteAction,\n VideoPlayerConfiguration,\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n VideoPlayerCTAStyle,\n VideoPlayerCTAWidth,\n VideoPlayerSize,\n VideoPlayerStyle,\n VideoShopping,\n};\n"]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=PushRNContainerParams.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["FWNavigatorModule.ts"],"names":["FWNavigatorModule","NativeModules","Proxy","get","Error","LINKING_ERROR","FWNavigatorModuleEventEmitter","NativeEventEmitter"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA,MAAMA,iBAAiB,GAAGC,2BAAcD,iBAAd,GACtBC,2BAAcD,iBADQ,GAEtB,IAAIE,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUC,6BAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAiBA,MAAMC,6BAA6B,GAAG,IAAIC,+BAAJ,CAAuBP,iBAAvB,CAAtC;;eAEeA,iB","sourcesContent":["import { NativeEventEmitter, NativeModule } from 'react-native';\nimport { NativeModules } from 'react-native';\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\n\nconst FWNavigatorModule = NativeModules.FWNavigatorModule\n ? NativeModules.FWNavigatorModule\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\ninterface IFWNavigatorModule extends NativeModule {\n popNativeContainer(): Promise<boolean>;\n canPopNativeContainer(): Promise<boolean>;\n startFloatingPlayer(): Promise<boolean>;\n stopFloatingPlayer(): Promise<boolean>;\n}\n\nconst FWNavigatorModuleEventEmitter = new NativeEventEmitter(FWNavigatorModule);\nexport { FWNavigatorModuleEventEmitter };\nexport default FWNavigatorModule as IFWNavigatorModule;\n"]}
1
+ {"version":3,"sources":["FWNavigatorModule.ts"],"names":["FWNavigatorModule","NativeModules","Proxy","get","Error","LINKING_ERROR","FWNavigatorModuleEventEmitter","NativeEventEmitter"],"mappings":";;;;;;;AAAA;;AAEA;;AAGA,MAAMA,iBAAiB,GAAGC,2BAAcD,iBAAd,GACtBC,2BAAcD,iBADQ,GAEtB,IAAIE,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUC,6BAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAmBA,MAAMC,6BAA6B,GAAG,IAAIC,+BAAJ,CAAuBP,iBAAvB,CAAtC;;eAEeA,iB","sourcesContent":["import { NativeEventEmitter, NativeModule, NativeModules } from 'react-native';\n\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\nimport type PushRNContainerParams from '../models/PushRNContainerParams';\n\nconst FWNavigatorModule = NativeModules.FWNavigatorModule\n ? NativeModules.FWNavigatorModule\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\ninterface IFWNavigatorModule extends NativeModule {\n pushRNContainer(params: PushRNContainerParams): Promise<boolean>;\n popRNContainer(): Promise<boolean>;\n popNativeContainer(): Promise<boolean>;\n canPopNativeContainer(): Promise<boolean>;\n startFloatingPlayer(): Promise<boolean>;\n stopFloatingPlayer(): Promise<boolean>;\n}\n\nconst FWNavigatorModuleEventEmitter = new NativeEventEmitter(FWNavigatorModule);\nexport { FWNavigatorModuleEventEmitter };\nexport default FWNavigatorModule as IFWNavigatorModule;\n"]}
@@ -20,6 +20,27 @@ class FWNavigator {
20
20
  FWLoggerUtil.log('FWNavigator constructor');
21
21
  FWNavigatorModuleEventEmitter.addListener(FWEventName.LogMessage, () => {});
22
22
  }
23
+ /**
24
+ * Push a new RN container.
25
+ * You could use this method to make a RN page on top of
26
+ * SDK full-screen player.
27
+ * @param params {PushRNContainerParams}
28
+ * @returns {Promise<boolean>} The result of pushing a new Container.
29
+ */
30
+
31
+
32
+ pushRNContainer(params) {
33
+ return FWNavigatorModule.pushRNContainer(params);
34
+ }
35
+ /**
36
+ * Pop the RN container you pushed before.
37
+ * @returns {Promise<boolean>} The result of popping a new Container.
38
+ */
39
+
40
+
41
+ popRNContainer() {
42
+ return FWNavigatorModule.popRNContainer();
43
+ }
23
44
  /**
24
45
  * Pop the native container. You could use the method to close the fullscreen player.
25
46
  * But if the enablePictureInPicture of the associated video feed is true,
@@ -1 +1 @@
1
- {"version":3,"sources":["FWNavigator.ts"],"names":["FWEventName","FWNavigatorModule","FWNavigatorModuleEventEmitter","FWLoggerUtil","FWNavigator","getInstance","_instance","constructor","log","addListener","LogMessage","popNativeContainer","startFloatingPlayer","stopFloatingPlayer"],"mappings":";;AAAA,SAASA,WAAT,QAA4B,sBAA5B;AACA,OAAOC,iBAAP,IACEC,6BADF,QAEO,6BAFP;AAGA,OAAOC,YAAP,MAAyB,sBAAzB;AAEA;AACA;AACA;;AACA,MAAMC,WAAN,CAAkB;AAGS,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;AACpBJ,IAAAA,YAAY,CAACK,GAAb,CAAiB,yBAAjB;AACAN,IAAAA,6BAA6B,CAACO,WAA9B,CAA0CT,WAAW,CAACU,UAAtD,EAAkE,MAAM,CAAE,CAA1E;AACD;AAED;AACF;AACA;AACA;AACA;AACA;;;AACSC,EAAAA,kBAAkB,GAAqB;AAC5C,WAAOV,iBAAiB,CAACU,kBAAlB,EAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACkC,QAAnBC,mBAAmB,GAAqB;AACnD,WAAOX,iBAAiB,CAACW,mBAAlB,EAAP;AACD;AAED;AACF;AACA;;;AACiC,QAAlBC,kBAAkB,GAAkB;AAC/C,UAAMZ,iBAAiB,CAACY,kBAAlB,EAAN;AACD;;AAvCe;;gBAAZT,W;;AA0CN,eAAeA,WAAf","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\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 FWLoggerUtil.log('FWNavigator constructor');\n FWNavigatorModuleEventEmitter.addListener(FWEventName.LogMessage, () => {});\n }\n\n /**\n * Pop the native container. You could use the method to close the fullscreen player.\n * But if the enablePictureInPicture of the associated video feed is true,\n * we can't close the fullscreen player.\n * @returns {Promise<boolean>} The result of popping the native container.\n */\n public popNativeContainer(): Promise<boolean> {\n return FWNavigatorModule.popNativeContainer();\n }\n\n /**\n * Change current fullscreen player to floating player.\n * @returns {Promise<boolean>} If the result is true, it means that the fullscreen\n * player is changed to floating player.\n */\n public async startFloatingPlayer(): Promise<boolean> {\n return FWNavigatorModule.startFloatingPlayer();\n }\n\n /**\n * Stop current floating player.\n */\n public async stopFloatingPlayer(): Promise<void> {\n await FWNavigatorModule.stopFloatingPlayer();\n }\n}\n\nexport default FWNavigator;\n"]}
1
+ {"version":3,"sources":["FWNavigator.ts"],"names":["FWEventName","FWNavigatorModule","FWNavigatorModuleEventEmitter","FWLoggerUtil","FWNavigator","getInstance","_instance","constructor","log","addListener","LogMessage","pushRNContainer","params","popRNContainer","popNativeContainer","startFloatingPlayer","stopFloatingPlayer"],"mappings":";;AAAA,SAASA,WAAT,QAA4B,sBAA5B;AAEA,OAAOC,iBAAP,IACEC,6BADF,QAEO,6BAFP;AAGA,OAAOC,YAAP,MAAyB,sBAAzB;AAEA;AACA;AACA;;AACA,MAAMC,WAAN,CAAkB;AAGS,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;AACpBJ,IAAAA,YAAY,CAACK,GAAb,CAAiB,yBAAjB;AACAN,IAAAA,6BAA6B,CAACO,WAA9B,CAA0CT,WAAW,CAACU,UAAtD,EAAkE,MAAM,CAAE,CAA1E;AACD;AAED;AACF;AACA;AACA;AACA;AACA;AACA;;;AACSC,EAAAA,eAAe,CAACC,MAAD,EAAkD;AACtE,WAAOX,iBAAiB,CAACU,eAAlB,CAAkCC,MAAlC,CAAP;AACD;AAED;AACF;AACA;AACA;;;AACSC,EAAAA,cAAc,GAAqB;AACxC,WAAOZ,iBAAiB,CAACY,cAAlB,EAAP;AACD;AAED;AACF;AACA;AACA;AACA;AACA;;;AACSC,EAAAA,kBAAkB,GAAqB;AAC5C,WAAOb,iBAAiB,CAACa,kBAAlB,EAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACkC,QAAnBC,mBAAmB,GAAqB;AACnD,WAAOd,iBAAiB,CAACc,mBAAlB,EAAP;AACD;AAED;AACF;AACA;;;AACiC,QAAlBC,kBAAkB,GAAkB;AAC/C,UAAMf,iBAAiB,CAACe,kBAAlB,EAAN;AACD;;AA1De;;gBAAZZ,W;;AA6DN,eAAeA,WAAf","sourcesContent":["import { FWEventName } from './models/FWEventName';\nimport type PushRNContainerParams from './models/PushRNContainerParams';\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\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 FWLoggerUtil.log('FWNavigator constructor');\n FWNavigatorModuleEventEmitter.addListener(FWEventName.LogMessage, () => {});\n }\n\n /**\n * Push a new RN container.\n * You could use this method to make a RN page on top of\n * SDK full-screen player.\n * @param params {PushRNContainerParams}\n * @returns {Promise<boolean>} The result of pushing a new Container.\n */\n public pushRNContainer(params: PushRNContainerParams): Promise<boolean> {\n return FWNavigatorModule.pushRNContainer(params);\n }\n\n /**\n * Pop the RN container you pushed before.\n * @returns {Promise<boolean>} The result of popping a new Container.\n */\n public popRNContainer(): Promise<boolean> {\n return FWNavigatorModule.popRNContainer();\n }\n\n /**\n * Pop the native container. You could use the method to close the fullscreen player.\n * But if the enablePictureInPicture of the associated video feed is true,\n * we can't close the fullscreen player.\n * @returns {Promise<boolean>} The result of popping the native container.\n */\n public popNativeContainer(): Promise<boolean> {\n return FWNavigatorModule.popNativeContainer();\n }\n\n /**\n * Change current fullscreen player to floating player.\n * @returns {Promise<boolean>} If the result is true, it means that the fullscreen\n * player is changed to floating player.\n */\n public async startFloatingPlayer(): Promise<boolean> {\n return FWNavigatorModule.startFloatingPlayer();\n }\n\n /**\n * Stop current floating player.\n */\n public async stopFloatingPlayer(): Promise<void> {\n await FWNavigatorModule.stopFloatingPlayer();\n }\n}\n\nexport default FWNavigator;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["StoryBlock","VideoFeed","FireworkSDK","FWNavigator","LiveStream","LiveStreamChatEventName","LiveStreamEventName","VideoPlaybackEventName","VideoShopping"],"mappings":"AAIA,OAAOA,UAAP,MAAuB,yBAAvB;AAEA,OAAOC,SAAP,MAAsB,wBAAtB;AAOA,OAAOC,WAAP,MAAwB,eAAxB;AACA,OAAOC,WAAP,MAAwB,eAAxB;AAKA,OAAOC,UAAP,MAAuB,cAAvB;AA0BA,OAAOC,uBAAP,MAAoC,kCAApC;AAEA,OAAOC,mBAAP,MAAgC,8BAAhC;AA4BA,OAAOC,sBAAP,MAAmC,iCAAnC;AAgBA,OAAOC,aAAP,MAA0B,iBAA1B;AAEA,eAAeN,WAAf;AAEA,SAWEA,WAXF,EAaEC,WAbF,EAuBEC,UAvBF,EAyBEC,uBAzBF,EA4BEC,mBA5BF,EA8CEN,UA9CF,EAqDEC,SArDF,EAmEEM,sBAnEF,EA4EEC,aA5EF","sourcesContent":["import type {\n IStoryBlockMethods,\n IStoryBlockProps,\n} from './components/StoryBlock';\nimport StoryBlock from './components/StoryBlock';\nimport type { IVideoFeedProps, VideoFeedMode } from './components/VideoFeed';\nimport VideoFeed from './components/VideoFeed';\nimport type {\n CustomCTAClickCallback,\n SDKInitCallback,\n VideoFeedClickCallback,\n VideoPlaybackCallback,\n} from './FireworkSDK';\nimport FireworkSDK from './FireworkSDK';\nimport FWNavigator from './FWNavigator';\nimport type {\n onLiveStreamChatEventCallback,\n onLiveStreamEventCallback,\n} from './LiveStream';\nimport LiveStream from './LiveStream';\nimport type AdBadgeConfiguration from './models/AdBadgeConfiguration';\nimport type { AdBadgeTextType } from './models/AdBadgeConfiguration';\nimport type AdConfiguration from './models/AdConfiguration';\nimport type { VastAttribute } from './models/AdConfiguration';\nimport type AndroidFontInfo from './models/AndroidFontInfo';\nimport type FeedItemDetails from './models/FeedItemDetails';\nimport type FWError from './models/FWError';\nimport type {\n CustomClickLinkButtonEvent,\n CustomCTAClickEvent,\n LiveStreamChatEvent,\n LiveStreamEvent,\n SDKInitEvent,\n ShoppingCTAEvent,\n UpdateProductDetailsEvent,\n VideoFeedClickEvent,\n VideoPlaybackEvent,\n} from './models/FWEvents';\nimport type GradientDrawable from './models/GradientDrawable';\nimport type { GradientDrawableOrientation } from './models/GradientDrawable';\nimport type IOSFontInfo from './models/IOSFontInfo';\nimport type {\n IOSSystemFontStyle,\n IOSSystemFontWeight,\n} from './models/IOSFontInfo';\nimport LiveStreamChatEventName from './models/LiveStreamChatEventName';\nimport type LiveStreamEventDetails from './models/LiveStreamEventDetails';\nimport LiveStreamEventName from './models/LiveStreamEventName';\nimport type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';\nimport type OpenVideoPlayerConfiguration from './models/OpenVideoPlayerConfiguration';\nimport type Product from './models/Product';\nimport type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';\nimport type {\n LinkButtonConfiguration,\n ShoppingCTAButtonConfiguration,\n ShoppingCTAButtonText,\n} from './models/ProductInfoViewConfiguration';\nimport type ProductUnit from './models/ProductUnit';\nimport type { ProductPrice, ProductUnitOption } from './models/ProductUnit';\nimport type SDKInitOptions from './models/SDKInitOptions';\nimport type { VideoLaunchBehavior } from './models/SDKInitOptions';\nimport type ShoppingCTAResult from './models/ShoppingCTAResult';\nimport type { StoryBlockConfiguration } from './models/StoryBlockConfiguration';\nimport type { StoryBlockSource } from './models/StoryBlockSource';\nimport type TrackPurchaseParameters from './models/TrackPurchaseParameters';\nimport type VideoFeedConfiguration from './models/VideoFeedConfiguration';\nimport type {\n VideoFeedPadding,\n VideoFeedPlayIconConfiguration,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n} from './models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from './models/VideoFeedSource';\nimport type VideoPlaybackDetails from './models/VideoPlaybackDetails';\nimport type { VideoPlayerSize } from './models/VideoPlaybackDetails';\nimport VideoPlaybackEventName from './models/VideoPlaybackEventName';\nimport type { VideoPlayerCompleteAction } from './models/VideoPlayerCompleteAction';\nimport type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport type {\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n} from './models/VideoPlayerCTADelay';\nimport type { VideoPlayerCTAStyle } from './models/VideoPlayerCTAStyle';\nimport type { VideoPlayerCTAWidth } from './models/VideoPlayerCTAWidth';\nimport type { VideoPlayerStyle } from './models/VideoPlayerStyle';\nimport type {\n CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n ShoppingCTACallback,\n UpdateProductDetailsCallback,\n} from './VideoShopping';\nimport VideoShopping from './VideoShopping';\n\nexport default FireworkSDK;\n\nexport {\n AdBadgeConfiguration,\n AdBadgeTextType,\n AdConfiguration,\n AndroidFontInfo,\n CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n CustomClickLinkButtonEvent,\n CustomCTAClickCallback,\n CustomCTAClickEvent,\n FeedItemDetails,\n FireworkSDK,\n FWError,\n FWNavigator,\n GradientDrawable,\n GradientDrawableOrientation,\n IOSFontInfo,\n IOSSystemFontStyle,\n IOSSystemFontWeight,\n IStoryBlockMethods,\n IStoryBlockProps,\n IVideoFeedProps,\n LinkButtonConfiguration,\n LiveStream,\n LiveStreamChatEvent,\n LiveStreamChatEventName,\n LiveStreamEvent,\n LiveStreamEventDetails,\n LiveStreamEventName,\n LiveStreamMessageDetails,\n onLiveStreamChatEventCallback,\n onLiveStreamEventCallback,\n OpenVideoPlayerConfiguration,\n Product,\n ProductInfoViewConfiguration,\n ProductPrice,\n ProductUnit,\n ProductUnitOption,\n SDKInitCallback,\n SDKInitEvent,\n SDKInitOptions,\n ShoppingCTAButtonConfiguration,\n ShoppingCTAButtonText,\n ShoppingCTACallback,\n ShoppingCTAEvent,\n ShoppingCTAResult,\n StoryBlock,\n StoryBlockConfiguration,\n StoryBlockSource,\n TrackPurchaseParameters,\n UpdateProductDetailsCallback,\n UpdateProductDetailsEvent,\n VastAttribute,\n VideoFeed,\n VideoFeedClickCallback,\n VideoFeedClickEvent,\n VideoFeedConfiguration,\n VideoFeedMode,\n VideoFeedPadding,\n VideoFeedPlayIconConfiguration,\n VideoFeedSource,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n VideoLaunchBehavior,\n VideoPlaybackCallback,\n VideoPlaybackDetails,\n VideoPlaybackEvent,\n VideoPlaybackEventName,\n VideoPlayerCompleteAction,\n VideoPlayerConfiguration,\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n VideoPlayerCTAStyle,\n VideoPlayerCTAWidth,\n VideoPlayerSize,\n VideoPlayerStyle,\n VideoShopping,\n};\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":["StoryBlock","VideoFeed","FireworkSDK","FWNavigator","LiveStream","LiveStreamChatEventName","LiveStreamEventName","VideoPlaybackEventName","VideoShopping"],"mappings":"AAIA,OAAOA,UAAP,MAAuB,yBAAvB;AAEA,OAAOC,SAAP,MAAsB,wBAAtB;AAOA,OAAOC,WAAP,MAAwB,eAAxB;AACA,OAAOC,WAAP,MAAwB,eAAxB;AAKA,OAAOC,UAAP,MAAuB,cAAvB;AA0BA,OAAOC,uBAAP,MAAoC,kCAApC;AAEA,OAAOC,mBAAP,MAAgC,8BAAhC;AA8BA,OAAOC,sBAAP,MAAmC,iCAAnC;AAgBA,OAAOC,aAAP,MAA0B,iBAA1B;AAEA,eAAeN,WAAf;AAEA,SAWEA,WAXF,EAaEC,WAbF,EAuBEC,UAvBF,EAyBEC,uBAzBF,EA4BEC,mBA5BF,EAgDEN,UAhDF,EAuDEC,SAvDF,EAqEEM,sBArEF,EA8EEC,aA9EF","sourcesContent":["import type {\n IStoryBlockMethods,\n IStoryBlockProps,\n} from './components/StoryBlock';\nimport StoryBlock from './components/StoryBlock';\nimport type { IVideoFeedProps, VideoFeedMode } from './components/VideoFeed';\nimport VideoFeed from './components/VideoFeed';\nimport type {\n CustomCTAClickCallback,\n SDKInitCallback,\n VideoFeedClickCallback,\n VideoPlaybackCallback,\n} from './FireworkSDK';\nimport FireworkSDK from './FireworkSDK';\nimport FWNavigator from './FWNavigator';\nimport type {\n onLiveStreamChatEventCallback,\n onLiveStreamEventCallback,\n} from './LiveStream';\nimport LiveStream from './LiveStream';\nimport type AdBadgeConfiguration from './models/AdBadgeConfiguration';\nimport type { AdBadgeTextType } from './models/AdBadgeConfiguration';\nimport type AdConfiguration from './models/AdConfiguration';\nimport type { VastAttribute } from './models/AdConfiguration';\nimport type AndroidFontInfo from './models/AndroidFontInfo';\nimport type FeedItemDetails from './models/FeedItemDetails';\nimport type FWError from './models/FWError';\nimport type {\n CustomClickLinkButtonEvent,\n CustomCTAClickEvent,\n LiveStreamChatEvent,\n LiveStreamEvent,\n SDKInitEvent,\n ShoppingCTAEvent,\n UpdateProductDetailsEvent,\n VideoFeedClickEvent,\n VideoPlaybackEvent,\n} from './models/FWEvents';\nimport type GradientDrawable from './models/GradientDrawable';\nimport type { GradientDrawableOrientation } from './models/GradientDrawable';\nimport type IOSFontInfo from './models/IOSFontInfo';\nimport type {\n IOSSystemFontStyle,\n IOSSystemFontWeight,\n} from './models/IOSFontInfo';\nimport LiveStreamChatEventName from './models/LiveStreamChatEventName';\nimport type LiveStreamEventDetails from './models/LiveStreamEventDetails';\nimport LiveStreamEventName from './models/LiveStreamEventName';\nimport type LiveStreamMessageDetails from './models/LiveStreamMessageDetails';\nimport type OpenVideoPlayerConfiguration from './models/OpenVideoPlayerConfiguration';\nimport type Product from './models/Product';\nimport type ProductInfoViewConfiguration from './models/ProductInfoViewConfiguration';\nimport type {\n LinkButtonConfiguration,\n ShoppingCTAButtonConfiguration,\n ShoppingCTAButtonText,\n} from './models/ProductInfoViewConfiguration';\nimport type ProductUnit from './models/ProductUnit';\nimport type { ProductPrice, ProductUnitOption } from './models/ProductUnit';\nimport type PushRNContainerParams from './models/PushRNContainerParams';\nimport type { RNAppProps } from './models/PushRNContainerParams';\nimport type SDKInitOptions from './models/SDKInitOptions';\nimport type { VideoLaunchBehavior } from './models/SDKInitOptions';\nimport type ShoppingCTAResult from './models/ShoppingCTAResult';\nimport type { StoryBlockConfiguration } from './models/StoryBlockConfiguration';\nimport type { StoryBlockSource } from './models/StoryBlockSource';\nimport type TrackPurchaseParameters from './models/TrackPurchaseParameters';\nimport type VideoFeedConfiguration from './models/VideoFeedConfiguration';\nimport type {\n VideoFeedPadding,\n VideoFeedPlayIconConfiguration,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n} from './models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from './models/VideoFeedSource';\nimport type VideoPlaybackDetails from './models/VideoPlaybackDetails';\nimport type { VideoPlayerSize } from './models/VideoPlaybackDetails';\nimport VideoPlaybackEventName from './models/VideoPlaybackEventName';\nimport type { VideoPlayerCompleteAction } from './models/VideoPlayerCompleteAction';\nimport type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport type {\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n} from './models/VideoPlayerCTADelay';\nimport type { VideoPlayerCTAStyle } from './models/VideoPlayerCTAStyle';\nimport type { VideoPlayerCTAWidth } from './models/VideoPlayerCTAWidth';\nimport type { VideoPlayerStyle } from './models/VideoPlayerStyle';\nimport type {\n CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n ShoppingCTACallback,\n UpdateProductDetailsCallback,\n} from './VideoShopping';\nimport VideoShopping from './VideoShopping';\n\nexport default FireworkSDK;\n\nexport {\n AdBadgeConfiguration,\n AdBadgeTextType,\n AdConfiguration,\n AndroidFontInfo,\n CustomClickCartIconCallback,\n CustomClickLinkButtonCallback,\n CustomClickLinkButtonEvent,\n CustomCTAClickCallback,\n CustomCTAClickEvent,\n FeedItemDetails,\n FireworkSDK,\n FWError,\n FWNavigator,\n GradientDrawable,\n GradientDrawableOrientation,\n IOSFontInfo,\n IOSSystemFontStyle,\n IOSSystemFontWeight,\n IStoryBlockMethods,\n IStoryBlockProps,\n IVideoFeedProps,\n LinkButtonConfiguration,\n LiveStream,\n LiveStreamChatEvent,\n LiveStreamChatEventName,\n LiveStreamEvent,\n LiveStreamEventDetails,\n LiveStreamEventName,\n LiveStreamMessageDetails,\n onLiveStreamChatEventCallback,\n onLiveStreamEventCallback,\n OpenVideoPlayerConfiguration,\n Product,\n ProductInfoViewConfiguration,\n ProductPrice,\n ProductUnit,\n ProductUnitOption,\n PushRNContainerParams,\n RNAppProps,\n SDKInitCallback,\n SDKInitEvent,\n SDKInitOptions,\n ShoppingCTAButtonConfiguration,\n ShoppingCTAButtonText,\n ShoppingCTACallback,\n ShoppingCTAEvent,\n ShoppingCTAResult,\n StoryBlock,\n StoryBlockConfiguration,\n StoryBlockSource,\n TrackPurchaseParameters,\n UpdateProductDetailsCallback,\n UpdateProductDetailsEvent,\n VastAttribute,\n VideoFeed,\n VideoFeedClickCallback,\n VideoFeedClickEvent,\n VideoFeedConfiguration,\n VideoFeedMode,\n VideoFeedPadding,\n VideoFeedPlayIconConfiguration,\n VideoFeedSource,\n VideoFeedTitleConfiguration,\n VideoFeedTitlePosition,\n VideoLaunchBehavior,\n VideoPlaybackCallback,\n VideoPlaybackDetails,\n VideoPlaybackEvent,\n VideoPlaybackEventName,\n VideoPlayerCompleteAction,\n VideoPlayerConfiguration,\n VideoPlayerCTADelay,\n VideoPlayerCTADelayType,\n VideoPlayerCTAStyle,\n VideoPlayerCTAWidth,\n VideoPlayerSize,\n VideoPlayerStyle,\n VideoShopping,\n};\n"]}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=PushRNContainerParams.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1,5 +1,4 @@
1
- import { NativeEventEmitter } from 'react-native';
2
- import { NativeModules } from 'react-native';
1
+ import { NativeEventEmitter, NativeModules } from 'react-native';
3
2
  import { LINKING_ERROR } from '../constants/FWErrorMessage';
4
3
  const FWNavigatorModule = NativeModules.FWNavigatorModule ? NativeModules.FWNavigatorModule : new Proxy({}, {
5
4
  get() {
@@ -1 +1 @@
1
- {"version":3,"sources":["FWNavigatorModule.ts"],"names":["NativeEventEmitter","NativeModules","LINKING_ERROR","FWNavigatorModule","Proxy","get","Error","FWNavigatorModuleEventEmitter"],"mappings":"AAAA,SAASA,kBAAT,QAAiD,cAAjD;AACA,SAASC,aAAT,QAA8B,cAA9B;AACA,SAASC,aAAT,QAA8B,6BAA9B;AAEA,MAAMC,iBAAiB,GAAGF,aAAa,CAACE,iBAAd,GACtBF,aAAa,CAACE,iBADQ,GAEtB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUJ,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAiBA,MAAMK,6BAA6B,GAAG,IAAIP,kBAAJ,CAAuBG,iBAAvB,CAAtC;AACA,SAASI,6BAAT;AACA,eAAeJ,iBAAf","sourcesContent":["import { NativeEventEmitter, NativeModule } from 'react-native';\nimport { NativeModules } from 'react-native';\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\n\nconst FWNavigatorModule = NativeModules.FWNavigatorModule\n ? NativeModules.FWNavigatorModule\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\ninterface IFWNavigatorModule extends NativeModule {\n popNativeContainer(): Promise<boolean>;\n canPopNativeContainer(): Promise<boolean>;\n startFloatingPlayer(): Promise<boolean>;\n stopFloatingPlayer(): Promise<boolean>;\n}\n\nconst FWNavigatorModuleEventEmitter = new NativeEventEmitter(FWNavigatorModule);\nexport { FWNavigatorModuleEventEmitter };\nexport default FWNavigatorModule as IFWNavigatorModule;\n"]}
1
+ {"version":3,"sources":["FWNavigatorModule.ts"],"names":["NativeEventEmitter","NativeModules","LINKING_ERROR","FWNavigatorModule","Proxy","get","Error","FWNavigatorModuleEventEmitter"],"mappings":"AAAA,SAASA,kBAAT,EAA2CC,aAA3C,QAAgE,cAAhE;AAEA,SAASC,aAAT,QAA8B,6BAA9B;AAGA,MAAMC,iBAAiB,GAAGF,aAAa,CAACE,iBAAd,GACtBF,aAAa,CAACE,iBADQ,GAEtB,IAAIC,KAAJ,CACE,EADF,EAEE;AACEC,EAAAA,GAAG,GAAG;AACJ,UAAM,IAAIC,KAAJ,CAAUJ,aAAV,CAAN;AACD;;AAHH,CAFF,CAFJ;AAmBA,MAAMK,6BAA6B,GAAG,IAAIP,kBAAJ,CAAuBG,iBAAvB,CAAtC;AACA,SAASI,6BAAT;AACA,eAAeJ,iBAAf","sourcesContent":["import { NativeEventEmitter, NativeModule, NativeModules } from 'react-native';\n\nimport { LINKING_ERROR } from '../constants/FWErrorMessage';\nimport type PushRNContainerParams from '../models/PushRNContainerParams';\n\nconst FWNavigatorModule = NativeModules.FWNavigatorModule\n ? NativeModules.FWNavigatorModule\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\ninterface IFWNavigatorModule extends NativeModule {\n pushRNContainer(params: PushRNContainerParams): Promise<boolean>;\n popRNContainer(): Promise<boolean>;\n popNativeContainer(): Promise<boolean>;\n canPopNativeContainer(): Promise<boolean>;\n startFloatingPlayer(): Promise<boolean>;\n stopFloatingPlayer(): Promise<boolean>;\n}\n\nconst FWNavigatorModuleEventEmitter = new NativeEventEmitter(FWNavigatorModule);\nexport { FWNavigatorModuleEventEmitter };\nexport default FWNavigatorModule as IFWNavigatorModule;\n"]}
@@ -1,3 +1,4 @@
1
+ import type PushRNContainerParams from './models/PushRNContainerParams';
1
2
  /**
2
3
  * You can use this class for pushing RN page from the native page.
3
4
  */
@@ -5,6 +6,19 @@ declare class FWNavigator {
5
6
  private static _instance?;
6
7
  static getInstance(): FWNavigator;
7
8
  private constructor();
9
+ /**
10
+ * Push a new RN container.
11
+ * You could use this method to make a RN page on top of
12
+ * SDK full-screen player.
13
+ * @param params {PushRNContainerParams}
14
+ * @returns {Promise<boolean>} The result of pushing a new Container.
15
+ */
16
+ pushRNContainer(params: PushRNContainerParams): Promise<boolean>;
17
+ /**
18
+ * Pop the RN container you pushed before.
19
+ * @returns {Promise<boolean>} The result of popping a new Container.
20
+ */
21
+ popRNContainer(): Promise<boolean>;
8
22
  /**
9
23
  * Pop the native container. You could use the method to close the fullscreen player.
10
24
  * But if the enablePictureInPicture of the associated video feed is true,
@@ -29,6 +29,8 @@ import type ProductInfoViewConfiguration from './models/ProductInfoViewConfigura
29
29
  import type { LinkButtonConfiguration, ShoppingCTAButtonConfiguration, ShoppingCTAButtonText } from './models/ProductInfoViewConfiguration';
30
30
  import type ProductUnit from './models/ProductUnit';
31
31
  import type { ProductPrice, ProductUnitOption } from './models/ProductUnit';
32
+ import type PushRNContainerParams from './models/PushRNContainerParams';
33
+ import type { RNAppProps } from './models/PushRNContainerParams';
32
34
  import type SDKInitOptions from './models/SDKInitOptions';
33
35
  import type { VideoLaunchBehavior } from './models/SDKInitOptions';
34
36
  import type ShoppingCTAResult from './models/ShoppingCTAResult';
@@ -50,4 +52,4 @@ import type { VideoPlayerStyle } from './models/VideoPlayerStyle';
50
52
  import type { CustomClickCartIconCallback, CustomClickLinkButtonCallback, ShoppingCTACallback, UpdateProductDetailsCallback } from './VideoShopping';
51
53
  import VideoShopping from './VideoShopping';
52
54
  export default FireworkSDK;
53
- export { AdBadgeConfiguration, AdBadgeTextType, AdConfiguration, AndroidFontInfo, CustomClickCartIconCallback, CustomClickLinkButtonCallback, CustomClickLinkButtonEvent, CustomCTAClickCallback, CustomCTAClickEvent, FeedItemDetails, FireworkSDK, FWError, FWNavigator, GradientDrawable, GradientDrawableOrientation, IOSFontInfo, IOSSystemFontStyle, IOSSystemFontWeight, IStoryBlockMethods, IStoryBlockProps, IVideoFeedProps, LinkButtonConfiguration, LiveStream, LiveStreamChatEvent, LiveStreamChatEventName, LiveStreamEvent, LiveStreamEventDetails, LiveStreamEventName, LiveStreamMessageDetails, onLiveStreamChatEventCallback, onLiveStreamEventCallback, OpenVideoPlayerConfiguration, Product, ProductInfoViewConfiguration, ProductPrice, ProductUnit, ProductUnitOption, SDKInitCallback, SDKInitEvent, SDKInitOptions, ShoppingCTAButtonConfiguration, ShoppingCTAButtonText, ShoppingCTACallback, ShoppingCTAEvent, ShoppingCTAResult, StoryBlock, StoryBlockConfiguration, StoryBlockSource, TrackPurchaseParameters, UpdateProductDetailsCallback, UpdateProductDetailsEvent, VastAttribute, VideoFeed, VideoFeedClickCallback, VideoFeedClickEvent, VideoFeedConfiguration, VideoFeedMode, VideoFeedPadding, VideoFeedPlayIconConfiguration, VideoFeedSource, VideoFeedTitleConfiguration, VideoFeedTitlePosition, VideoLaunchBehavior, VideoPlaybackCallback, VideoPlaybackDetails, VideoPlaybackEvent, VideoPlaybackEventName, VideoPlayerCompleteAction, VideoPlayerConfiguration, VideoPlayerCTADelay, VideoPlayerCTADelayType, VideoPlayerCTAStyle, VideoPlayerCTAWidth, VideoPlayerSize, VideoPlayerStyle, VideoShopping, };
55
+ export { AdBadgeConfiguration, AdBadgeTextType, AdConfiguration, AndroidFontInfo, CustomClickCartIconCallback, CustomClickLinkButtonCallback, CustomClickLinkButtonEvent, CustomCTAClickCallback, CustomCTAClickEvent, FeedItemDetails, FireworkSDK, FWError, FWNavigator, GradientDrawable, GradientDrawableOrientation, IOSFontInfo, IOSSystemFontStyle, IOSSystemFontWeight, IStoryBlockMethods, IStoryBlockProps, IVideoFeedProps, LinkButtonConfiguration, LiveStream, LiveStreamChatEvent, LiveStreamChatEventName, LiveStreamEvent, LiveStreamEventDetails, LiveStreamEventName, LiveStreamMessageDetails, onLiveStreamChatEventCallback, onLiveStreamEventCallback, OpenVideoPlayerConfiguration, Product, ProductInfoViewConfiguration, ProductPrice, ProductUnit, ProductUnitOption, PushRNContainerParams, RNAppProps, SDKInitCallback, SDKInitEvent, SDKInitOptions, ShoppingCTAButtonConfiguration, ShoppingCTAButtonText, ShoppingCTACallback, ShoppingCTAEvent, ShoppingCTAResult, StoryBlock, StoryBlockConfiguration, StoryBlockSource, TrackPurchaseParameters, UpdateProductDetailsCallback, UpdateProductDetailsEvent, VastAttribute, VideoFeed, VideoFeedClickCallback, VideoFeedClickEvent, VideoFeedConfiguration, VideoFeedMode, VideoFeedPadding, VideoFeedPlayIconConfiguration, VideoFeedSource, VideoFeedTitleConfiguration, VideoFeedTitlePosition, VideoLaunchBehavior, VideoPlaybackCallback, VideoPlaybackDetails, VideoPlaybackEvent, VideoPlaybackEventName, VideoPlayerCompleteAction, VideoPlayerConfiguration, VideoPlayerCTADelay, VideoPlayerCTADelayType, VideoPlayerCTAStyle, VideoPlayerCTAWidth, VideoPlayerSize, VideoPlayerStyle, VideoShopping, };
@@ -0,0 +1,8 @@
1
+ export interface RNAppProps {
2
+ initialRouteName?: string;
3
+ initialParams?: any;
4
+ }
5
+ export default interface PushRNContainerParams {
6
+ appKey: string;
7
+ appProps?: RNAppProps;
8
+ }
@@ -1,5 +1,8 @@
1
1
  import { NativeEventEmitter, NativeModule } from 'react-native';
2
+ import type PushRNContainerParams from '../models/PushRNContainerParams';
2
3
  interface IFWNavigatorModule extends NativeModule {
4
+ pushRNContainer(params: PushRNContainerParams): Promise<boolean>;
5
+ popRNContainer(): Promise<boolean>;
3
6
  popNativeContainer(): Promise<boolean>;
4
7
  canPopNativeContainer(): Promise<boolean>;
5
8
  startFloatingPlayer(): Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-firework-sdk",
3
- "version": "2.4.1-beta.1",
3
+ "version": "2.4.1",
4
4
  "description": "Firework React Native SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -1,4 +1,5 @@
1
1
  import { FWEventName } from './models/FWEventName';
2
+ import type PushRNContainerParams from './models/PushRNContainerParams';
2
3
  import FWNavigatorModule, {
3
4
  FWNavigatorModuleEventEmitter,
4
5
  } from './modules/FWNavigatorModule';
@@ -22,6 +23,25 @@ class FWNavigator {
22
23
  FWNavigatorModuleEventEmitter.addListener(FWEventName.LogMessage, () => {});
23
24
  }
24
25
 
26
+ /**
27
+ * Push a new RN container.
28
+ * You could use this method to make a RN page on top of
29
+ * SDK full-screen player.
30
+ * @param params {PushRNContainerParams}
31
+ * @returns {Promise<boolean>} The result of pushing a new Container.
32
+ */
33
+ public pushRNContainer(params: PushRNContainerParams): Promise<boolean> {
34
+ return FWNavigatorModule.pushRNContainer(params);
35
+ }
36
+
37
+ /**
38
+ * Pop the RN container you pushed before.
39
+ * @returns {Promise<boolean>} The result of popping a new Container.
40
+ */
41
+ public popRNContainer(): Promise<boolean> {
42
+ return FWNavigatorModule.popRNContainer();
43
+ }
44
+
25
45
  /**
26
46
  * Pop the native container. You could use the method to close the fullscreen player.
27
47
  * But if the enablePictureInPicture of the associated video feed is true,
package/src/index.ts CHANGED
@@ -57,6 +57,8 @@ import type {
57
57
  } from './models/ProductInfoViewConfiguration';
58
58
  import type ProductUnit from './models/ProductUnit';
59
59
  import type { ProductPrice, ProductUnitOption } from './models/ProductUnit';
60
+ import type PushRNContainerParams from './models/PushRNContainerParams';
61
+ import type { RNAppProps } from './models/PushRNContainerParams';
60
62
  import type SDKInitOptions from './models/SDKInitOptions';
61
63
  import type { VideoLaunchBehavior } from './models/SDKInitOptions';
62
64
  import type ShoppingCTAResult from './models/ShoppingCTAResult';
@@ -131,6 +133,8 @@ export {
131
133
  ProductPrice,
132
134
  ProductUnit,
133
135
  ProductUnitOption,
136
+ PushRNContainerParams,
137
+ RNAppProps,
134
138
  SDKInitCallback,
135
139
  SDKInitEvent,
136
140
  SDKInitOptions,
@@ -0,0 +1,9 @@
1
+ export interface RNAppProps {
2
+ initialRouteName?: string;
3
+ initialParams?: any;
4
+ }
5
+
6
+ export default interface PushRNContainerParams {
7
+ appKey: string;
8
+ appProps?: RNAppProps;
9
+ }
@@ -1,6 +1,7 @@
1
- import { NativeEventEmitter, NativeModule } from 'react-native';
2
- import { NativeModules } from 'react-native';
1
+ import { NativeEventEmitter, NativeModule, NativeModules } from 'react-native';
2
+
3
3
  import { LINKING_ERROR } from '../constants/FWErrorMessage';
4
+ import type PushRNContainerParams from '../models/PushRNContainerParams';
4
5
 
5
6
  const FWNavigatorModule = NativeModules.FWNavigatorModule
6
7
  ? NativeModules.FWNavigatorModule
@@ -13,6 +14,8 @@ const FWNavigatorModule = NativeModules.FWNavigatorModule
13
14
  }
14
15
  );
15
16
  interface IFWNavigatorModule extends NativeModule {
17
+ pushRNContainer(params: PushRNContainerParams): Promise<boolean>;
18
+ popRNContainer(): Promise<boolean>;
16
19
  popNativeContainer(): Promise<boolean>;
17
20
  canPopNativeContainer(): Promise<boolean>;
18
21
  startFloatingPlayer(): Promise<boolean>;