react-native-firework-sdk 2.17.0-beta.9 → 2.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -82,6 +82,7 @@ android {
82
82
 
83
83
  buildFeatures {
84
84
  viewBinding = true
85
+ buildConfig = true
85
86
  }
86
87
 
87
88
  lintOptions {
@@ -53,13 +53,34 @@ class FWStoryBlockManager : ViewGroupManager<StoryBlockFrameLayout>() {
53
53
  return map
54
54
  }
55
55
 
56
+ override fun receiveCommand(
57
+ root: StoryBlockFrameLayout,
58
+ commandId: Int,
59
+ args: ReadableArray?
60
+ ) {
61
+ super.receiveCommand(root, commandId, args)
62
+ FWLogUtils.d { "FWStoryBlockManager receiveCommand, args (StoryBlockFrameLayout, Int, ReadableArray?), commandId: $commandId, root.isAttachedToWindow: ${root.isAttachedToWindow}" }
63
+ when (commandId) {
64
+ COMMAND_CREATE -> {
65
+ val reactNativeViewId = requireNotNull(args).getInt(0)
66
+ createFragment(root, reactNativeViewId)
67
+ }
68
+ COMMAND_PLAY -> root.storyBlockFragment?.play()
69
+ COMMAND_PAUSE -> root.storyBlockFragment?.pause()
70
+ COMMAND_OPEN_FULL_SCREEN -> root.storyBlockFragment?.openFullscreen()
71
+ COMMAND_ON_VIEWPORT_ENTERED -> root.storyBlockFragment?.onViewportEntered()
72
+ COMMAND_ON_VIEWPORT_LEFT -> root.storyBlockFragment?.onViewportLeft()
73
+ else -> {}
74
+ }
75
+ }
76
+
56
77
  override fun receiveCommand(
57
78
  root: StoryBlockFrameLayout,
58
79
  commandId: String?,
59
80
  args: ReadableArray?
60
81
  ) {
61
82
  super.receiveCommand(root, commandId, args)
62
- FWLogUtils.d { "FWStoryBlockManager receiveCommand commandId: $commandId, root.isAttachedToWindow: ${root.isAttachedToWindow}" }
83
+ FWLogUtils.d { "FWStoryBlockManager receiveCommand, args (StoryBlockFrameLayout, String?, ReadableArray?), commandId: $commandId, root.isAttachedToWindow: ${root.isAttachedToWindow}" }
63
84
  when (commandId?.toInt()) {
64
85
  COMMAND_CREATE -> {
65
86
  val reactNativeViewId = requireNotNull(args).getInt(0)
@@ -289,7 +310,7 @@ class FWStoryBlockManager : ViewGroupManager<StoryBlockFrameLayout>() {
289
310
  super.onDropViewInstance(storyBlockFrameLayout)
290
311
  }
291
312
 
292
- override fun getExportedCustomBubblingEventTypeConstants(): MutableMap<String, Any>? {
313
+ override fun getExportedCustomBubblingEventTypeConstants(): Map<String, Any>? {
293
314
  return MapBuilder.builder<String, Any>()
294
315
  .put(FWStoryBlockEventName.StoryBlockLoadFinished.rawValue, MapBuilder.of("phasedRegistrationNames", MapBuilder.of("bubbled", FWStoryBlockEventName.StoryBlockLoadFinished.rawValue)))
295
316
  .put(FWStoryBlockEventName.StoryBlockFullScreenStateChanged.rawValue, MapBuilder.of("phasedRegistrationNames", MapBuilder.of("bubbled", FWStoryBlockEventName.StoryBlockFullScreenStateChanged.rawValue)))
@@ -242,9 +242,21 @@ class FWVideoFeedManager : SimpleViewManager<FWVideoFeed>() {
242
242
  return map
243
243
  }
244
244
 
245
+ override fun receiveCommand(root: FWVideoFeed, commandId: Int, args: ReadableArray?) {
246
+ super.receiveCommand(root, commandId, args)
247
+ FWLogUtils.d { "FWVideoFeedManager receiveCommand, args (FWVideoFeed, Int, ReadableArray?), commandId: $commandId" }
248
+ when (commandId) {
249
+ COMMAND_REFRESH -> {
250
+ FWLogUtils.d { "FWVideoFeedManager call refresh" }
251
+ root.refresh()
252
+ }
253
+ else -> {}
254
+ }
255
+ }
256
+
245
257
  override fun receiveCommand(root: FWVideoFeed, commandId: String?, args: ReadableArray?) {
246
258
  super.receiveCommand(root, commandId, args)
247
- FWLogUtils.d { "FWVideoFeedManager receiveCommand commandId: $commandId" }
259
+ FWLogUtils.d { "FWVideoFeedManager receiveCommand, args (FWVideoFeed, String?, ReadableArray?), commandId: $commandId" }
248
260
  when (commandId?.toInt()) {
249
261
  COMMAND_REFRESH -> {
250
262
  FWLogUtils.d { "FWVideoFeedManager call refresh" }
@@ -259,7 +271,7 @@ class FWVideoFeedManager : SimpleViewManager<FWVideoFeed>() {
259
271
  * first onVideoFeedLoadFinished is event name
260
272
  * second onVideoFeedLoadFinished is callback prop in JavaScript
261
273
  */
262
- override fun getExportedCustomBubblingEventTypeConstants(): MutableMap<String, Any>? {
274
+ override fun getExportedCustomBubblingEventTypeConstants(): Map<String, Any>? {
263
275
  return MapBuilder.builder<String, Any>()
264
276
  .put(FWFeedViewEventName.VideoFeedLoadFinished.rawValue, MapBuilder.of("phasedRegistrationNames", MapBuilder.of("bubbled", FWFeedViewEventName.VideoFeedLoadFinished.rawValue)))
265
277
  .put(FWFeedViewEventName.VideoFeedEmpty.rawValue, MapBuilder.of("phasedRegistrationNames", MapBuilder.of("bubbled", FWFeedViewEventName.VideoFeedEmpty.rawValue)))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-firework-sdk",
3
- "version": "2.17.0-beta.9",
3
+ "version": "2.17.0",
4
4
  "description": "Firework React Native SDK",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",