react-native-firework-sdk 2.1.0 → 2.2.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.
Files changed (184) hide show
  1. package/FireworkVideoUI.xcframework/Info.plist +40 -0
  2. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  3. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Headers/FireworkVideoUI-Swift.h +280 -0
  4. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Headers/FireworkVideoUI.h +18 -0
  5. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Info.plist +0 -0
  6. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.abi.json +1327 -0
  7. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.private.swiftinterface +41 -0
  8. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  9. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftinterface +41 -0
  10. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/module.modulemap +11 -0
  11. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  12. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Headers/FireworkVideoUI-Swift.h +556 -0
  13. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Headers/FireworkVideoUI.h +18 -0
  14. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Info.plist +0 -0
  15. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.abi.json +1327 -0
  16. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +41 -0
  17. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  18. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +41 -0
  19. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json +1327 -0
  20. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +41 -0
  21. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  22. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +41 -0
  23. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/module.modulemap +11 -0
  24. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +245 -0
  25. package/README.md +1 -1
  26. package/android/build.gradle +1 -2
  27. package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +6 -0
  28. package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/StoryBlockFrameLayout.kt +6 -0
  29. package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModelDeserializer.kt +3 -3
  30. package/android/src/main/java/com/fireworksdk/bridge/models/FWEventName.kt +3 -0
  31. package/android/src/main/java/com/fireworksdk/bridge/models/FWFontInfoModelDeserializer.kt +1 -1
  32. package/android/src/main/java/com/fireworksdk/bridge/models/FWProductInfoViewConfigurationDeserializer.kt +10 -6
  33. package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModelDeserializer.kt +3 -3
  34. package/android/src/main/java/com/fireworksdk/bridge/models/FWShoppingCtaResultDeserializer.kt +2 -2
  35. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModelDeserializer.kt +14 -12
  36. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +1 -0
  37. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModelDeserializer.kt +11 -7
  38. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedSource.kt +1 -0
  39. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlaybackDetails.kt +8 -8
  40. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +1 -0
  41. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt +19 -12
  42. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoShoppingProductDeserializer.kt +11 -11
  43. package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +5 -0
  44. package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +5 -0
  45. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWLiveStreamModule.kt +45 -4
  46. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +2 -0
  47. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +112 -36
  48. package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +7 -4
  49. package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +26 -32
  50. package/android/src/main/java/com/fireworksdk/bridge/utils/FWGlobalDataUtil.kt +6 -0
  51. package/ios/Components/StoryBlock.swift +5 -6
  52. package/ios/Components/StoryBlockManager.m +1 -0
  53. package/ios/Components/StoryBlockManager.swift +4 -0
  54. package/ios/Components/VideoFeed.swift +12 -8
  55. package/ios/Components/VideoFeedManager.m +1 -0
  56. package/ios/Components/VideoFeedManager.swift +4 -0
  57. package/ios/Components/VideoPlayerConfiguration.swift +1 -0
  58. package/ios/FireworkSdk.xcodeproj/project.pbxproj +261 -471
  59. package/ios/FireworkVideoUI/FireworkVideoUI/FireworkVideoUI.docc/FireworkVideoUI.md +13 -0
  60. package/ios/FireworkVideoUI/FireworkVideoUI/FireworkVideoUI.h +18 -0
  61. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/AppLanguageManager.swift +147 -0
  62. package/ios/{Utils/AppLanguage/Bundle+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/Bundle+AppLanguage.swift} +7 -7
  63. package/ios/{Utils/AppLanguage/NumberFormatter+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/NumberFormatter+AppLanguage.swift} +5 -5
  64. package/ios/{Utils/AppLanguage/URLSession+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/URLSession+AppLanguage.swift} +7 -7
  65. package/ios/{Utils/AppLanguage/UIImageView+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIImageView+AppLanguage.swift} +8 -8
  66. package/ios/{Utils/AppLanguage/UILabel+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UILabel+AppLanguage.swift} +17 -17
  67. package/ios/{Utils/AppLanguage/UITextField+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UITextField+AppLanguage.swift} +16 -16
  68. package/ios/{Utils/AppLanguage/UITextView+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UITextView+AppLanguage.swift} +16 -16
  69. package/ios/{Utils/AppLanguage/UIView+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIView+AppLanguage.swift} +7 -7
  70. package/ios/{Utils/AppLanguage/UIViewController+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIViewController+AppLanguage.swift} +19 -5
  71. package/ios/{Utils/AppLanguage/UIWindow+FWSwizzle.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIWindow+AppLanguage.swift} +5 -5
  72. package/ios/{Utils/AppLanguage/FWLanguageUtil.swift → FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/LanguageUtil.swift} +4 -4
  73. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/Foundation/NSObject+LayoutFlip.swift +42 -0
  74. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/CALayer+LayoutFlip.swift +160 -0
  75. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/UILabel+LayoutFlip.swift +35 -0
  76. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/UIView+LayoutFlip.swift +199 -0
  77. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/LayoutFlipManager.swift +59 -0
  78. package/ios/{Utils/Extensions/DispatchQueue+FWOnce.swift → FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/Foundation/DispatchQueue+Once.swift} +4 -4
  79. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/Foundation/String+Base64.swift +18 -0
  80. package/ios/{Utils/Extensions/UIView+FWUIHierarchy.swift → FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/UIKit/UIView+UIHierarchy.swift} +4 -5
  81. package/ios/{Utils/FWSwizzleUtil.swift → FireworkVideoUI/FireworkVideoUI/Sources/Utils/Swizzle.swift} +2 -2
  82. package/ios/FireworkVideoUI/FireworkVideoUI.xcodeproj/project.pbxproj +766 -0
  83. package/ios/FireworkVideoUI/FireworkVideoUI.xcworkspace/contents.xcworkspacedata +10 -0
  84. package/ios/FireworkVideoUI/FireworkVideoUI.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  85. package/ios/FireworkVideoUI/FireworkVideoUITests/FireworkVideoUITests.swift +37 -0
  86. package/ios/FireworkVideoUI/Podfile +15 -0
  87. package/ios/FireworkVideoUI/Podfile.lock +16 -0
  88. package/ios/Models/NativeToRN/FireworkEventName.swift +4 -0
  89. package/ios/Models/NativeToRN/FireworkSDK+Json.swift +5 -1
  90. package/ios/Models/RNToNative/RCTConvert+StoryBlock.swift +2 -1
  91. package/ios/Models/RNToNative/RCTConvert+VideoFeed.swift +2 -1
  92. package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +8 -100
  93. package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +34 -16
  94. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +23 -7
  95. package/ios/Modules/FireworkSDKModule/SDKInitOptions.swift +0 -1
  96. package/ios/Modules/LiveStream/LiveStreamModule.swift +1 -0
  97. package/ios/Modules/Shopping/ProductInfoViewConfiguration.swift +0 -8
  98. package/ios/Modules/Shopping/ShoppingModule.swift +0 -18
  99. package/ios/Support/MultiHostStreaming/FWMultiHostStreaming.podspec +4 -6
  100. package/ios/Utils/Extensions/Swizzle/UINavigationController+FWSwizzle.swift +4 -1
  101. package/ios/scripts/react_native_firework_sdk_pods.rb +22 -26
  102. package/lib/commonjs/FireworkSDK.js +40 -17
  103. package/lib/commonjs/FireworkSDK.js.map +1 -1
  104. package/lib/commonjs/LiveStream.js +2 -2
  105. package/lib/commonjs/LiveStream.js.map +1 -1
  106. package/lib/commonjs/VideoShopping.js +1 -1
  107. package/lib/commonjs/VideoShopping.js.map +1 -1
  108. package/lib/commonjs/components/StoryBlock.js +9 -9
  109. package/lib/commonjs/components/StoryBlock.js.map +1 -1
  110. package/lib/commonjs/components/VideoFeed.js +6 -4
  111. package/lib/commonjs/components/VideoFeed.js.map +1 -1
  112. package/lib/commonjs/index.js.map +1 -1
  113. package/lib/commonjs/models/FWEventName.js +1 -0
  114. package/lib/commonjs/models/FWEventName.js.map +1 -1
  115. package/lib/commonjs/models/VideoPlaybackEventName.js +3 -0
  116. package/lib/commonjs/models/VideoPlaybackEventName.js.map +1 -1
  117. package/lib/module/FireworkSDK.js +39 -17
  118. package/lib/module/FireworkSDK.js.map +1 -1
  119. package/lib/module/LiveStream.js +2 -2
  120. package/lib/module/LiveStream.js.map +1 -1
  121. package/lib/module/VideoShopping.js +1 -1
  122. package/lib/module/VideoShopping.js.map +1 -1
  123. package/lib/module/components/StoryBlock.js +9 -7
  124. package/lib/module/components/StoryBlock.js.map +1 -1
  125. package/lib/module/components/VideoFeed.js +6 -4
  126. package/lib/module/components/VideoFeed.js.map +1 -1
  127. package/lib/module/index.js.map +1 -1
  128. package/lib/module/models/FWEventName.js +1 -0
  129. package/lib/module/models/FWEventName.js.map +1 -1
  130. package/lib/module/models/VideoPlaybackEventName.js +3 -0
  131. package/lib/module/models/VideoPlaybackEventName.js.map +1 -1
  132. package/lib/typescript/FireworkSDK.d.ts +8 -4
  133. package/lib/typescript/LiveStream.d.ts +2 -2
  134. package/lib/typescript/VideoShopping.d.ts +1 -1
  135. package/lib/typescript/components/StoryBlock.d.ts +7 -0
  136. package/lib/typescript/components/VideoFeed.d.ts +7 -0
  137. package/lib/typescript/index.d.ts +2 -2
  138. package/lib/typescript/models/FWEventName.d.ts +1 -0
  139. package/lib/typescript/models/ProductInfoViewConfiguration.d.ts +0 -31
  140. package/lib/typescript/models/SDKInitOptions.d.ts +6 -1
  141. package/lib/typescript/models/StoryBlockSource.d.ts +1 -1
  142. package/lib/typescript/models/VideoFeedSource.d.ts +1 -1
  143. package/lib/typescript/models/VideoPlaybackDetails.d.ts +16 -0
  144. package/lib/typescript/models/VideoPlaybackEventName.d.ts +13 -1
  145. package/lib/typescript/models/VideoPlayerConfiguration.d.ts +4 -0
  146. package/package.json +7 -2
  147. package/react-native-firework-sdk.podspec +10 -5
  148. package/src/FireworkSDK.ts +41 -15
  149. package/src/LiveStream.ts +2 -2
  150. package/src/VideoShopping.ts +1 -1
  151. package/src/components/StoryBlock.tsx +12 -3
  152. package/src/components/VideoFeed.tsx +12 -4
  153. package/src/index.ts +0 -2
  154. package/src/models/FWEventName.ts +1 -0
  155. package/src/models/ProductInfoViewConfiguration.ts +0 -32
  156. package/src/models/SDKInitOptions.ts +6 -1
  157. package/src/models/StoryBlockSource.ts +2 -1
  158. package/src/models/VideoFeedSource.ts +2 -1
  159. package/src/models/VideoPlaybackDetails.ts +16 -0
  160. package/src/models/VideoPlaybackEventName.ts +13 -1
  161. package/src/models/VideoPlayerConfiguration.ts +4 -0
  162. package/ios/Utils/AppLanguage/FWAppLanguageManager.swift +0 -139
  163. package/ios/Utils/FWRTL/Classes/Manager/FWRTLManager.h +0 -25
  164. package/ios/Utils/FWRTL/Classes/Manager/FWRTLManager.m +0 -75
  165. package/ios/Utils/FWRTL/Classes/UICategories/CALayer+FWRTL.h +0 -21
  166. package/ios/Utils/FWRTL/Classes/UICategories/CALayer+FWRTL.m +0 -124
  167. package/ios/Utils/FWRTL/Classes/UICategories/FWRTLRemoteViewControllerAdaptor.h +0 -11
  168. package/ios/Utils/FWRTL/Classes/UICategories/FWRTLRemoteViewControllerAdaptor.m +0 -86
  169. package/ios/Utils/FWRTL/Classes/UICategories/FWRTLWhiteListManager.h +0 -16
  170. package/ios/Utils/FWRTL/Classes/UICategories/FWRTLWhiteListManager.m +0 -55
  171. package/ios/Utils/FWRTL/Classes/UICategories/UILabel+FWRTL.h +0 -18
  172. package/ios/Utils/FWRTL/Classes/UICategories/UILabel+FWRTL.m +0 -39
  173. package/ios/Utils/FWRTL/Classes/UICategories/UIView+FWRTL.h +0 -54
  174. package/ios/Utils/FWRTL/Classes/UICategories/UIView+FWRTL.m +0 -141
  175. package/ios/Utils/FWRTL/Classes/UICategories/UIWindow+FWRTL.h +0 -16
  176. package/ios/Utils/FWRTL/Classes/UICategories/UIWindow+FWRTL.m +0 -20
  177. package/ios/Utils/FWRTL/Classes/Utils/FWRTLDefinitions.h +0 -52
  178. package/ios/Utils/FWRTL/Classes/Utils/NSObject+FWRTLReloadBlock.h +0 -19
  179. package/ios/Utils/FWRTL/Classes/Utils/NSObject+FWRTLReloadBlock.m +0 -49
  180. package/ios/Utils/FWRTL/Classes/Utils/NSString+FWRTL.h +0 -21
  181. package/ios/Utils/FWRTL/Classes/Utils/NSString+FWRTL.m +0 -38
  182. package/ios/Utils/FWRTL/Classes/Utils/UIImage+FWRTL.h +0 -18
  183. package/ios/Utils/FWRTL/Classes/Utils/UIImage+FWRTL.m +0 -43
  184. /package/ios/Support/MultiHostStreaming/{src → Sources}/MultiHostStreamingSDK.swift +0 -0
