react-native-firework-sdk 1.2.1 → 1.2.4-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,11 @@ import kotlinx.android.parcel.Parcelize
7
7
  data class FWVideoFeedItemDetailsModel(
8
8
  val index: Int?,
9
9
  val id: String?,
10
- val videoDuration: Int?,
10
+ val duration: Int?,
11
11
  val source: String?,
12
+ val title: String?,
13
+ val playlistGroup: String?,
14
+ val playlist: String?,
15
+ val channel: String?,
16
+ val dynamicContentParameters: HashMap<String, List<String>>?,
12
17
  ) : Parcelable
@@ -43,7 +43,15 @@ class FWVideoFeedManager : SimpleViewManager<FWVideoFeed>() {
43
43
  videoFeedView?.addOnItemClickedListener(object: OnItemClickedListener {
44
44
  override fun onItemClicked(index: Int, title: String, id: String, videoDuration: Long) {
45
45
  val fwVideoFeedItemDetailsModel = FWVideoFeedItemDetailsModel(
46
- index, id, videoDuration.toInt(), videoFeed.videoFeedPropsModel.source
46
+ index,
47
+ id,
48
+ videoDuration.toInt(),
49
+ videoFeed.videoFeedPropsModel.source,
50
+ title,
51
+ videoFeed.videoFeedPropsModel.playlistGroup,
52
+ videoFeed.videoFeedPropsModel.playlist,
53
+ videoFeed.videoFeedPropsModel.channel,
54
+ videoFeed.videoFeedPropsModel.dynamicContentParameters
47
55
  )
48
56
  FWEventUtils.sendVideoFeedClickEvent(reactContext, fwVideoFeedItemDetailsModel)
49
57
  }
@@ -80,7 +88,15 @@ class FWVideoFeedManager : SimpleViewManager<FWVideoFeed>() {
80
88
  playlistGroupFeedView?.itemClickHandler = object : OnPlaylistGroupItemClickedListener {
81
89
  override fun onItemClicked(index: Int, id: String?): Boolean {
82
90
  val fwVideoFeedItemDetailsModel = FWVideoFeedItemDetailsModel(
83
- index, id, 0, videoFeed?.videoFeedPropsModel?.source
91
+ index,
92
+ id,
93
+ 0,
94
+ videoFeed?.videoFeedPropsModel?.source,
95
+ "",
96
+ videoFeed?.videoFeedPropsModel?.playlistGroup,
97
+ videoFeed?.videoFeedPropsModel?.playlist,
98
+ videoFeed?.videoFeedPropsModel?.channel,
99
+ videoFeed?.videoFeedPropsModel?.dynamicContentParameters
84
100
  )
85
101
  FWEventUtils.sendVideoFeedClickEvent(reactContext, fwVideoFeedItemDetailsModel)
86
102
  return false
@@ -1,9 +1,15 @@
1
1
  package com.fireworksdk.bridge.reactnative.utils
2
2
  import com.facebook.react.bridge.*
3
+ import com.fireworksdk.bridge.utils.FWJsonUtils
3
4
  import org.json.JSONArray
4
5
  import org.json.JSONException
5
6
  import org.json.JSONObject
6
7
 
8
+ inline fun <reified T : Any> T.asMap(): WritableMap {
9
+ val jsonString = FWJsonUtils.toJson(this)
10
+ val jsonObject = JSONObject(jsonString)
11
+ return FWDataUtils.convertJsonObjectToWritableMap(jsonObject)?: Arguments.createMap()
12
+ }
7
13
 
8
14
  object FWDataUtils {
9
15
 
@@ -9,6 +9,7 @@ import com.fireworksdk.bridge.reactnative.FWInitializationProvider
9
9
  import com.fireworksdk.bridge.reactnative.module.FireworkSDKModule
10
10
  import com.fireworksdk.bridge.reactnative.pages.FWContainerActivity
11
11
  import com.fireworksdk.bridge.utils.FWDateUtils
12
+ import com.fireworksdk.bridge.utils.FWJsonUtils
12
13
  import com.fireworksdk.bridge.utils.FWLogUtils
13
14
  import com.loopnow.fireworklibrary.data.Product
14
15
  import java.util.*
@@ -61,12 +62,11 @@ object FWEventUtils {
61
62
 
62
63
  fun sendVideoFeedClickEvent(reactContext: ReactContext, info: FWVideoFeedItemDetailsModel) {
63
64
  val eventMap = Arguments.createMap()
64
- val contentMap = Arguments.createMap()
65
- contentMap.putInt("index", info.index?:0)
66
- contentMap.putString("id", info.id)
67
- contentMap.putInt("duration", info.videoDuration?:0)
68
- contentMap.putString("source", info.source)
69
- eventMap.putMap("info", contentMap)
65
+ sendLogMessageEvent(reactContext, "[Android] Receive sendVideoFeedClickEvent event before: $info")
66
+ val jsonString = FWJsonUtils.toJson(info)
67
+ sendLogMessageEvent(reactContext, "[Android] Receive sendVideoFeedClickEvent event before2: $jsonString")
68
+ eventMap.putMap("info", info.asMap())
69
+ sendLogMessageEvent(reactContext, "[Android] Receive sendVideoFeedClickEvent event after: $eventMap")
70
70
  sendEvent(reactContext, FWEventName.VideoFeedClick.rawValue, eventMap)
71
71
  }
72
72
 
@@ -55,25 +55,40 @@ extension VideoFeedError {
55
55
 
56
56
  extension FeedEventDetails {
57
57
  var jsObject: [String: Any] {
58
+ var result: [String: Any] = [
59
+ "index": index,
60
+ "id": id,
61
+ "duration": duration,
62
+ ]
63
+ if let title = caption {
64
+ result["title"] = title
65
+ }
66
+
58
67
  var sourceStr: String = ""
59
68
  switch(source) {
60
69
  case .discover:
61
70
  sourceStr = "discover"
62
- case .channel(channelID: _):
71
+ case .channel(channelID: let channelID):
63
72
  sourceStr = "channel"
64
- case .channelPlaylist(channelID: _, playlistID: _):
73
+ result["channel"] = channelID
74
+ case .channelPlaylist(channelID: let channelID, playlistID: let playlistID):
65
75
  sourceStr = "playlist"
66
- case .playlistGroup(groupID: _):
76
+ result["channel"] = channelID
77
+ result["playlist"] = playlistID
78
+ case .playlistGroup(groupID: let playlistGroupID):
67
79
  sourceStr = "playlistGroup"
80
+ result["playlistGroup"] = playlistGroupID
81
+ case .dynamicContent(channelID: let channelID, parameters: let parameters):
82
+ sourceStr = "dynamicContent"
83
+ result["channel"] = channelID
84
+ result["dynamicContentParameters"] = parameters
68
85
  default:
69
86
  break
70
87
  }
71
- return [
72
- "index": index,
73
- "id": id,
74
- "duration": duration,
75
- "source": sourceStr
76
- ]
88
+
89
+ result["source"] = sourceStr;
90
+
91
+ return result
77
92
  }
78
93
  }
79
94
 
@@ -54,6 +54,11 @@ class FWNavigatorModule: RCTEventEmitter, FWNavigator {
54
54
  containerViewController.moduleName = appComponentName
55
55
  containerViewController.properties = props
56
56
  containerViewController.modalPresentationStyle = .fullScreen
57
+ if presentedVC.modalPresentationStyle == .custom,
58
+ let presentingVC = presentedVC.presentingViewController,
59
+ presentingVC is FireworkVideo.PlayerViewController {
60
+ containerViewController.modalPresentationStyle = .overFullScreen
61
+ }
57
62
 
58
63
  #if DEBUG
59
64
  self.sendEvent(withName: FWEventName.LogMessage.rawValue, body: ["message": "[iOS] Present containerViewController \(formatter.string(from: Date()))"])
@@ -86,8 +91,12 @@ class FWNavigatorModule: RCTEventEmitter, FWNavigator {
86
91
  if presentedVC.modalPresentationStyle == .custom,
87
92
  presentingVC is FireworkVideo.PlayerViewController {
88
93
  // For consistency with Android SDK behavior
89
- (presentingVC.presentingViewController ?? presentingVC).dismiss(animated: true) {
90
- resolver(true)
94
+ presentedVC.dismiss(animated: false) {
95
+ DispatchQueue.main.async {
96
+ presentingVC.dismiss(animated: true) {
97
+ resolver(true)
98
+ }
99
+ }
91
100
  }
92
101
  } else {
93
102
  presentedVC.dismiss(animated: true) {
@@ -1 +1 @@
1
- {"version":3,"sources":["VideoFeed.tsx"],"names":["NativeComponentName","VideoFeed","React","Component","createRef","nativeNodeHandle","nativeComponentRef","current","UIManager","dispatchViewManagerCommand","getViewManagerConfig","Commands","refresh","event","name","reason","nativeEvent","props","onVideoFeedLoadFinished","componentDidMount","subscriptionOfShareBaseURLUpdated","FireworkSDKModuleEventEmitter","addListener","FWEventName","ShareBaseURLUpdated","setState","subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","componentWillUnmount","forEach","value","remove","render","source","channel","playlist","playlistGroup","mode","videoFeedConfiguration","titleHidden","title","hidden","titlePosition","customLayoutName","shareBaseURL","FireworkSDK","getInstance","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","dynamicContentParametersString","_generateDynamicContentParametersString","key","_onVideoFeedLoadFinished","Object","assign","style","zIndex","dynamicContentParameters","resultString","sortedKeyList","keys","sort","valueString","join","length"],"mappings":";;;;;;;AAAA;;AAGA;;AAQA;;AAEA;;AAIA;;AACA;;;;;;;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CAACM,MAAb,GAAsB,CAA1B,EAA6B;AAC3BN,QAAAA,YAAY,IAAI,GAAhB;AACD;;AAEDA,MAAAA,YAAY,IAAK,GAAEP,GAAI,IAAGW,WAAY,EAAtC;AACD;;AAED,WAAOJ,YAAP;AACD;;AAjIqE;;;;gBAAnDhE,S,kBACG;AACpBsC,EAAAA,IAAI,EAAE;AADc,C","sourcesContent":["import React from 'react';\n\nimport type { NativeSyntheticEvent, TargetedEvent } from 'react-native';\nimport {\n EmitterSubscription,\n findNodeHandle,\n StyleProp,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport FireworkSDK from '../FireworkSDK';\nimport type FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport type VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWVideoFeed from './FWVideoFeed';\n\nexport type VideoFeedMode = 'row' | 'column' | 'grid';\n\nexport interface IVideoFeedProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of three available video feed sources.\n */\n source: VideoFeedSource;\n /**\n * Channel name from which content should be displayed. Videos are ordered as a channel timeline. The prop is required when the source is set as channel or playlist.\n */\n channel?: string;\n /**\n * Playlist Id for selected content. Please note channel name is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n\n /**\n * PlaylistGroup Id for selected content. Required when the source is set as playlistGroup.\n */\n playlistGroup?: string;\n\n /**\n * The parameters to be passed to a dynamic content feed. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Configuration of Video Feed.\n */\n videoFeedConfiguration?: VideoFeedConfiguration;\n /**\n * Configuration of Video Player.\n */\n videoPlayerConfiguration?: VideoPlayerConfiguration;\n /**\n * Video feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n}\n\ninterface VideoFeedLoadFinishedEvent extends TargetedEvent {\n name: string;\n reason?: string | null;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\nexport default class VideoFeed extends React.Component<IVideoFeedProps> {\n static defaultProps = {\n mode: 'row',\n };\n\n nativeComponentRef = React.createRef<any>();\n\n subscriptions: EmitterSubscription[] = [];\n\n /**\n * Force refreshing the video feed.\n */\n public refresh = () => {\n const nativeNodeHandle = findNodeHandle(this.nativeComponentRef.current);\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh,\n []\n );\n };\n\n private _onVideoFeedLoadFinished = (\n event: NativeSyntheticEvent<VideoFeedLoadFinishedEvent>\n ) => {\n const { name, reason } = event.nativeEvent;\n if (this.props.onVideoFeedLoadFinished) {\n if (name) {\n this.props.onVideoFeedLoadFinished({ name, reason });\n } else {\n this.props.onVideoFeedLoadFinished();\n }\n }\n };\n\n componentDidMount() {\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);\n }\n\n componentWillUnmount() {\n this.subscriptions.forEach((value) => {\n value.remove();\n });\n\n this.subscriptions = [];\n }\n\n render() {\n const {\n source,\n channel = '',\n playlist = '',\n playlistGroup = '',\n mode = 'row',\n videoFeedConfiguration,\n } = this.props;\n const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;\n const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';\n const customLayoutName = videoFeedConfiguration?.customLayoutName ?? '';\n const shareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';\n const adBadgeConfiguration =\n FireworkSDK.getInstance().adBadgeConfiguration ?? {};\n const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';\n const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';\n const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n\n let key = `source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_mode:${mode}`;\n key += `_titleHidden:${titleHidden}`;\n key += `_titlePosition:${titlePosition}`;\n key += `_customLayoutName:${customLayoutName}`;\n key += `_shareBaseURL:${shareBaseURL}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n\n return (\n <FWVideoFeed\n key={key}\n {...this.props}\n ref={this.nativeComponentRef}\n onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}\n mode={mode}\n style={Object.assign({}, this.props.style, { zIndex: -1 })}\n />\n );\n }\n\n private _generateDynamicContentParametersString(): string {\n const { dynamicContentParameters } = this.props;\n if (!dynamicContentParameters) {\n return '';\n }\n\n let resultString = '';\n const sortedKeyList = Object.keys(dynamicContentParameters).sort();\n for (const key of sortedKeyList) {\n const value = dynamicContentParameters[key];\n const valueString = value.join(',');\n if (resultString.length > 0) {\n resultString += '_';\n }\n\n resultString += `${key}:${valueString}`;\n }\n\n return resultString;\n }\n}\n"]}
1
+ {"version":3,"sources":["VideoFeed.tsx"],"names":["NativeComponentName","VideoFeed","React","Component","createRef","nativeNodeHandle","nativeComponentRef","current","UIManager","dispatchViewManagerCommand","getViewManagerConfig","Commands","refresh","event","name","reason","nativeEvent","props","onVideoFeedLoadFinished","componentDidMount","subscriptionOfShareBaseURLUpdated","FireworkSDKModuleEventEmitter","addListener","FWEventName","ShareBaseURLUpdated","setState","subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","componentWillUnmount","forEach","value","remove","render","source","channel","playlist","playlistGroup","mode","videoFeedConfiguration","titleHidden","title","hidden","titlePosition","customLayoutName","shareBaseURL","FireworkSDK","getInstance","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","dynamicContentParametersString","_generateDynamicContentParametersString","key","_onVideoFeedLoadFinished","Object","assign","style","zIndex","dynamicContentParameters","resultString","sortedKeyList","keys","sort","valueString","join","length"],"mappings":";;;;;;;AAAA;;AAGA;;AAQA;;AAEA;;AAIA;;AACA;;;;;;;;AAoDA,MAAMA,mBAAmB,GAAG,aAA5B;;AAEe,MAAMC,SAAN,SAAwBC,eAAMC,SAA9B,CAAyD;AAAA;AAAA;;AAAA,6DAKjDD,eAAME,SAAN,EALiD;;AAAA,2CAO/B,EAP+B;;AAAA,qCAYrD,MAAM;AACrB,YAAMC,gBAAgB,GAAG,iCAAe,KAAKC,kBAAL,CAAwBC,OAAvC,CAAzB;;AAEAC,6BAAUC,0BAAV,CACE,iCAAeJ,gBAAf,CADF,EAEEG,uBAAUE,oBAAV,CAA+BV,mBAA/B,EAAoDW,QAApD,CAA6DC,OAF/D,EAGE,EAHF;AAKD,KApBqE;;AAAA,sDAuBpEC,KADiC,IAE9B;AACH,YAAM;AAAEC,QAAAA,IAAF;AAAQC,QAAAA;AAAR,UAAmBF,KAAK,CAACG,WAA/B;;AACA,UAAI,KAAKC,KAAL,CAAWC,uBAAf,EAAwC;AACtC,YAAIJ,IAAJ,EAAU;AACR,eAAKG,KAAL,CAAWC,uBAAX,CAAmC;AAAEJ,YAAAA,IAAF;AAAQC,YAAAA;AAAR,WAAnC;AACD,SAFD,MAEO;AACL,eAAKE,KAAL,CAAWC,uBAA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AAoC;AAAEC,QAAAA,MAAM,EAAE,CAAC;AAAX,OAApC;AANT,OADF;AAUD;;AAEON,EAAAA,uCAAuC,GAAW;AACxD,UAAM;AAAEO,MAAAA;AAAF,QAA+B,KAAK/C,KAA1C;;AACA,QAAI,CAAC+C,wBAAL,EAA+B;AAC7B,aAAO,EAAP;AACD;;AAED,QAAIC,YAAY,GAAG,EAAnB;AACA,UAAMC,aAAa,GAAGN,MAAM,CAACO,IAAP,CAAYH,wBAAZ,EAAsCI,IAAtC,EAAtB;;AACA,SAAK,MAAMV,GAAX,IAAkBQ,aAAlB,EAAiC;AAC/B,YAAMlC,KAAK,GAAGgC,wBAAwB,CAACN,GAAD,CAAtC;AACA,YAAMW,WAAW,GAAGrC,KAAK,CAACsC,IAAN,CAAW,GAAX,CAApB;;AACA,UAAIL,YAAY,CAACM,MAAb,GAAsB,CAA1B,EAA6B;AAC3BN,QAAAA,YAAY,IAAI,GAAhB;AACD;;AAEDA,MAAAA,YAAY,IAAK,GAAEP,GAAI,IAAGW,WAAY,EAAtC;AACD;;AAED,WAAOJ,YAAP;AACD;;AAjIqE;;;;gBAAnDhE,S,kBACG;AACpBsC,EAAAA,IAAI,EAAE;AADc,C","sourcesContent":["import React from 'react';\n\nimport type { NativeSyntheticEvent, TargetedEvent } from 'react-native';\nimport {\n EmitterSubscription,\n findNodeHandle,\n StyleProp,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport FireworkSDK from '../FireworkSDK';\nimport type FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport type VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWVideoFeed from './FWVideoFeed';\n\nexport type VideoFeedMode = 'row' | 'column' | 'grid';\n\nexport interface IVideoFeedProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of five available video feed sources.\n */\n source: VideoFeedSource;\n /**\n * Channel id of the feed. Required when the source is set as channel or playlist or dynamicContent.\n */\n channel?: string;\n /**\n * Playlist id of the feed. Please note channel id is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n /**\n * PlaylistGroup id of the feed. Required when the source is set as playlistGroup.\n */\n playlistGroup?: string;\n /**\n * The dynamic content parameters of the feed. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Configuration of the feed.\n */\n videoFeedConfiguration?: VideoFeedConfiguration;\n /**\n * Configuration of the player.\n */\n videoPlayerConfiguration?: VideoPlayerConfiguration;\n /**\n * The feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n}\n\ninterface VideoFeedLoadFinishedEvent extends TargetedEvent {\n name: string;\n reason?: string | null;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\nexport default class VideoFeed extends React.Component<IVideoFeedProps> {\n static defaultProps = {\n mode: 'row',\n };\n\n nativeComponentRef = React.createRef<any>();\n\n subscriptions: EmitterSubscription[] = [];\n\n /**\n * Force refreshing the video feed.\n */\n public refresh = () => {\n const nativeNodeHandle = findNodeHandle(this.nativeComponentRef.current);\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh,\n []\n );\n };\n\n private _onVideoFeedLoadFinished = (\n event: NativeSyntheticEvent<VideoFeedLoadFinishedEvent>\n ) => {\n const { name, reason } = event.nativeEvent;\n if (this.props.onVideoFeedLoadFinished) {\n if (name) {\n this.props.onVideoFeedLoadFinished({ name, reason });\n } else {\n this.props.onVideoFeedLoadFinished();\n }\n }\n };\n\n componentDidMount() {\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);\n }\n\n componentWillUnmount() {\n this.subscriptions.forEach((value) => {\n value.remove();\n });\n\n this.subscriptions = [];\n }\n\n render() {\n const {\n source,\n channel = '',\n playlist = '',\n playlistGroup = '',\n mode = 'row',\n videoFeedConfiguration,\n } = this.props;\n const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;\n const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';\n const customLayoutName = videoFeedConfiguration?.customLayoutName ?? '';\n const shareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';\n const adBadgeConfiguration =\n FireworkSDK.getInstance().adBadgeConfiguration ?? {};\n const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';\n const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';\n const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n\n let key = `source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_mode:${mode}`;\n key += `_titleHidden:${titleHidden}`;\n key += `_titlePosition:${titlePosition}`;\n key += `_customLayoutName:${customLayoutName}`;\n key += `_shareBaseURL:${shareBaseURL}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n\n return (\n <FWVideoFeed\n key={key}\n {...this.props}\n ref={this.nativeComponentRef}\n onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}\n mode={mode}\n style={Object.assign({}, this.props.style, { zIndex: -1 })}\n />\n );\n }\n\n private _generateDynamicContentParametersString(): string {\n const { dynamicContentParameters } = this.props;\n if (!dynamicContentParameters) {\n return '';\n }\n\n let resultString = '';\n const sortedKeyList = Object.keys(dynamicContentParameters).sort();\n for (const key of sortedKeyList) {\n const value = dynamicContentParameters[key];\n const valueString = value.join(',');\n if (resultString.length > 0) {\n resultString += '_';\n }\n\n resultString += `${key}:${valueString}`;\n }\n\n return resultString;\n }\n}\n"]}
@@ -41,5 +41,5 @@ class FWLoggerUtil {
41
41
 
42
42
  exports.default = FWLoggerUtil;
43
43
 
44
- _defineProperty(FWLoggerUtil, "enabled", false);
44
+ _defineProperty(FWLoggerUtil, "enabled", true);
45
45
  //# sourceMappingURL=FWLoggerUtil.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["FWLoggerUtil.ts"],"names":["FWLoggerUtil","log","message","enabled","process","env","NODE_ENV","currentDate","Date","console","toISOString","logNativeMessage","nativeMessage","date","timezoneOffset","getTimezoneOffset","timezoneSymbol","timezoneHours","Math","floor","abs","toString","padStart","timezoneMinutes","timezoneString","year","getFullYear","month","getMonth","day","getDate","hours","getHours","minutes","getMinutes","seconds","getSeconds","milliseconds","getMilliseconds"],"mappings":";;;;;;;;;AAAe,MAAMA,YAAN,CAAmB;AAEtB,SAAHC,GAAG,CAACC,OAAD,EAAkB;AAC1B,QAAIF,YAAY,CAACG,OAAb,IAAwBC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,aAArD,EAAoE;AAClE,YAAMC,WAAW,GAAG,IAAIC,IAAJ,EAApB;AAEAC,MAAAA,OAAO,CAACR,GAAR,CACE,6BADF,EAEG,GAAEC,OAAQ,IAAGF,YAAY,CAACU,WAAb,CAAyBH,WAAzB,CAAsC,EAFtD;AAID;AACF;;AAEsB,SAAhBI,gBAAgB,CAACC,aAAD,EAAwB;AAC7C,QAAIZ,YAAY,CAACG,OAAb,IAAwBC,OAAO,CAACC,GAAR,CA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A6BC,QAA7B,CAAsC,CAAtC,EAAyC,GAAzC,CAAd;AACA,QAAIe,YAAY,GAAGxB,IAAI,CAACyB,eAAL,GAAuBjB,QAAvB,GAAkCC,QAAlC,CAA2C,CAA3C,EAA8C,GAA9C,CAAnB;AAEA,WAAQ,GAAEG,IAAK,IAAGE,KAAM,IAAGE,GAAI,IAAGE,KAAM,IAAGE,OAAQ,IAAGE,OAAQ,IAAGE,YAAa,GAAEb,cAAe,EAA/F;AACD;;AAtC+B;;;;gBAAbxB,Y,aACO,K","sourcesContent":["export default class FWLoggerUtil {\n static enabled: boolean = false;\n static log(message: string) {\n if (FWLoggerUtil.enabled && process.env.NODE_ENV === 'development') {\n const currentDate = new Date();\n\n console.log(\n '[react-native-firework-sdk]',\n `${message} ${FWLoggerUtil.toISOString(currentDate)}`\n );\n }\n }\n\n static logNativeMessage(nativeMessage: string) {\n if (FWLoggerUtil.enabled && process.env.NODE_ENV === 'development') {\n console.log('[react-native-firework-sdk] [native]', nativeMessage);\n }\n }\n\n private static toISOString(date: Date): string {\n let timezoneOffset = -date.getTimezoneOffset();\n let timezoneSymbol = timezoneOffset >= 0 ? '+' : '-';\n let timezoneHours = Math.floor(Math.abs(timezoneOffset) / 60)\n .toString()\n .padStart(2, '0');\n let timezoneMinutes = (Math.abs(timezoneOffset) % 60)\n .toString()\n .padStart(2, '0');\n let timezoneString = `${timezoneSymbol}${timezoneHours}:${timezoneMinutes}`;\n let year = date.getFullYear().toString();\n let month = (date.getMonth() + 1).toString().padStart(2, '0');\n let day = date.getDate().toString().padStart(2, '0');\n let hours = date.getHours().toString().padStart(2, '0');\n let minutes = date.getMinutes().toString().padStart(2, '0');\n let seconds = date.getSeconds().toString().padStart(2, '0');\n let milliseconds = date.getMilliseconds().toString().padStart(3, '0');\n\n return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}.${milliseconds}${timezoneString}`;\n }\n}\n"]}
1
+ {"version":3,"sources":["FWLoggerUtil.ts"],"names":["FWLoggerUtil","log","message","enabled","process","env","NODE_ENV","currentDate","Date","console","toISOString","logNativeMessage","nativeMessage","date","timezoneOffset","getTimezoneOffset","timezoneSymbol","timezoneHours","Math","floor","abs","toString","padStart","timezoneMinutes","timezoneString","year","getFullYear","month","getMonth","day","getDate","hours","getHours","minutes","getMinutes","seconds","getSeconds","milliseconds","getMilliseconds"],"mappings":";;;;;;;;;AAAe,MAAMA,YAAN,CAAmB;AAEtB,SAAHC,GAAG,CAACC,OAAD,EAAkB;AAC1B,QAAIF,YAAY,CAACG,OAAb,IAAwBC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,aAArD,EAAoE;AAClE,YAAMC,WAAW,GAAG,IAAIC,IAAJ,EAApB;AAEAC,MAAAA,OAAO,CAACR,GAAR,CACE,6BADF,EAEG,GAAEC,OAAQ,IAAGF,YAAY,CAACU,WAAb,CAAyBH,WAAzB,CAAsC,EAFtD;AAID;AACF;;AAEsB,SAAhBI,gBAAgB,CAACC,aAAD,EAAwB;AAC7C,QAAIZ,YAAY,CAACG,OAAb,IAAwBC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,aAArD,EAAoE;AAClEG,MAAAA,OAAO,CAACR,GAAR,CAAY,sCAAZ,EAAoDW,aAApD;AACD;AACF;;AAEyB,SAAXF,WAAW,CAACG,IAAD,EAAqB;AAC7C,QAAIC,cAAc,GAAG,CAACD,IAAI,CAACE,iBAAL,EAAtB;AACA,QAAIC,cAAc,GAAGF,cAAc,IAAI,CAAlB,GAAsB,GAAtB,GAA4B,GAAjD;AACA,QAAIG,aAAa,GAAGC,IAAI,CAACC,KAAL,CAAWD,IAAI,CAACE,GAAL,CAASN,cAAT,IAA2B,EAAtC,EACjBO,QADiB,GAEjBC,QAFiB,CAER,CAFQ,EAEL,GAFK,CAApB;AAGA,QAAIC,eAAe,GAAG,CAACL,IAAI,CAACE,GAAL,CAASN,cAAT,IAA2B,EAA5B,EACnBO,QADmB,GAEnBC,QAFmB,CAEV,CAFU,EAEP,GAFO,CAAtB;AAGA,QAAIE,cAAc,GAAI,GAAER,cAAe,GAAEC,aAAc,IAAGM,eAAgB,EAA1E;AACA,QAAIE,IAAI,GAAGZ,IAAI,CAACa,WAAL,GAAmBL,QAAnB,EAAX;AACA,QAAIM,KAAK,GAAG,CAACd,IAAI,CAACe,QAAL,KAAkB,CAAnB,EAAsBP,QAAtB,GAAiCC,QAAjC,CAA0C,CAA1C,EAA6C,GAA7C,CAAZ;AACA,QAAIO,GAAG,GAAGhB,IAAI,CAACiB,OAAL,GAAeT,QAAf,GAA0BC,QAA1B,CAAmC,CAAnC,EAAsC,GAAtC,CAAV;AACA,QAAIS,KAAK,GAAGlB,IAAI,CAACmB,QAAL,GAAgBX,QAAhB,GAA2BC,QAA3B,CAAoC,CAApC,EAAuC,GAAvC,CAAZ;AACA,QAAIW,OAAO,GAAGpB,IAAI,CAACqB,UAAL,GAAkBb,QAAlB,GAA6BC,QAA7B,CAAsC,CAAtC,EAAyC,GAAzC,CAAd;AACA,QAAIa,OAAO,GAAGtB,IAAI,CAACuB,UAAL,GAAkBf,QAAlB,GAA6BC,QAA7B,CAAsC,CAAtC,EAAyC,GAAzC,CAAd;AACA,QAAIe,YAAY,GAAGxB,IAAI,CAACyB,eAAL,GAAuBjB,QAAvB,GAAkCC,QAAlC,CAA2C,CAA3C,EAA8C,GAA9C,CAAnB;AAEA,WAAQ,GAAEG,IAAK,IAAGE,KAAM,IAAGE,GAAI,IAAGE,KAAM,IAAGE,OAAQ,IAAGE,OAAQ,IAAGE,YAAa,GAAEb,cAAe,EAA/F;AACD;;AAtC+B;;;;gBAAbxB,Y,aACO,I","sourcesContent":["export default class FWLoggerUtil {\n static enabled: boolean = true;\n static log(message: string) {\n if (FWLoggerUtil.enabled && process.env.NODE_ENV === 'development') {\n const currentDate = new Date();\n\n console.log(\n '[react-native-firework-sdk]',\n `${message} ${FWLoggerUtil.toISOString(currentDate)}`\n );\n }\n }\n\n static logNativeMessage(nativeMessage: string) {\n if (FWLoggerUtil.enabled && process.env.NODE_ENV === 'development') {\n console.log('[react-native-firework-sdk] [native]', nativeMessage);\n }\n }\n\n private static toISOString(date: Date): string {\n let timezoneOffset = -date.getTimezoneOffset();\n let timezoneSymbol = timezoneOffset >= 0 ? '+' : '-';\n let timezoneHours = Math.floor(Math.abs(timezoneOffset) / 60)\n .toString()\n .padStart(2, '0');\n let timezoneMinutes = (Math.abs(timezoneOffset) % 60)\n .toString()\n .padStart(2, '0');\n let timezoneString = `${timezoneSymbol}${timezoneHours}:${timezoneMinutes}`;\n let year = date.getFullYear().toString();\n let month = (date.getMonth() + 1).toString().padStart(2, '0');\n let day = date.getDate().toString().padStart(2, '0');\n let hours = date.getHours().toString().padStart(2, '0');\n let minutes = date.getMinutes().toString().padStart(2, '0');\n let seconds = date.getSeconds().toString().padStart(2, '0');\n let milliseconds = date.getMilliseconds().toString().padStart(3, '0');\n\n return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}.${milliseconds}${timezoneString}`;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["VideoFeed.tsx"],"names":["React","findNodeHandle","UIManager","FireworkSDK","FWEventName","FireworkSDKModuleEventEmitter","FWVideoFeed","NativeComponentName","VideoFeed","Component","createRef","nativeNodeHandle","nativeComponentRef","current","dispatchViewManagerCommand","getViewManagerConfig","Commands","refresh","event","name","reason","nativeEvent","props","onVideoFeedLoadFinished","componentDidMount","subscriptionOfShareBaseURLUpdated","addListener","ShareBaseURLUpdated","setState","subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","componentWillUnmount","forEach","value","remove","render","source","channel","playlist","playlistGroup","mode","videoFeedConfiguration","titleHidden","title","hidden","titlePosition","customLayoutName","shareBaseURL","getInstance","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","dynamicContentParametersString","_generateDynamicContentParametersString","key","_onVideoFeedLoadFinished","Object","assign","style","zIndex","dynamicContentParameters","result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C7B,aAAO,EAAP;AACD;;AAED,QAAIC,YAAY,GAAG,EAAnB;AACA,UAAMC,aAAa,GAAGN,MAAM,CAACO,IAAP,CAAYH,wBAAZ,EAAsCI,IAAtC,EAAtB;;AACA,SAAK,MAAMV,GAAX,IAAkBQ,aAAlB,EAAiC;AAC/B,YAAMjC,KAAK,GAAG+B,wBAAwB,CAACN,GAAD,CAAtC;AACA,YAAMW,WAAW,GAAGpC,KAAK,CAACqC,IAAN,CAAW,GAAX,CAApB;;AACA,UAAIL,YAAY,CAACM,MAAb,GAAsB,CAA1B,EAA6B;AAC3BN,QAAAA,YAAY,IAAI,GAAhB;AACD;;AAEDA,MAAAA,YAAY,IAAK,GAAEP,GAAI,IAAGW,WAAY,EAAtC;AACD;;AAED,WAAOJ,YAAP;AACD;;AAjIqE;;gBAAnD3D,S,kBACG;AACpBkC,EAAAA,IAAI,EAAE;AADc,C","sourcesContent":["import React from 'react';\n\nimport type { NativeSyntheticEvent, TargetedEvent } from 'react-native';\nimport {\n EmitterSubscription,\n findNodeHandle,\n StyleProp,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport FireworkSDK from '../FireworkSDK';\nimport type FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport type VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWVideoFeed from './FWVideoFeed';\n\nexport type VideoFeedMode = 'row' | 'column' | 'grid';\n\nexport interface IVideoFeedProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of three available video feed sources.\n */\n source: VideoFeedSource;\n /**\n * Channel name from which content should be displayed. Videos are ordered as a channel timeline. The prop is required when the source is set as channel or playlist.\n */\n channel?: string;\n /**\n * Playlist Id for selected content. Please note channel name is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n\n /**\n * PlaylistGroup Id for selected content. Required when the source is set as playlistGroup.\n */\n playlistGroup?: string;\n\n /**\n * The parameters to be passed to a dynamic content feed. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Configuration of Video Feed.\n */\n videoFeedConfiguration?: VideoFeedConfiguration;\n /**\n * Configuration of Video Player.\n */\n videoPlayerConfiguration?: VideoPlayerConfiguration;\n /**\n * Video feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n}\n\ninterface VideoFeedLoadFinishedEvent extends TargetedEvent {\n name: string;\n reason?: string | null;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\nexport default class VideoFeed extends React.Component<IVideoFeedProps> {\n static defaultProps = {\n mode: 'row',\n };\n\n nativeComponentRef = React.createRef<any>();\n\n subscriptions: EmitterSubscription[] = [];\n\n /**\n * Force refreshing the video feed.\n */\n public refresh = () => {\n const nativeNodeHandle = findNodeHandle(this.nativeComponentRef.current);\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh,\n []\n );\n };\n\n private _onVideoFeedLoadFinished = (\n event: NativeSyntheticEvent<VideoFeedLoadFinishedEvent>\n ) => {\n const { name, reason } = event.nativeEvent;\n if (this.props.onVideoFeedLoadFinished) {\n if (name) {\n this.props.onVideoFeedLoadFinished({ name, reason });\n } else {\n this.props.onVideoFeedLoadFinished();\n }\n }\n };\n\n componentDidMount() {\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);\n }\n\n componentWillUnmount() {\n this.subscriptions.forEach((value) => {\n value.remove();\n });\n\n this.subscriptions = [];\n }\n\n render() {\n const {\n source,\n channel = '',\n playlist = '',\n playlistGroup = '',\n mode = 'row',\n videoFeedConfiguration,\n } = this.props;\n const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;\n const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';\n const customLayoutName = videoFeedConfiguration?.customLayoutName ?? '';\n const shareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';\n const adBadgeConfiguration =\n FireworkSDK.getInstance().adBadgeConfiguration ?? {};\n const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';\n const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';\n const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n\n let key = `source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_mode:${mode}`;\n key += `_titleHidden:${titleHidden}`;\n key += `_titlePosition:${titlePosition}`;\n key += `_customLayoutName:${customLayoutName}`;\n key += `_shareBaseURL:${shareBaseURL}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n\n return (\n <FWVideoFeed\n key={key}\n {...this.props}\n ref={this.nativeComponentRef}\n onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}\n mode={mode}\n style={Object.assign({}, this.props.style, { zIndex: -1 })}\n />\n );\n }\n\n private _generateDynamicContentParametersString(): string {\n const { dynamicContentParameters } = this.props;\n if (!dynamicContentParameters) {\n return '';\n }\n\n let resultString = '';\n const sortedKeyList = Object.keys(dynamicContentParameters).sort();\n for (const key of sortedKeyList) {\n const value = dynamicContentParameters[key];\n const valueString = value.join(',');\n if (resultString.length > 0) {\n resultString += '_';\n }\n\n resultString += `${key}:${valueString}`;\n }\n\n return resultString;\n }\n}\n"]}
1
+ {"version":3,"sources":["VideoFeed.tsx"],"names":["React","findNodeHandle","UIManager","FireworkSDK","FWEventName","FireworkSDKModuleEventEmitter","FWVideoFeed","NativeComponentName","VideoFeed","Component","createRef","nativeNodeHandle","nativeComponentRef","current","dispatchViewManagerCommand","getViewManagerConfig","Commands","refresh","event","name","reason","nativeEvent","props","onVideoFeedLoadFinished","componentDidMount","subscriptionOfShareBaseURLUpdated","addListener","ShareBaseURLUpdated","setState","subscriptions","push","subscriptionOfAdBadgeConfigurationUpdated","AdBadgeConfigurationUpdated","componentWillUnmount","forEach","value","remove","render","source","channel","playlist","playlistGroup","mode","videoFeedConfiguration","titleHidden","title","hidden","titlePosition","customLayoutName","shareBaseURL","getInstance","adBadgeConfiguration","adBadgeTextType","badgeTextType","backgroundColorOfAdBadge","backgroundColor","textColorOfAdBadge","textColor","dynamicContentParametersString","_generateDynamicContentParametersString","key","_onVideoFeedLoadFinished","Object","assign","style","zIndex","dynamicContentParameters","resultString","sortedKeyList","keys","sort","valueString","join","length"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAGA,SAEEC,cAFF,EAIEC,SAJF,QAMO,cANP;AAQA,OAAOC,WAAP,MAAwB,gBAAxB;AAEA,SAASC,WAAT,QAA4B,uBAA5B;AAIA,SAASC,6BAAT,QAA8C,8BAA9C;AACA,OAAOC,WAAP,MAAwB,eAAxB;AAoDA,MAAMC,mBAAmB,GAAG,aAA5B;AAEA,eAAe,MAAMC,SAAN,SAAwBR,KAAK,CAACS,SAA9B,CAAyD;AAAA;AAAA;;AAAA,6DAKjDT,KAAK,CAACU,SAAN,EALiD;;AAAA,2CAO/B,EAP+B;;AAAA,qCAYrD,MAAM;AACrB,YAAMC,gBAAg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AAED,WAAOJ,YAAP;AACD;;AAjIqE;;gBAAnD3D,S,kBACG;AACpBkC,EAAAA,IAAI,EAAE;AADc,C","sourcesContent":["import React from 'react';\n\nimport type { NativeSyntheticEvent, TargetedEvent } from 'react-native';\nimport {\n EmitterSubscription,\n findNodeHandle,\n StyleProp,\n UIManager,\n ViewStyle,\n} from 'react-native';\n\nimport FireworkSDK from '../FireworkSDK';\nimport type FWError from '../models/FWError';\nimport { FWEventName } from '../models/FWEventName';\nimport type VideoFeedConfiguration from '../models/VideoFeedConfiguration';\nimport type { VideoFeedSource } from '../models/VideoFeedSource';\nimport type VideoPlayerConfiguration from '../models/VideoPlayerConfiguration';\nimport { FireworkSDKModuleEventEmitter } from '../modules/FireworkSDKModule';\nimport FWVideoFeed from './FWVideoFeed';\n\nexport type VideoFeedMode = 'row' | 'column' | 'grid';\n\nexport interface IVideoFeedProps {\n /**\n * Standard React Native View Style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * One of five available video feed sources.\n */\n source: VideoFeedSource;\n /**\n * Channel id of the feed. Required when the source is set as channel or playlist or dynamicContent.\n */\n channel?: string;\n /**\n * Playlist id of the feed. Please note channel id is necessary. Required when the source is set as playlist.\n */\n playlist?: string;\n /**\n * PlaylistGroup id of the feed. Required when the source is set as playlistGroup.\n */\n playlistGroup?: string;\n /**\n * The dynamic content parameters of the feed. Required when the source is set as dynamicContent.\n */\n dynamicContentParameters?: { [key: string]: string[] };\n /**\n * One of three available display modes. Defaults to row.\n */\n mode?: VideoFeedMode;\n /**\n * Configuration of the feed.\n */\n videoFeedConfiguration?: VideoFeedConfiguration;\n /**\n * Configuration of the player.\n */\n videoPlayerConfiguration?: VideoPlayerConfiguration;\n /**\n * The feed loading result callback. It means loading successfully when error equals to undefined.\n */\n onVideoFeedLoadFinished?: (error?: FWError) => void;\n}\n\ninterface VideoFeedLoadFinishedEvent extends TargetedEvent {\n name: string;\n reason?: string | null;\n}\n\nconst NativeComponentName = 'FWVideoFeed';\n\nexport default class VideoFeed extends React.Component<IVideoFeedProps> {\n static defaultProps = {\n mode: 'row',\n };\n\n nativeComponentRef = React.createRef<any>();\n\n subscriptions: EmitterSubscription[] = [];\n\n /**\n * Force refreshing the video feed.\n */\n public refresh = () => {\n const nativeNodeHandle = findNodeHandle(this.nativeComponentRef.current);\n\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(nativeNodeHandle),\n UIManager.getViewManagerConfig(NativeComponentName).Commands.refresh,\n []\n );\n };\n\n private _onVideoFeedLoadFinished = (\n event: NativeSyntheticEvent<VideoFeedLoadFinishedEvent>\n ) => {\n const { name, reason } = event.nativeEvent;\n if (this.props.onVideoFeedLoadFinished) {\n if (name) {\n this.props.onVideoFeedLoadFinished({ name, reason });\n } else {\n this.props.onVideoFeedLoadFinished();\n }\n }\n };\n\n componentDidMount() {\n const subscriptionOfShareBaseURLUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.ShareBaseURLUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfShareBaseURLUpdated);\n\n const subscriptionOfAdBadgeConfigurationUpdated =\n FireworkSDKModuleEventEmitter.addListener(\n FWEventName.AdBadgeConfigurationUpdated,\n () => {\n this.setState({});\n }\n );\n this.subscriptions.push(subscriptionOfAdBadgeConfigurationUpdated);\n }\n\n componentWillUnmount() {\n this.subscriptions.forEach((value) => {\n value.remove();\n });\n\n this.subscriptions = [];\n }\n\n render() {\n const {\n source,\n channel = '',\n playlist = '',\n playlistGroup = '',\n mode = 'row',\n videoFeedConfiguration,\n } = this.props;\n const titleHidden = videoFeedConfiguration?.title?.hidden ?? false;\n const titlePosition = videoFeedConfiguration?.titlePosition ?? 'nested';\n const customLayoutName = videoFeedConfiguration?.customLayoutName ?? '';\n const shareBaseURL = FireworkSDK.getInstance().shareBaseURL ?? '';\n const adBadgeConfiguration =\n FireworkSDK.getInstance().adBadgeConfiguration ?? {};\n const adBadgeTextType = adBadgeConfiguration.badgeTextType ?? '';\n const backgroundColorOfAdBadge = adBadgeConfiguration.backgroundColor ?? '';\n const textColorOfAdBadge = adBadgeConfiguration.textColor ?? '';\n const dynamicContentParametersString =\n this._generateDynamicContentParametersString();\n\n let key = `source:${source}`;\n key += `_channel:${channel}`;\n key += `_playlist:${playlist}`;\n key += `_playlistGroup:${playlistGroup}`;\n key += `_mode:${mode}`;\n key += `_titleHidden:${titleHidden}`;\n key += `_titlePosition:${titlePosition}`;\n key += `_customLayoutName:${customLayoutName}`;\n key += `_shareBaseURL:${shareBaseURL}`;\n key += `_adBadgeTextType:${adBadgeTextType}`;\n key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;\n key += `_textColorOfAdBadge:${textColorOfAdBadge}`;\n key += `_dynamicContentParameters:${dynamicContentParametersString}`;\n\n return (\n <FWVideoFeed\n key={key}\n {...this.props}\n ref={this.nativeComponentRef}\n onVideoFeedLoadFinished={this._onVideoFeedLoadFinished}\n mode={mode}\n style={Object.assign({}, this.props.style, { zIndex: -1 })}\n />\n );\n }\n\n private _generateDynamicContentParametersString(): string {\n const { dynamicContentParameters } = this.props;\n if (!dynamicContentParameters) {\n return '';\n }\n\n let resultString = '';\n const sortedKeyList = Object.keys(dynamicContentParameters).sort();\n for (const key of sortedKeyList) {\n const value = dynamicContentParameters[key];\n const valueString = value.join(',');\n if (resultString.length > 0) {\n resultString += '_';\n }\n\n resultString += `${key}:${valueString}`;\n }\n\n return resultString;\n }\n}\n"]}
@@ -32,5 +32,5 @@ export default class FWLoggerUtil {
32
32
 
33
33
  }
34
34
 
35
- _defineProperty(FWLoggerUtil, "enabled", false);
35
+ _defineProperty(FWLoggerUtil, "enabled", true);
36
36
  //# sourceMappingURL=FWLoggerUtil.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["FWLoggerUtil.ts"],"names":["FWLoggerUtil","log","message","enabled","process","env","NODE_ENV","currentDate","Date","console","toISOString","logNativeMessage","nativeMessage","date","timezoneOffset","getTimezoneOffset","timezoneSymbol","timezoneHours","Math","floor","abs","toString","padStart","timezoneMinutes","timezoneString","year","getFullYear","month","getMonth","day","getDate","hours","getHours","minutes","getMinutes","seconds","getSeconds","milliseconds","getMilliseconds"],"mappings":";;AAAA,eAAe,MAAMA,YAAN,CAAmB;AAEtB,SAAHC,GAAG,CAACC,OAAD,EAAkB;AAC1B,QAAIF,YAAY,CAACG,OAAb,IAAwBC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,aAArD,EAAoE;AAClE,YAAMC,WAAW,GAAG,IAAIC,IAAJ,EAApB;AAEAC,MAAAA,OAAO,CAACR,GAAR,CACE,6BADF,EAEG,GAAEC,OAAQ,IAAGF,YAAY,CAACU,WAAb,CAAyBH,WAAzB,CAAsC,EAFtD;AAID;AACF;;AAEsB,SAAhBI,gBAAgB,CAACC,aAAD,EAAwB;AAC7C,QAAIZ,YAAY,CAACG,OAAb,IAAwBC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,aAArD,EAAoE;AAClEG,MAAAA,OAAO,CAACR,GAAR,CAAY,sCAAZ,EAAoDW,aAApD;AACD;AACF;;AAEyB,SAAXF,WAAW,CAACG,IAAD,EAAqB;AAC7C,QAAIC,cAAc,GAAG,CAACD,IAAI,CAACE,iBAAL,EAAtB;AACA,QAAIC,cAAc,GAAGF,cAAc,IAAI,CAAlB,GAAsB,GAAtB,GAA4B,GAAjD;AACA,QAAIG,aAAa,GAAGC,IAAI,CAACC,KAAL,CAAWD,IAAI,CAACE,GAAL,CAASN,cAAT,IAA2B,EAAtC,EACjBO,QADiB,GAEjBC,QAFiB,CAER,CAFQ,EAEL,GAFK,CAApB;AAGA,QAAIC,eAAe,GAAG,CAACL,IAAI,CAACE,GAAL,CAASN,cAAT,IAA2B,EAA5B,EACnBO,QADmB,GAEnBC,QAFmB,CAEV,CAFU,EAEP,GAFO,CAAtB;AAGA,QAAIE,cAAc,GAAI,GAAER,cAAe,GAAEC,aAAc,IAAGM,eAAgB,EAA1E;AACA,QAAIE,IAAI,GAAGZ,IAAI,CAACa,WAAL,GAAmBL,QAAnB,EAAX;AACA,QAAIM,KAAK,GAAG,CAACd,IAAI,CAACe,QAAL,KAAkB,CAAnB,EAAsBP,QAAtB,GAAiCC,QAAjC,CAA0C,CAA1C,EAA6C,GAA7C,CAAZ;AACA,QAAIO,GAAG,GAAGhB,IAAI,CAACiB,OAAL,GAAeT,QAAf,GAA0BC,QAA1B,CAAmC,CAAnC,EAAsC,GAAtC,CAAV;AACA,QAAIS,KAAK,GAAGlB,IAAI,CAACmB,QAAL,GAAgBX,QAAhB,GAA2BC,QAA3B,CAAoC,CAApC,EAAuC,GAAvC,CAAZ;AACA,QAAIW,OAAO,GAAGpB,IAAI,CAACqB,UAAL,GAAkBb,QAAlB,GAA6BC,QAA7B,CAAsC,CAAtC,EAAyC,GAAzC,CAAd;AACA,QAAIa,OAAO,GAAGtB,IAAI,CAACuB,UAAL,GAAkBf,QAAlB,GAA6BC,QAA7B,CAAsC,CAAtC,EAAyC,GAAzC,CAAd;AACA,QAAIe,YAAY,GAAGxB,IAAI,CAACyB,eAAL,GAAuBjB,QAAvB,GAAkCC,QAAlC,CAA2C,CAA3C,EAA8C,GAA9C,CAAnB;AAEA,WAAQ,GAAEG,IAAK,IAAGE,KAAM,IAAGE,GAAI,IAAGE,KAAM,IAAGE,OAAQ,IAAGE,OAAQ,IAAGE,YAAa,GAAEb,cAAe,EAA/F;AACD;;AAtC+B;;gBAAbxB,Y,aACO,K","sourcesContent":["export default class FWLoggerUtil {\n static enabled: boolean = false;\n static log(message: string) {\n if (FWLoggerUtil.enabled && process.env.NODE_ENV === 'development') {\n const currentDate = new Date();\n\n console.log(\n '[react-native-firework-sdk]',\n `${message} ${FWLoggerUtil.toISOString(currentDate)}`\n );\n }\n }\n\n static logNativeMessage(nativeMessage: string) {\n if (FWLoggerUtil.enabled && process.env.NODE_ENV === 'development') {\n console.log('[react-native-firework-sdk] [native]', nativeMessage);\n }\n }\n\n private static toISOString(date: Date): string {\n let timezoneOffset = -date.getTimezoneOffset();\n let timezoneSymbol = timezoneOffset >= 0 ? '+' : '-';\n let timezoneHours = Math.floor(Math.abs(timezoneOffset) / 60)\n .toString()\n .padStart(2, '0');\n let timezoneMinutes = (Math.abs(timezoneOffset) % 60)\n .toString()\n .padStart(2, '0');\n let timezoneString = `${timezoneSymbol}${timezoneHours}:${timezoneMinutes}`;\n let year = date.getFullYear().toString();\n let month = (date.getMonth() + 1).toString().padStart(2, '0');\n let day = date.getDate().toString().padStart(2, '0');\n let hours = date.getHours().toString().padStart(2, '0');\n let minutes = date.getMinutes().toString().padStart(2, '0');\n let seconds = date.getSeconds().toString().padStart(2, '0');\n let milliseconds = date.getMilliseconds().toString().padStart(3, '0');\n\n return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}.${milliseconds}${timezoneString}`;\n }\n}\n"]}
1
+ {"version":3,"sources":["FWLoggerUtil.ts"],"names":["FWLoggerUtil","log","message","enabled","process","env","NODE_ENV","currentDate","Date","console","toISOString","logNativeMessage","nativeMessage","date","timezoneOffset","getTimezoneOffset","timezoneSymbol","timezoneHours","Math","floor","abs","toString","padStart","timezoneMinutes","timezoneString","year","getFullYear","month","getMonth","day","getDate","hours","getHours","minutes","getMinutes","seconds","getSeconds","milliseconds","getMilliseconds"],"mappings":";;AAAA,eAAe,MAAMA,YAAN,CAAmB;AAEtB,SAAHC,GAAG,CAACC,OAAD,EAAkB;AAC1B,QAAIF,YAAY,CAACG,OAAb,IAAwBC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,aAArD,EAAoE;AAClE,YAAMC,WAAW,GAAG,IAAIC,IAAJ,EAApB;AAEAC,MAAAA,OAAO,CAACR,GAAR,CACE,6BADF,EAEG,GAAEC,OAAQ,IAAGF,YAAY,CAACU,WAAb,CAAyBH,WAAzB,CAAsC,EAFtD;AAID;AACF;;AAEsB,SAAhBI,gBAAgB,CAACC,aAAD,EAAwB;AAC7C,QAAIZ,YAAY,CAACG,OAAb,IAAwBC,OAAO,CAACC,GAAR,CAAYC,QA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AA7B,CAAsC,CAAtC,EAAyC,GAAzC,CAAd;AACA,QAAIe,YAAY,GAAGxB,IAAI,CAACyB,eAAL,GAAuBjB,QAAvB,GAAkCC,QAAlC,CAA2C,CAA3C,EAA8C,GAA9C,CAAnB;AAEA,WAAQ,GAAEG,IAAK,IAAGE,KAAM,IAAGE,GAAI,IAAGE,KAAM,IAAGE,OAAQ,IAAGE,OAAQ,IAAGE,YAAa,GAAEb,cAAe,EAA/F;AACD;;AAtC+B;;gBAAbxB,Y,aACO,I","sourcesContent":["export default class FWLoggerUtil {\n static enabled: boolean = true;\n static log(message: string) {\n if (FWLoggerUtil.enabled && process.env.NODE_ENV === 'development') {\n const currentDate = new Date();\n\n console.log(\n '[react-native-firework-sdk]',\n `${message} ${FWLoggerUtil.toISOString(currentDate)}`\n );\n }\n }\n\n static logNativeMessage(nativeMessage: string) {\n if (FWLoggerUtil.enabled && process.env.NODE_ENV === 'development') {\n console.log('[react-native-firework-sdk] [native]', nativeMessage);\n }\n }\n\n private static toISOString(date: Date): string {\n let timezoneOffset = -date.getTimezoneOffset();\n let timezoneSymbol = timezoneOffset >= 0 ? '+' : '-';\n let timezoneHours = Math.floor(Math.abs(timezoneOffset) / 60)\n .toString()\n .padStart(2, '0');\n let timezoneMinutes = (Math.abs(timezoneOffset) % 60)\n .toString()\n .padStart(2, '0');\n let timezoneString = `${timezoneSymbol}${timezoneHours}:${timezoneMinutes}`;\n let year = date.getFullYear().toString();\n let month = (date.getMonth() + 1).toString().padStart(2, '0');\n let day = date.getDate().toString().padStart(2, '0');\n let hours = date.getHours().toString().padStart(2, '0');\n let minutes = date.getMinutes().toString().padStart(2, '0');\n let seconds = date.getSeconds().toString().padStart(2, '0');\n let milliseconds = date.getMilliseconds().toString().padStart(3, '0');\n\n return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}.${milliseconds}${timezoneString}`;\n }\n}\n"]}
@@ -11,23 +11,23 @@ export interface IVideoFeedProps {
11
11
  */
12
12
  style?: StyleProp<ViewStyle>;
13
13
  /**
14
- * One of three available video feed sources.
14
+ * One of five available video feed sources.
15
15
  */
16
16
  source: VideoFeedSource;
17
17
  /**
18
- * Channel name from which content should be displayed. Videos are ordered as a channel timeline. The prop is required when the source is set as channel or playlist.
18
+ * Channel id of the feed. Required when the source is set as channel or playlist or dynamicContent.
19
19
  */
20
20
  channel?: string;
21
21
  /**
22
- * Playlist Id for selected content. Please note channel name is necessary. Required when the source is set as playlist.
22
+ * Playlist id of the feed. Please note channel id is necessary. Required when the source is set as playlist.
23
23
  */
24
24
  playlist?: string;
25
25
  /**
26
- * PlaylistGroup Id for selected content. Required when the source is set as playlistGroup.
26
+ * PlaylistGroup id of the feed. Required when the source is set as playlistGroup.
27
27
  */
28
28
  playlistGroup?: string;
29
29
  /**
30
- * The parameters to be passed to a dynamic content feed. Required when the source is set as dynamicContent.
30
+ * The dynamic content parameters of the feed. Required when the source is set as dynamicContent.
31
31
  */
32
32
  dynamicContentParameters?: {
33
33
  [key: string]: string[];
@@ -37,15 +37,15 @@ export interface IVideoFeedProps {
37
37
  */
38
38
  mode?: VideoFeedMode;
39
39
  /**
40
- * Configuration of Video Feed.
40
+ * Configuration of the feed.
41
41
  */
42
42
  videoFeedConfiguration?: VideoFeedConfiguration;
43
43
  /**
44
- * Configuration of Video Player.
44
+ * Configuration of the player.
45
45
  */
46
46
  videoPlayerConfiguration?: VideoPlayerConfiguration;
47
47
  /**
48
- * Video feed loading result callback. It means loading successfully when error equals to undefined.
48
+ * The feed loading result callback. It means loading successfully when error equals to undefined.
49
49
  */
50
50
  onVideoFeedLoadFinished?: (error?: FWError) => void;
51
51
  }
@@ -6,16 +6,42 @@ export default interface FeedItemDetails {
6
6
  index: number;
7
7
  /**
8
8
  * The unique id of the thumbnail.
9
- * If the source is `playlistGroup` this value will represent the playlist's id; otherwise this value is the id of the selected video.
9
+ * If the source is playlistGroup this value will represent the playlist's id; otherwise this value is the id of the selected video.
10
10
  */
11
11
  id: string;
12
12
  /**
13
13
  * The total duration of the video.
14
- * If the source is `playlistGroup` this value will always be 0; otherwise this value is the duration of the selected video.
14
+ * If the source is playlistGroup this value will always be 0.
15
+ * Otherwise this value is the duration of the selected video.
15
16
  */
16
17
  duration: number;
17
18
  /**
18
- * The content source of the feed.
19
+ * The title of the feed item.
20
+ * Currently, the property doesn't have value on the Android side when the source is playlistGroup.
21
+ * But the property has value for other feed sources.
22
+ */
23
+ title?: string | null;
24
+ /**
25
+ * The source of the feed.
19
26
  */
20
27
  source: VideoFeedSource;
28
+ /**
29
+ * The channel id of the feed.
30
+ * The property has value when the source is channel or playlist or dynamicContent.
31
+ */
32
+ channel?: string | null;
33
+ /**
34
+ * Playlist id of the feed. The property has value when the source is playlist.
35
+ */
36
+ playlist?: string | null;
37
+ /**
38
+ * Playlist group id of the feed. The property has value when the source is playlistGroup.
39
+ */
40
+ playlistGroup?: string | null;
41
+ /**
42
+ * The dynamic content parameters of the feed. The property has value when the source is dynamicContent.
43
+ */
44
+ dynamicContentParameters?: {
45
+ [key: string]: string[];
46
+ } | null;
21
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-firework-sdk",
3
- "version": "1.2.1",
3
+ "version": "1.2.4-beta.1",
4
4
  "description": "Firework React Native SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -26,42 +26,39 @@ export interface IVideoFeedProps {
26
26
  */
27
27
  style?: StyleProp<ViewStyle>;
28
28
  /**
29
- * One of three available video feed sources.
29
+ * One of five available video feed sources.
30
30
  */
31
31
  source: VideoFeedSource;
32
32
  /**
33
- * Channel name from which content should be displayed. Videos are ordered as a channel timeline. The prop is required when the source is set as channel or playlist.
33
+ * Channel id of the feed. Required when the source is set as channel or playlist or dynamicContent.
34
34
  */
35
35
  channel?: string;
36
36
  /**
37
- * Playlist Id for selected content. Please note channel name is necessary. Required when the source is set as playlist.
37
+ * Playlist id of the feed. Please note channel id is necessary. Required when the source is set as playlist.
38
38
  */
39
39
  playlist?: string;
40
-
41
40
  /**
42
- * PlaylistGroup Id for selected content. Required when the source is set as playlistGroup.
41
+ * PlaylistGroup id of the feed. Required when the source is set as playlistGroup.
43
42
  */
44
43
  playlistGroup?: string;
45
-
46
44
  /**
47
- * The parameters to be passed to a dynamic content feed. Required when the source is set as dynamicContent.
45
+ * The dynamic content parameters of the feed. Required when the source is set as dynamicContent.
48
46
  */
49
47
  dynamicContentParameters?: { [key: string]: string[] };
50
-
51
48
  /**
52
49
  * One of three available display modes. Defaults to row.
53
50
  */
54
51
  mode?: VideoFeedMode;
55
52
  /**
56
- * Configuration of Video Feed.
53
+ * Configuration of the feed.
57
54
  */
58
55
  videoFeedConfiguration?: VideoFeedConfiguration;
59
56
  /**
60
- * Configuration of Video Player.
57
+ * Configuration of the player.
61
58
  */
62
59
  videoPlayerConfiguration?: VideoPlayerConfiguration;
63
60
  /**
64
- * Video feed loading result callback. It means loading successfully when error equals to undefined.
61
+ * The feed loading result callback. It means loading successfully when error equals to undefined.
65
62
  */
66
63
  onVideoFeedLoadFinished?: (error?: FWError) => void;
67
64
  }
@@ -7,16 +7,40 @@ export default interface FeedItemDetails {
7
7
  index: number;
8
8
  /**
9
9
  * The unique id of the thumbnail.
10
- * If the source is `playlistGroup` this value will represent the playlist's id; otherwise this value is the id of the selected video.
10
+ * If the source is playlistGroup this value will represent the playlist's id; otherwise this value is the id of the selected video.
11
11
  */
12
12
  id: string;
13
13
  /**
14
14
  * The total duration of the video.
15
- * If the source is `playlistGroup` this value will always be 0; otherwise this value is the duration of the selected video.
15
+ * If the source is playlistGroup this value will always be 0.
16
+ * Otherwise this value is the duration of the selected video.
16
17
  */
17
18
  duration: number;
18
19
  /**
19
- * The content source of the feed.
20
+ * The title of the feed item.
21
+ * Currently, the property doesn't have value on the Android side when the source is playlistGroup.
22
+ * But the property has value for other feed sources.
23
+ */
24
+ title?: string | null;
25
+ /**
26
+ * The source of the feed.
20
27
  */
21
28
  source: VideoFeedSource;
29
+ /**
30
+ * The channel id of the feed.
31
+ * The property has value when the source is channel or playlist or dynamicContent.
32
+ */
33
+ channel?: string | null;
34
+ /**
35
+ * Playlist id of the feed. The property has value when the source is playlist.
36
+ */
37
+ playlist?: string | null;
38
+ /**
39
+ * Playlist group id of the feed. The property has value when the source is playlistGroup.
40
+ */
41
+ playlistGroup?: string | null;
42
+ /**
43
+ * The dynamic content parameters of the feed. The property has value when the source is dynamicContent.
44
+ */
45
+ dynamicContentParameters?: { [key: string]: string[] } | null;
22
46
  }
@@ -1,5 +1,5 @@
1
1
  export default class FWLoggerUtil {
2
- static enabled: boolean = false;
2
+ static enabled: boolean = true;
3
3
  static log(message: string) {
4
4
  if (FWLoggerUtil.enabled && process.env.NODE_ENV === 'development') {
5
5
  const currentDate = new Date();