@@ -14,6 +14,7 @@ object FWVideoPlayerConfigModelDeserializer {
14
14
  private const val SHOW_BRANDING_KEY = "showBranding"
15
15
  private const val CTA_DELAY_KEY = "ctaDelay"
16
16
  private const val CTA_HIGHLIGHT_DELAY_KEY = "ctaHighlightDelay"
17
+ private const val SHARE_BASE_URL_KEY = "shareBaseURL"
17
18
 
18
19
  private const val BACKGROUND_COLOR_KEY = "backgroundColor"
19
20
  private const val FONT_SIZE_KEY = "fontSize"
@@ -25,16 +26,17 @@ object FWVideoPlayerConfigModelDeserializer {
25
26
  fun deserialize(responseJson: JSONObject?): FWVideoPlayerConfigModel? {
26
27
  responseJson ?: return null
27
28
 
28
- val playerStyle = responseJson.optString(PLAYER_STYLE_KEY)
29
- val videoCompleteAction = responseJson.optString(VIDEO_COMPLETE_ACTION_KEY)
30
- val showShareButton = responseJson.optBoolean(SHOW_SHARE_BUTTON_KEY)
29
+ val playerStyle = if (responseJson.has(PLAYER_STYLE_KEY)) responseJson.optString(PLAYER_STYLE_KEY) else null
30
+ val videoCompleteAction = if (responseJson.has(VIDEO_COMPLETE_ACTION_KEY)) responseJson.optString(VIDEO_COMPLETE_ACTION_KEY) else null
31
+ val showShareButton = if (responseJson.has(SHOW_SHARE_BUTTON_KEY)) responseJson.optBoolean(SHOW_SHARE_BUTTON_KEY) else null
31
32
  val ctaButtonStyle = deserializeCtaButtonStyle(responseJson.optJSONObject(CTA_BUTTON_STYLE_KEY))
32
- val showMuteButton = responseJson.optBoolean(SHOW_MUTE_BUTTON_KEY)
33
- val showPlaybackButton = responseJson.optBoolean(SHOW_PLAYBACK_BUTTON_KEY)
34
- val launchBehavior = responseJson.optString(LAUNCH_BEHAVIOR_KEY)
35
- val showBranding = responseJson.optBoolean(SHOW_BRANDING_KEY)
33
+ val showMuteButton = if (responseJson.has(SHOW_MUTE_BUTTON_KEY)) responseJson.optBoolean(SHOW_MUTE_BUTTON_KEY) else null
34
+ val showPlaybackButton = if (responseJson.has(SHOW_PLAYBACK_BUTTON_KEY)) responseJson.optBoolean(SHOW_PLAYBACK_BUTTON_KEY) else null
35
+ val launchBehavior = if (responseJson.has(LAUNCH_BEHAVIOR_KEY)) responseJson.optString(LAUNCH_BEHAVIOR_KEY) else null
36
+ val showBranding = if (responseJson.has(SHOW_BRANDING_KEY)) responseJson.optBoolean(SHOW_BRANDING_KEY) else null
36
37
  val ctaDelay = deserializeCtaDelay(responseJson.optJSONObject(CTA_DELAY_KEY))
37
38
  val ctaHighlightDelay = deserializeCtaDelay(responseJson.optJSONObject(CTA_HIGHLIGHT_DELAY_KEY))
39
+ val shareBaseUrl = if (responseJson.has(SHARE_BASE_URL_KEY)) responseJson.optString(SHARE_BASE_URL_KEY) else null
38
40
 
39
41
  return FWVideoPlayerConfigModel(
40
42
  playerStyle = playerStyle,
@@ -47,13 +49,16 @@ object FWVideoPlayerConfigModelDeserializer {
47
49
  showBranding = showBranding,
48
50
  ctaDelay = ctaDelay,
49
51
  ctaHighlightDelay = ctaHighlightDelay,
52
+ shareBaseUrl = shareBaseUrl,
50
53
  )
51
54
  }
52
55
 
53
56
  private fun deserializeCtaButtonStyle(ctaButtonStyleJson: JSONObject?): FWVideoPlayerConfigModel.FWCtaButtonStyleModel {
54
- val backgroundColor = ctaButtonStyleJson?.optString(BACKGROUND_COLOR_KEY)
55
- val fontSize = ctaButtonStyleJson?.optInt(FONT_SIZE_KEY)
56
- val textColor = ctaButtonStyleJson?.optString(TEXT_COLOR_KEY)
57
+ ctaButtonStyleJson ?: return FWVideoPlayerConfigModel.FWCtaButtonStyleModel()
58
+
59
+ val backgroundColor = if (ctaButtonStyleJson.has(BACKGROUND_COLOR_KEY)) ctaButtonStyleJson.optString(BACKGROUND_COLOR_KEY) else null
60
+ val fontSize = if (ctaButtonStyleJson.has(FONT_SIZE_KEY)) ctaButtonStyleJson.optInt(FONT_SIZE_KEY) else null
61
+ val textColor = if (ctaButtonStyleJson.has(TEXT_COLOR_KEY)) ctaButtonStyleJson.optString(TEXT_COLOR_KEY) else null
57
62
 
58
63
  return FWVideoPlayerConfigModel.FWCtaButtonStyleModel(
59
64
  backgroundColor = backgroundColor,
@@ -63,8 +68,10 @@ object FWVideoPlayerConfigModelDeserializer {
63
68
  }
64
69
 
65
70
  private fun deserializeCtaDelay(ctaDelayJson: JSONObject?): FWVideoPlayerConfigModel.FWCtaDelayModel {
66
- val type = ctaDelayJson?.optString(TYPE_KEY)
67
- val value = ctaDelayJson?.optDouble(VALUE_KEY)
71
+ ctaDelayJson ?: return FWVideoPlayerConfigModel.FWCtaDelayModel()
72
+
73
+ val type = if (ctaDelayJson.has(TYPE_KEY)) ctaDelayJson.optString(TYPE_KEY) else null
74
+ val value = if (ctaDelayJson.has(VALUE_KEY)) ctaDelayJson.optDouble(VALUE_KEY) else null
68
75
 
69
76
  return FWVideoPlayerConfigModel.FWCtaDelayModel(
70
77
  type = type,
@@ -35,9 +35,9 @@ object FWVideoShoppingProductDeserializer {
35
35
 
36
36
  fun deserialize(responseJson: JSONObject?): FWVideoShoppingProduct? {
37
37
  responseJson ?: return null
38
- val productId = responseJson.optString(PRODUCT_ID_KEY)
39
- val name = responseJson.optString(NAME_KEY)
40
- val description = responseJson.optString(DESCRIPTION_KEY)
38
+ val productId = if (responseJson.has(PRODUCT_ID_KEY)) responseJson.optString(PRODUCT_ID_KEY) else null
39
+ val name = if (responseJson.has(NAME_KEY)) responseJson.optString(NAME_KEY) else null
40
+ val description = if (responseJson.has(DESCRIPTION_KEY)) responseJson.optString(DESCRIPTION_KEY) else null
41
41
  val units = deserializeUnits(responseJson.optJSONArray(UNITS_KEY))
42
42
  val isAvailable = responseJson.optBoolean(IS_AVAILABLE_KEY, true)
43
43
 
@@ -63,11 +63,11 @@ object FWVideoShoppingProductDeserializer {
63
63
 
64
64
  private fun deserializeUnit(unitsJsonObject: JSONObject?): FWVideoShoppingProduct.FWVideoProductUnit? {
65
65
  unitsJsonObject ?: return null
66
- val unitId = unitsJsonObject.optString(UNIT_ID_KEY)
67
- val name = unitsJsonObject.optString(NAME_KEY)
66
+ val unitId = if (unitsJsonObject.has(UNIT_ID_KEY)) unitsJsonObject.optString(UNIT_ID_KEY) else null
67
+ val name = if (unitsJsonObject.has(NAME_KEY)) unitsJsonObject.optString(NAME_KEY) else null
68
68
  val price = deserializePrice(unitsJsonObject.optJSONObject(PRICE_KEY))
69
- val url = unitsJsonObject.optString(URL_KEY)
70
- val imageUrl = unitsJsonObject.optString(IMAGE_URL_KEY)
69
+ val url = if (unitsJsonObject.has(URL_KEY)) unitsJsonObject.optString(URL_KEY) else null
70
+ val imageUrl = if (unitsJsonObject.has(IMAGE_URL_KEY)) unitsJsonObject.optString(IMAGE_URL_KEY) else null
71
71
  val options = deserializeOptions(unitsJsonObject.optJSONArray(OPTIONS_KEY))
72
72
  val isAvailable = unitsJsonObject.optBoolean(IS_AVAILABLE_KEY, true)
73
73
 
@@ -85,8 +85,8 @@ object FWVideoShoppingProductDeserializer {
85
85
 
86
86
  private fun deserializePrice(priceJsonObject: JSONObject?): FWVideoShoppingProduct.FWVideoProductPrice? {
87
87
  priceJsonObject ?: return null
88
- val amount = priceJsonObject.optDouble(AMOUNT_KEY)
89
- val currencyCode = priceJsonObject.optString(CURRENCY_CODE_KEY)
88
+ val amount = if (priceJsonObject.has(AMOUNT_KEY)) priceJsonObject.optDouble(AMOUNT_KEY) else null
89
+ val currencyCode = if (priceJsonObject.has(CURRENCY_CODE_KEY)) priceJsonObject.optString(CURRENCY_CODE_KEY) else null
90
90
 
91
91
  return FWVideoShoppingProduct.FWVideoProductPrice(
92
92
  amount = amount,
@@ -108,8 +108,8 @@ object FWVideoShoppingProductDeserializer {
108
108
 
109
109
  private fun deserializeOption(optionJsonObject: JSONObject?): FWVideoShoppingProduct.FWVideoProductOption? {
110
110
  optionJsonObject ?: return null
111
- val name = optionJsonObject.optString(NAME_KEY)
112
- val value = optionJsonObject.optString(VALUE_KEY)
111
+ val name = if (optionJsonObject.has(NAME_KEY)) optionJsonObject.optString(NAME_KEY) else null
112
+ val value = if (optionJsonObject.has(VALUE_KEY)) optionJsonObject.optString(VALUE_KEY) else null
113
113
 
114
114
  return FWVideoShoppingProduct.FWVideoProductOption(
115
115
  name = name,
@@ -82,6 +82,11 @@ class FWStoryBlockManager(
82
82
  view.setPlaylist(playlist)
83
83
  }
84
84
 
85
+ @ReactProp(name = "hashtagFilterExpression")
86
+ fun setHashtagFilterExpression(view: StoryBlockFrameLayout, hashtagFilterExpression: String?) {
87
+ view.setHashtagFilterExpressionProps(hashtagFilterExpression)
88
+ }
89
+
85
90
  @ReactProp(name = "dynamicContentParameters")
86
91
  fun setDynamicContentParameters(view: StoryBlockFrameLayout, parameters: ReadableMap?) {
87
92
  val parametersMap = parameters?.toHashMap() as? HashMap<String, List<String>>
@@ -66,6 +66,11 @@ class FWVideoFeedManager : SimpleViewManager<FWVideoFeed>() {
66
66
  view.setPlaylistGroupProps(playlistGroup)
67
67
  }
68
68
 
69
+ @ReactProp(name = "hashtagFilterExpression")
70
+ fun setHashtagFilterExpression(view: FWVideoFeed, hashtagFilterExpression: String?) {
71
+ view.setHashtagFilterExpressionProps(hashtagFilterExpression)
72
+ }
73
+
69
74
  @ReactProp(name = "mode")
70
75
  fun setMode(view: FWVideoFeed, mode: String?) {
71
76
  view.setModeProps(mode)
@@ -3,7 +3,14 @@ package com.fireworksdk.bridge.reactnative.module
3
3
  import com.facebook.react.bridge.ReactApplicationContext
4
4
  import com.facebook.react.bridge.ReactContextBaseJavaModule
5
5
  import com.facebook.react.bridge.ReactMethod
6
+ import com.firework.analyticsevents.livestream.LivestreamAnalyticEvent
7
+ import com.firework.bus.FwAnalyticCallable
8
+ import com.firework.sdk.FireworkSdk
9
+ import com.fireworksdk.bridge.models.FWLiveStreamEventDetailsModel
10
+ import com.fireworksdk.bridge.models.FWLiveStreamEventName
11
+ import com.fireworksdk.bridge.models.FWLiveStreamMessageDetailsModel
6
12
  import com.fireworksdk.bridge.reactnative.models.FWLiveStreamInterface
13
+ import com.fireworksdk.bridge.reactnative.utils.FWEventUtils
7
14
  import com.fireworksdk.bridge.utils.FWLogUtils
8
15
 
9
16
 
@@ -13,14 +20,48 @@ class FWLiveStreamModule(
13
20
 
14
21
  @ReactMethod
15
22
  override fun init() {
16
- addFireworkLiveStreamEventListener()
23
+ FireworkSdk.analytics.register(this)
17
24
  }
18
25
 
19
- private fun addFireworkLiveStreamEventListener() {
20
-
26
+ @FwAnalyticCallable
27
+ fun onLivestreamEvent(event: LivestreamAnalyticEvent) {
28
+ when (event) {
29
+ is LivestreamAnalyticEvent.UserSentChatMessage -> {
30
+ FWLogUtils.d { "userSentChat: $event" }
31
+ FWEventUtils.sendLiveStreamChatEvent(
32
+ reactApplicationContext,
33
+ FWLiveStreamEventName.UserSendChat.rawValue,
34
+ FWLiveStreamMessageDetailsModel(event.messageId, event.username, event.messageText),
35
+ FWLiveStreamEventDetailsModel(event.livestreamId)
36
+ )
37
+ }
38
+ is LivestreamAnalyticEvent.UserJoined -> {
39
+ FWLogUtils.d { "userJoined: $event" }
40
+ FWEventUtils.sendLiveStreamEvent(
41
+ reactApplicationContext,
42
+ FWLiveStreamEventName.UserJoin.rawValue,
43
+ FWLiveStreamEventDetailsModel(event.livestreamId)
44
+ )
45
+ }
46
+ is LivestreamAnalyticEvent.UserLeft -> {
47
+ FWLogUtils.d { "userLeft: $event" }
48
+ FWEventUtils.sendLiveStreamEvent(
49
+ reactApplicationContext,
50
+ FWLiveStreamEventName.UserLeave.rawValue,
51
+ FWLiveStreamEventDetailsModel(event.livestreamId)
52
+ )
53
+ }
54
+ is LivestreamAnalyticEvent.UserSentLike -> {
55
+ FWLogUtils.d { "userSentLike: $event" }
56
+ FWEventUtils.sendLiveStreamEvent(
57
+ reactApplicationContext,
58
+ FWLiveStreamEventName.UserSendLike.rawValue,
59
+ FWLiveStreamEventDetailsModel(event.livestreamId)
60
+ )
61
+ }
62
+ }
21
63
  }
22
64
 
23
-
24
65
  @ReactMethod
25
66
  fun addListener(eventName: String?) {
26
67
  // Set up any upstream listeners or background tasks as necessary
@@ -112,6 +112,8 @@ class FWVideoShoppingModule(
112
112
  else unit.price.currencyCode
113
113
 
114
114
  variant(variantId) {
115
+ imageUrl((vpu.imageUrl ?: unit.image?.url) ?: "")
116
+ url(vpu.url ?: unit.url)
115
117
  currency(currency)
116
118
  price(price = vpu.price?.amount ?: unit.price.amount)
117
119
  name((vpu.name ?: unit.name) ?: "")
@@ -11,11 +11,13 @@ import android.os.Process
11
11
  import android.provider.Settings
12
12
  import android.util.Base64
13
13
  import com.facebook.react.bridge.*
14
+ import com.firework.analyticsevents.cta.CtaButtonClickAnalyticsEvent
15
+ import com.firework.analyticsevents.player.PlayerLifecycleAnalyticsEvent
16
+ import com.firework.analyticsevents.share.ShareButtonAnalyticsEvent
17
+ import com.firework.bus.FwAnalyticCallable
14
18
  import com.firework.imageloading.glide.GlideImageLoaderFactory
15
19
  import com.firework.livestream.multihost.MultihostLivestreamPlayerInitializer
16
20
  import com.firework.livestream.singlehost.LivestreamPlayerInitializer
17
- import com.firework.player.lifecycle.LifecycleState
18
- import com.firework.player.lifecycle.PlaybackLifecycleObserver
19
21
  import com.firework.sdk.FireworkSdk
20
22
  import com.firework.sdk.FireworkSdkConfig
21
23
  import com.fireworksdk.bridge.FWInitializationProvider
@@ -57,8 +59,8 @@ class FireworkSDKModule(
57
59
  val sdkInitOptionsModel = FWSDKInitOptionsModelDeserializer.deserialize(jsonObject)
58
60
 
59
61
  initSdk(sdkInitOptionsModel)
60
- handleCustomCTAClick()
61
62
  promise.resolve(Arguments.createMap())
63
+ FireworkSdk.analytics.register(this)
62
64
  }
63
65
 
64
66
  /**
@@ -97,6 +99,9 @@ class FireworkSDKModule(
97
99
  */
98
100
  @ReactMethod
99
101
  override fun setShareBaseURL(url: String?, promise: Promise) {
102
+ url?.let {
103
+ FWGlobalDataUtil.shareBaseUrl = it
104
+ }
100
105
  promise.resolve(Arguments.createMap())
101
106
  }
102
107
 
@@ -117,7 +122,6 @@ class FireworkSDKModule(
117
122
  @ReactMethod
118
123
  override fun setVideoPlaybackEventEnabled(value: Boolean?) {
119
124
  FWGlobalDataUtil.videoPlaybackEventEnabled = value?:false
120
- handleVideoPlaybackEvent()
121
125
  }
122
126
 
123
127
  private fun initSdk(sdkInitOptions: FWSDKInitOptionsModel?) {
@@ -145,7 +149,7 @@ class FireworkSDKModule(
145
149
  // .shareBaseUrl("https://www.mytest.com")
146
150
  // .muteOnLaunch(true)
147
151
  shareBaseURL?.let {
148
- configBuilder.shareBaseUrl(it)
152
+ FWGlobalDataUtil.shareBaseUrl = it
149
153
  }
150
154
  when (videoLaunchBehavior) {
151
155
  FWVideoPlayerConstant.FW_PLAYER_LAUNCH_BEHAVIOR_DEFAULT -> {}
@@ -196,54 +200,132 @@ class FireworkSDKModule(
196
200
  return Base64.encodeToString(hash, Base64.DEFAULT)
197
201
  }
198
202
 
199
- private fun handleCustomCTAClick() {
200
- FireworkSdk.setCtaButtonClickHandler { _, actionUrl, _ ->
201
-
202
- FWEventUtils.sendLogMessageEvent(reactApplicationContext, "[Android] Receive CustomCTAClick event ${FWDateUtils.getDateString(
203
- Date()
204
- )}")
203
+ @FwAnalyticCallable
204
+ fun onCtaButtonClicked(event: CtaButtonClickAnalyticsEvent) {
205
+ FWEventUtils.sendLogMessageEvent(reactApplicationContext, "[Android] Receive CustomCTAClick event ${FWDateUtils.getDateString(
206
+ Date()
207
+ )}")
208
+
209
+ if (FWGlobalDataUtil.videoPlaybackEventEnabled) {
210
+ FWEventUtils.sendVideoPlaybackEvent(
211
+ reactApplicationContext,
212
+ FWVideoPlaybackSubEventName.ClickCTA.rawValue,
213
+ FWVideoPlaybackDetails(
214
+ badge = event.videoInfo.badge,
215
+ caption = event.videoInfo.caption,
216
+ duration = event.videoInfo.duration,
217
+ hasCta = true,
218
+ height = event.videoInfo.playerHeight,
219
+ width = event.videoInfo.playerWidth,
220
+ videoId = event.videoInfo.id,
221
+ )
222
+ )
223
+ }
205
224
 
206
- FWEventUtils.sendCustomCTAClickEvent(reactApplicationContext, actionUrl)
225
+ FWEventUtils.sendCustomCTAClickEvent(reactApplicationContext, event.actionUrl)
207
226
 
208
- if (!appComponentName.isNullOrBlank() && !customCTALinkContentPageRouteName.isNullOrBlank()) {
209
- val activity = FWInitializationProvider.INSTANCE.resumedActivity
227
+ if (!FWGlobalDataUtil.appComponentName.isNullOrBlank() && !FWGlobalDataUtil.customCTALinkContentPageRouteName.isNullOrBlank()) {
228
+ val activity = FWInitializationProvider.INSTANCE.resumedActivity
210
229
 
211
- activity?.startActivity(
212
- FWContainerActivity.createIntent(activity, appComponentName,
230
+ activity?.startActivity(
231
+ FWContainerActivity.createIntent(activity, FWGlobalDataUtil.appComponentName,
213
232
  hashMapOf(
214
- "initialRouteName" to customCTALinkContentPageRouteName,
215
- "initialParams" to hashMapOf("url" to actionUrl)
233
+ "initialRouteName" to FWGlobalDataUtil.customCTALinkContentPageRouteName,
234
+ "initialParams" to hashMapOf("url" to event.actionUrl)
216
235
  )
217
236
  ))
218
- return@setCtaButtonClickHandler true
219
- }
237
+ }
238
+ }
220
239
 
221
- return@setCtaButtonClickHandler FWGlobalDataUtil.customCTAClickEnabled
240
+ @FwAnalyticCallable
241
+ fun onShareButtonClicked(event: ShareButtonAnalyticsEvent) {
242
+ if (FWGlobalDataUtil.videoPlaybackEventEnabled) {
243
+ FWEventUtils.sendVideoPlaybackEvent(
244
+ reactApplicationContext,
245
+ FWVideoPlaybackSubEventName.ClickShare.rawValue,
246
+ FWVideoPlaybackDetails(
247
+ badge = event.videoInfo.badge,
248
+ caption = event.videoInfo.caption,
249
+ duration = event.videoInfo.duration,
250
+ hasCta = event.videoInfo.hasCta,
251
+ height = event.videoInfo.playerHeight,
252
+ width = event.videoInfo.playerWidth,
253
+ videoId = event.videoInfo.id,
254
+ )
255
+ )
222
256
  }
223
257
  }
224
258
 
225
- private fun handleVideoPlaybackEvent() {
259
+ @FwAnalyticCallable
260
+ fun onPlaybackEvent(event: PlayerLifecycleAnalyticsEvent) {
226
261
  if (!FWGlobalDataUtil.videoPlaybackEventEnabled) {
227
262
  return
228
263
  }
229
- FireworkSdk.registerPlaybackLifecycleObserver(object : PlaybackLifecycleObserver {
230
- override fun onStateChanged(lifecycleState: LifecycleState) {
231
- FWLogUtils.d { "onStateChanged: $lifecycleState - ${lifecycleState.playable.id}" }
232
- val playable = lifecycleState.playable
233
-
264
+ val progress = event.progress
265
+
266
+ val videoPlaybackDetails = FWVideoPlaybackDetails(
267
+ badge = event.videoInfo.badge,
268
+ caption = event.videoInfo.caption,
269
+ duration = event.videoInfo.duration,
270
+ hasCta = event.videoInfo.hasCta,
271
+ height = event.videoInfo.playerHeight,
272
+ width = event.videoInfo.playerWidth,
273
+ videoId = event.videoInfo.id,
274
+ progress = progress
275
+ )
276
+ when (event) {
277
+ is PlayerLifecycleAnalyticsEvent.OnStarted -> {
278
+ if (event.videoInfo.isAd) {
279
+ FWEventUtils.sendVideoPlaybackEvent(reactApplicationContext, FWVideoPlaybackSubEventName.AdStart.rawValue, videoPlaybackDetails)
280
+ } else {
281
+ FWEventUtils.sendVideoPlaybackEvent(reactApplicationContext, FWVideoPlaybackSubEventName.Start.rawValue, videoPlaybackDetails)
282
+ }
283
+ }
284
+ is PlayerLifecycleAnalyticsEvent.OnPrepared -> {
285
+ FWEventUtils.sendVideoPlaybackEvent(reactApplicationContext, FWVideoPlaybackSubEventName.Impression.rawValue, videoPlaybackDetails)
234
286
  }
235
- })
287
+ is PlayerLifecycleAnalyticsEvent.OnBuffering -> {}
288
+ is PlayerLifecycleAnalyticsEvent.OnIdle -> {}
289
+ is PlayerLifecycleAnalyticsEvent.OnRepeat -> {}
290
+ is PlayerLifecycleAnalyticsEvent.OnEnded -> {
291
+ if (event.videoInfo.isAd) {
292
+ FWEventUtils.sendVideoPlaybackEvent(reactApplicationContext, FWVideoPlaybackSubEventName.AdEnd.rawValue, videoPlaybackDetails)
293
+ } else {
294
+ FWEventUtils.sendVideoPlaybackEvent(reactApplicationContext, FWVideoPlaybackSubEventName.Complete.rawValue, videoPlaybackDetails)
295
+ }
296
+ }
297
+ is PlayerLifecycleAnalyticsEvent.OnError -> {}
298
+ is PlayerLifecycleAnalyticsEvent.OnSeek -> {}
299
+ is PlayerLifecycleAnalyticsEvent.OnVideoSizeChanged -> {}
300
+ is PlayerLifecycleAnalyticsEvent.OnFirstQuartile -> {
301
+ FWEventUtils.sendVideoPlaybackEvent(reactApplicationContext, FWVideoPlaybackSubEventName.FirstQuartile.rawValue, videoPlaybackDetails)
302
+ }
303
+ is PlayerLifecycleAnalyticsEvent.OnSecondQuartile -> {
304
+ FWEventUtils.sendVideoPlaybackEvent(reactApplicationContext, FWVideoPlaybackSubEventName.Midpoint.rawValue, videoPlaybackDetails)
305
+ }
306
+ is PlayerLifecycleAnalyticsEvent.OnThirdQuartile -> {
307
+ FWEventUtils.sendVideoPlaybackEvent(reactApplicationContext, FWVideoPlaybackSubEventName.ThirdQuartile.rawValue, videoPlaybackDetails)
308
+ }
309
+ is PlayerLifecycleAnalyticsEvent.OnPlaybackProgressChanged -> {}
310
+ is PlayerLifecycleAnalyticsEvent.OnPaused -> {
311
+ FWEventUtils.sendVideoPlaybackEvent(reactApplicationContext, FWVideoPlaybackSubEventName.Pause.rawValue, videoPlaybackDetails)
312
+ }
313
+ is PlayerLifecycleAnalyticsEvent.OnResumed -> {
314
+ FWEventUtils.sendVideoPlaybackEvent(reactApplicationContext, FWVideoPlaybackSubEventName.Resume.rawValue, videoPlaybackDetails)
315
+ }
316
+ else -> {}
317
+ }
236
318
  }
237
319
 
238
320
  @ReactMethod
239
321
  override fun setCustomCTALinkContentPageRouteName(name: String?, promise: Promise) {
240
- customCTALinkContentPageRouteName = name
322
+ FWGlobalDataUtil.customCTALinkContentPageRouteName = name
241
323
  promise.resolve(Arguments.createMap())
242
324
  }
243
325
 
244
326
  @ReactMethod
245
327
  override fun setAppComponentName(name: String?, promise: Promise) {
246
- appComponentName = name
328
+ FWGlobalDataUtil.appComponentName = name
247
329
  promise.resolve(Arguments.createMap())
248
330
  }
249
331
 
@@ -313,10 +395,4 @@ class FireworkSDKModule(
313
395
  return "FireworkSDK"
314
396
  }
315
397
 
316
- companion object {
317
- var appComponentName: String? = null
318
- var customCTALinkContentPageRouteName: String? = null
319
- var initSuccess: Boolean = false
320
- }
321
-
322
398
  }
@@ -7,9 +7,9 @@ import com.facebook.react.uimanager.events.RCTEventEmitter
7
7
  import com.firework.common.product.Product
8
8
  import com.fireworksdk.bridge.models.*
9
9
  import com.fireworksdk.bridge.FWInitializationProvider
10
- import com.fireworksdk.bridge.reactnative.module.FireworkSDKModule
11
10
  import com.fireworksdk.bridge.reactnative.pages.FWContainerActivity
12
11
  import com.fireworksdk.bridge.utils.FWDateUtils
12
+ import com.fireworksdk.bridge.utils.FWGlobalDataUtil
13
13
  import com.fireworksdk.bridge.utils.FWLogUtils
14
14
  import java.util.*
15
15
 
@@ -19,7 +19,7 @@ object FWEventUtils {
19
19
  FWLogUtils.d { "FWNavigatorModule pushNativeContainer: $props" }
20
20
  val activity = FWInitializationProvider.INSTANCE.resumedActivity
21
21
 
22
- if (activity == null || FireworkSDKModule.appComponentName.isNullOrBlank()) {
22
+ if (activity == null || FWGlobalDataUtil.appComponentName.isNullOrBlank()) {
23
23
  promise?.resolve(false)
24
24
  return
25
25
  }
@@ -36,7 +36,7 @@ object FWEventUtils {
36
36
  Date()
37
37
  )}")
38
38
 
39
- activity.startActivity(FWContainerActivity.createIntent(activity, FireworkSDKModule.appComponentName, props?.toHashMap()))
39
+ activity.startActivity(FWContainerActivity.createIntent(activity, FWGlobalDataUtil.appComponentName, props?.toHashMap()))
40
40
 
41
41
  sendLogMessageEvent(reactContext, "[Android] After Starting container activity ${
42
42
  FWDateUtils.getDateString(
@@ -109,7 +109,7 @@ object FWEventUtils {
109
109
  contentMap.putString("videoId", info?.videoId)
110
110
  }
111
111
  if (info?.duration != null) {
112
- contentMap.putDouble("duration", info.duration.toDouble())
112
+ contentMap.putDouble("duration", info.duration)
113
113
  }
114
114
  if (info?.caption.isNullOrBlank()) {
115
115
  contentMap.putString("caption", info?.caption)
@@ -130,6 +130,9 @@ object FWEventUtils {
130
130
  if (info?.hasCta != null) {
131
131
  contentMap.putBoolean("hasCTA", info.hasCta)
132
132
  }
133
+ if (info?.progress != null) {
134
+ contentMap.putDouble("progress", info.progress)
135
+ }
133
136
  eventMap.putMap("info", contentMap)
134
137
 
135
138
  sendEvent(reactContext, FWEventName.VideoPlayback.rawValue, eventMap)
@@ -14,6 +14,7 @@ import com.firework.viewoptions.*
14
14
  import com.fireworksdk.bridge.FWInitializationProvider
15
15
  import com.fireworksdk.bridge.constants.FWVideoPlayerConstant
16
16
  import com.fireworksdk.bridge.models.*
17
+ import com.fireworksdk.bridge.reactnative.module.FireworkSDKModule
17
18
 
18
19
  object FWConfigUtil {
19
20
 
@@ -50,6 +51,15 @@ object FWConfigUtil {
50
51
  }
51
52
  FWVideoFeedSource.PlaylistGroup.rawValue -> {
52
53
 
54
+ }
55
+ FWVideoFeedSource.HashtagPlaylist.rawValue -> {
56
+ videoFeedPropsModel.channel?.let { channel ->
57
+ if (!videoFeedPropsModel.hashtagFilterExpression.isNullOrBlank()) {
58
+ baseOptionBuilder.feedResource(FeedResource.ChannelHashtag(channel, videoFeedPropsModel.hashtagFilterExpression))
59
+ } else {
60
+ baseOptionBuilder.feedResource(FeedResource.Channel(channel))
61
+ }
62
+ }
53
63
  }
54
64
  else -> {}
55
65
  }
@@ -174,6 +184,21 @@ object FWConfigUtil {
174
184
  playerOptionBuilder.autoplay(it)
175
185
  }
176
186
 
187
+ FWGlobalDataUtil.shareBaseUrl?.let {
188
+ playerOptionBuilder.shareBaseUrl(it)
189
+ }
190
+
191
+ val shareBaseUrl = videoFeedPropsModel.videoPlayerConfiguration?.shareBaseUrl
192
+ shareBaseUrl?.let {
193
+ playerOptionBuilder.shareBaseUrl(it)
194
+ }
195
+
196
+ if (!FWGlobalDataUtil.appComponentName.isNullOrBlank() && !FWGlobalDataUtil.customCTALinkContentPageRouteName.isNullOrBlank()) {
197
+ playerOptionBuilder.sdkHandleCtaButtonClick(false)
198
+ } else {
199
+ playerOptionBuilder.sdkHandleCtaButtonClick(!FWGlobalDataUtil.customCTAClickEnabled)
200
+ }
201
+
177
202
  val gridColumns = videoFeedPropsModel.videoFeedConfiguration?.gridColumns
178
203
  if (gridColumns != null && gridColumns > 0) {
179
204
  layoutOptionBuilder.columnCount(gridColumns)
@@ -281,59 +306,28 @@ object FWConfigUtil {
281
306
  private fun getDefaultLayoutOptionBuilder(): LayoutOption.Builder {
282
307
  val context = FWInitializationProvider.INSTANCE.resumedActivity ?: return LayoutOption.Builder()
283
308
  return LayoutOption.Builder()
284
- .feedLayout(FeedLayout.HORIZONTAL)
285
- .columnCount(2)
286
- .backgroundColor(Color.WHITE)
287
- // .itemSpacing()
288
- .roundedCorner(false)
289
- // .roundedCornerRadius(FWCommonUtil.dpToPx("20".toFloat(), context))
290
- .showPlayIcon(true)
291
- .playIconWidth(FWCommonUtil.dpToPx("24".toFloat(), context))
292
- .feedTitlePosition(FeedTitlePosition.NESTED)
309
+ .playIconWidth(FWCommonUtil.dpToPx("36".toFloat(), context))
293
310
  }
294
311
 
295
312
  private fun getDefaultTitleOptionBuilder(): TitleOption.Builder {
296
313
  return TitleOption.Builder()
297
- .showFeedTitle(true)
298
- // .feedTitleTextTypeface(titleTypeface.toTypeface())
299
- // .feedTitleTextColor(ContextCompat.getColor(context, R.color.white))
300
- // .feedTitleBackgroundColor(titleBackColor.toBackgroundColor())
301
- // .feedTitleTextNumberOfLines(titleMaxLines.toInt())
302
- // .feedTitleTextPadding(titlePadding.dpToPixel())
303
- // .feedTitleTextSize(titleTextSize.spToPixel())
304
314
  }
305
315
 
306
316
  private fun getDefaultPlayerOptionBuilder(): PlayerOption.Builder {
307
317
  return PlayerOption.Builder()
308
- .playerMode(PlayerMode.FULL_BLEED_MODE)
309
- .autoPlayOnComplete(true)
310
- .showShareButton(true)
311
- .showFireworkLogo(true)
312
- .showMuteButton(true)
313
- .showPlayPauseButton(true)
314
- .autoplay(false)
315
- .enablePipMode(false)
316
318
  }
317
319
 
318
320
  private fun getDefaultBaseOptionBuilder(): BaseOption.Builder {
319
321
  return BaseOption.Builder()
320
- .feedResource(FeedResource.Discovery)
321
322
  }
322
323
 
323
324
  private fun getDefaultAdBadgeOptionBuilder(): AdBadgeOption.Builder {
324
325
 
325
326
  return AdBadgeOption.Builder()
326
- // .adBadgeBackColor(Color.parseColor("#FF6200EE"))
327
- // .adBadgeTextColor(Color.parseColor("#FFFFFFFF"))
328
- .adBadgeLabel(AdBadgeTextType.SPONSORED)
329
- .adBadgeIsHidden(false)
330
- .adBadgeShowOnThumbnails(false)
331
- .adBadgeTypeface(Typeface.DEFAULT)
332
327
  }
333
328
 
334
329
  private fun getDefaultCtaOptionBuilder(): CtaOption.Builder {
335
330
  return CtaOption.Builder()
336
- .ctaDelay(CtaDelay(3.0f, CtaDelayUnit.SECONDS))
337
331
  }
338
332
 
339
333
  }
@@ -15,4 +15,10 @@ object FWGlobalDataUtil {
15
15
  var customClickLinkButtonEnabled: Boolean = false
16
16
 
17
17
  var storyBlockFragment by weakProperty<StoryBlockFragment?>()
18
+
19
+ var shareBaseUrl: String? = null
20
+
21
+ var appComponentName: String? = null
22
+
23
+ var customCTALinkContentPageRouteName: String? = null
18
24
  }
@@ -10,7 +10,7 @@ import UIKit
10
10
 
11
11
  @objc
12
12
  public enum StoryBlockSourceType: Int {
13
- case discover, channel, playlist, dynamicContent
13
+ case discover, channel, playlist, dynamicContent, hashtagPlaylist
14
14
  }
15
15
 
16
16
  public protocol StoryBlockViewDelegate: AnyObject {
@@ -24,6 +24,7 @@ public class StoryBlock: UIView, StoryBlockViewControllerDelegate {
24
24
  @objc public var channel: String = ""
25
25
  @objc public var playlist: String = ""
26
26
  @objc public var dynamicContentParameters: [String: [String]] = [:]
27
+ @objc public var hashtagFilterExpression: String = ""
27
28
  @objc public var enablePictureInPicture: Bool = false
28
29
  @objc public var adConfiguration: AdConfiguration?
29
30
 
@@ -43,6 +44,8 @@ public class StoryBlock: UIView, StoryBlockViewControllerDelegate {
43
44
  return .channelPlaylist(channelID: channel, playlistID: playlist)
44
45
  case .dynamicContent:
45
46
  return .dynamicContent(channelID: channel, parameters: dynamicContentParameters)
47
+ case .hashtagPlaylist:
48
+ return .hashtagPlaylist(channelID: channel, filterExpression: hashtagFilterExpression)
46
49
  }
47
50
  }
48
51
 
@@ -62,7 +65,7 @@ public class StoryBlock: UIView, StoryBlockViewControllerDelegate {
62
65
  }
63
66
 
64
67
  private func embed() {
65
- guard let parentVC = fwParentViewController else {
68
+ guard let parentVC = parentViewController else {
66
69
  return
67
70
  }
68
71
  guard self.storyBlockVC == nil else {
@@ -84,10 +87,6 @@ public class StoryBlock: UIView, StoryBlockViewControllerDelegate {
84
87
  storyBlockVC.isPictureInPictureEnabled = true
85
88
  }
86
89
 
87
- if FWAppLanguageManager.shared.shouldHorizontalFlip {
88
- storyBlockVC.view.fwrtl_viewType = FWRTLViewTypeFlip
89
- }
90
-
91
90
  storyBlockVC.delegate = self
92
91
  self.storyBlockVC = storyBlockVC
93
92
  parentVC.attachChild(storyBlockVC, to: self)
@@ -27,6 +27,7 @@ RCT_CUSTOM_VIEW_PROPERTY(source, StoryBlockSource, StoryBlock) {
27
27
  RCT_EXPORT_VIEW_PROPERTY(channel, NSString)
28
28
  RCT_EXPORT_VIEW_PROPERTY(playlist, NSString)
29
29
  RCT_EXPORT_VIEW_PROPERTY(dynamicContentParameters, NSDictionary)
30
+ RCT_EXPORT_VIEW_PROPERTY(hashtagFilterExpression, NSString)
30
31
  RCT_EXPORT_VIEW_PROPERTY(enablePictureInPicture, BOOL)
31
32
 
32
33
  RCT_CUSTOM_VIEW_PROPERTY(adConfiguration, AdConfiguration, StoryBlock) {