react-native-firework-sdk 1.0.4 → 1.1.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.
- package/LICENSE +202 -0
- package/README.md +2 -40
- package/android/build.gradle +6 -3
- package/android/gradle.properties +2 -1
- package/android/proguard-rules.pro +22 -0
- package/android/publish.gradle +4 -3
- package/android/settings.gradle +1 -0
- package/android/src/main/AndroidManifest.xml +5 -2
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +226 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/constants/FWCommandConstant.kt +1 -1
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/constants/FWVideoPlayerConstant.kt +13 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModel.kt +9 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWEventName.kt +10 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWLiveStreamEventDetailsModel.kt +9 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWLiveStreamMessageDetailsModel.kt +11 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModel.kt +28 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoFeedItemDetailsModel.kt +2 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedModel.kt +7 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +18 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoFeedSource.kt +2 -1
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoFeedTitlePosition.kt +1 -1
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoPlaybackDetails.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +23 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoShoppingProduct.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/WeakProperty.kt +19 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/FireworkSDKPackage.kt +10 -5
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +175 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWLiveStreamInterface.kt +5 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/models/FWVideoShoppingInterface.kt +3 -2
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/models/FireworkSDKInterface.kt +4 -2
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWLiveStreamModule.kt +88 -0
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/module/FWVideoShoppingModule.kt +53 -39
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/module/FireworkSDKModule.kt +23 -22
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/pages/FWVideoShoppingCartActivity.kt +4 -4
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/utils/FWEventUtils.kt +61 -7
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/utils/FWJsonUtils.kt +29 -1
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/utils/FWLogUtils.kt +2 -2
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/utils/FWUrlUtils.kt +1 -1
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWVideoPlayerUtils.kt +94 -0
- package/android/src/main/res/layout/fw_bridge_fragment_playlistfeed.xml +18 -0
- package/android/src/main/res/layout/{fwrn_fragment_shoppingcart.xml → fw_bridge_fragment_shoppingcart.xml} +1 -1
- package/android/src/main/res/layout/{fwrn_fragment_videofeed.xml → fw_bridge_fragment_videofeed.xml} +2 -1
- package/android/src/main/res/values/colors.xml +4 -0
- package/ios/{Component → Components}/VideoFeed.swift +60 -3
- package/ios/{Component → Components}/VideoFeedConfiguration.swift +2 -0
- package/ios/{Component → Components}/VideoFeedManager.m +2 -0
- package/ios/{Component → Components}/VideoFeedManager.swift +0 -0
- package/ios/{Component → Components}/VideoPlayerConfiguration.swift +7 -0
- package/ios/Models/{FireworkJsEvent.swift → NativeToRN/FireworkEventName.swift} +20 -0
- package/ios/Models/{FireworkSDK+JsModel.swift → NativeToRN/FireworkSDK+Json.swift} +33 -3
- package/ios/Models/{RCTConvert+FireworkSDKModule.swift → RNToNative/RCTConvert+FireworkSDKModule.swift} +20 -0
- package/ios/Models/{RCTConvert+Shopping.swift → RNToNative/RCTConvert+Shopping.swift} +15 -0
- package/ios/Models/{RCTConvert+VideoFeed.swift → RNToNative/RCTConvert+VideoFeed.swift} +2 -1
- package/ios/Modules/FireworkSDKModule/AdBadgeConfiguration.swift +18 -0
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+CTA.swift +1 -1
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +10 -14
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +2 -1
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +16 -4
- package/ios/Modules/LiveStream/LiveStreamModule.m +14 -0
- package/ios/Modules/LiveStream/LiveStreamModule.swift +43 -0
- package/ios/Modules/Shopping/ShoppingModule.m +1 -1
- package/ios/Modules/Shopping/ShoppingModule.swift +10 -9
- package/lib/commonjs/FireworkSDK.js +61 -38
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/LiveStream.js +60 -0
- package/lib/commonjs/LiveStream.js.map +1 -0
- package/lib/commonjs/VideoShopping.js +20 -18
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +47 -2
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/index.js +24 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/AdBadgeConfiguration.js +2 -0
- package/lib/commonjs/models/{ADConfig.js.map → AdBadgeConfiguration.js.map} +0 -0
- package/lib/commonjs/models/AdConfig.js +2 -0
- package/lib/{module/models/ADConfig.js.map → commonjs/models/AdConfig.js.map} +0 -0
- package/lib/commonjs/models/FWEventName.js +24 -0
- package/lib/commonjs/models/FWEventName.js.map +1 -0
- package/lib/commonjs/models/FWEvents.js +0 -14
- package/lib/commonjs/models/FWEvents.js.map +1 -1
- package/lib/commonjs/models/LiveStreamChatEventName.js +15 -0
- package/lib/commonjs/models/LiveStreamChatEventName.js.map +1 -0
- package/lib/commonjs/models/LiveStreamEventDetails.js +2 -0
- package/lib/commonjs/models/LiveStreamEventDetails.js.map +1 -0
- package/lib/commonjs/models/LiveStreamEventName.js +17 -0
- package/lib/commonjs/models/LiveStreamEventName.js.map +1 -0
- package/lib/commonjs/models/LiveStreamMessageDetails.js +2 -0
- package/lib/commonjs/models/LiveStreamMessageDetails.js.map +1 -0
- package/lib/commonjs/models/VideoFeedSource.js +6 -0
- package/lib/commonjs/models/VideoFeedSource.js.map +1 -0
- package/lib/commonjs/models/VideoPlaybackEventName.js.map +1 -1
- package/lib/commonjs/modules/FireworkSDKModule.js +3 -1
- package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
- package/lib/commonjs/modules/LiveStreamModule.js +22 -0
- package/lib/commonjs/modules/LiveStreamModule.js.map +1 -0
- package/lib/commonjs/modules/ShoppingModule.js +3 -1
- package/lib/commonjs/modules/ShoppingModule.js.map +1 -1
- package/lib/module/FireworkSDK.js +50 -34
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/LiveStream.js +51 -0
- package/lib/module/LiveStream.js.map +1 -0
- package/lib/module/VideoShopping.js +14 -13
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/VideoFeed.js +42 -3
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/index.js +4 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/AdBadgeConfiguration.js +2 -0
- package/lib/module/models/AdBadgeConfiguration.js.map +1 -0
- package/lib/module/models/AdConfig.js +2 -0
- package/lib/module/models/AdConfig.js.map +1 -0
- package/lib/module/models/FWEventName.js +17 -0
- package/lib/module/models/FWEventName.js.map +1 -0
- package/lib/module/models/FWEvents.js +1 -12
- package/lib/module/models/FWEvents.js.map +1 -1
- package/lib/module/models/LiveStreamChatEventName.js +8 -0
- package/lib/module/models/LiveStreamChatEventName.js.map +1 -0
- package/lib/module/models/LiveStreamEventDetails.js +2 -0
- package/lib/module/models/LiveStreamEventDetails.js.map +1 -0
- package/lib/module/models/LiveStreamEventName.js +10 -0
- package/lib/module/models/LiveStreamEventName.js.map +1 -0
- package/lib/module/models/LiveStreamMessageDetails.js +2 -0
- package/lib/module/models/LiveStreamMessageDetails.js.map +1 -0
- package/lib/module/models/VideoFeedSource.js +2 -0
- package/lib/module/models/VideoFeedSource.js.map +1 -0
- package/lib/module/models/VideoPlaybackEventName.js.map +1 -1
- package/lib/module/modules/FireworkSDKModule.js +3 -0
- package/lib/module/modules/FireworkSDKModule.js.map +1 -1
- package/lib/module/modules/LiveStreamModule.js +12 -0
- package/lib/module/modules/LiveStreamModule.js.map +1 -0
- package/lib/module/modules/ShoppingModule.js +3 -1
- package/lib/module/modules/ShoppingModule.js.map +1 -1
- package/lib/typescript/FireworkSDK.d.ts +26 -24
- package/lib/typescript/LiveStream.d.ts +21 -0
- package/lib/typescript/VideoShopping.d.ts +6 -6
- package/lib/typescript/components/VideoFeed.d.ts +11 -4
- package/lib/typescript/index.d.ts +15 -6
- package/lib/typescript/models/AdBadgeConfiguration.d.ts +15 -0
- package/lib/typescript/models/{ADConfig.d.ts → AdConfig.d.ts} +1 -1
- package/lib/typescript/models/FWEventName.d.ts +14 -0
- package/lib/typescript/models/FWEvents.d.ts +15 -12
- package/lib/typescript/models/FeedItemDetails.d.ts +11 -4
- package/lib/typescript/models/LiveStreamChatEventName.d.ts +7 -0
- package/lib/typescript/models/LiveStreamEventDetails.d.ts +3 -0
- package/lib/typescript/models/LiveStreamEventName.d.ts +15 -0
- package/lib/typescript/models/LiveStreamMessageDetails.d.ts +14 -0
- package/lib/typescript/models/VideoFeedConfiguration.d.ts +7 -3
- package/lib/typescript/models/VideoFeedSource.d.ts +2 -0
- package/lib/typescript/models/VideoPlaybackDetails.d.ts +1 -2
- package/lib/typescript/models/VideoPlaybackEventName.d.ts +1 -1
- package/lib/typescript/models/VideoPlayerConfiguration.d.ts +13 -0
- package/lib/typescript/modules/FireworkSDKModule.d.ts +8 -4
- package/lib/typescript/modules/LiveStreamModule.d.ts +8 -0
- package/lib/typescript/modules/ShoppingModule.d.ts +4 -2
- package/package.json +3 -4
- package/react-native-firework-sdk.podspec +3 -1
- package/src/FireworkSDK.ts +49 -33
- package/src/LiveStream.ts +51 -0
- package/src/VideoShopping.ts +15 -13
- package/src/components/VideoFeed.tsx +69 -7
- package/src/index.tsx +32 -15
- package/src/models/AdBadgeConfiguration.ts +16 -0
- package/src/models/{ADConfig.ts → AdConfig.ts} +1 -1
- package/src/models/FWEventName.ts +14 -0
- package/src/models/FWEvents.ts +17 -13
- package/src/models/FeedItemDetails.ts +12 -4
- package/src/models/LiveStreamChatEventName.ts +8 -0
- package/src/models/LiveStreamEventDetails.ts +4 -0
- package/src/models/LiveStreamEventName.ts +16 -0
- package/src/models/LiveStreamMessageDetails.ts +14 -0
- package/src/models/VideoFeedConfiguration.ts +7 -3
- package/src/models/VideoFeedSource.ts +2 -0
- package/src/models/VideoPlaybackDetails.ts +1 -3
- package/src/models/VideoPlaybackEventName.ts +1 -1
- package/src/models/VideoPlayerConfiguration.ts +14 -0
- package/src/modules/FireworkSDKModule.ts +10 -4
- package/src/modules/LiveStreamModule.ts +26 -0
- package/src/modules/ShoppingModule.ts +14 -7
- package/android/src/main/java/com/reactnativefireworksdk/components/videofeed/FWVideoFeed.kt +0 -124
- package/android/src/main/java/com/reactnativefireworksdk/manager/FWVideoFeedManager.kt +0 -88
- package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoFeedConfigModel.kt +0 -27
- package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoFeedMode.kt +0 -7
- package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoPlayerConfigModel.kt +0 -20
- package/android/src/main/java/com/reactnativefireworksdk/utils/FWVideoPlayerUtils.kt +0 -18
- package/lib/commonjs/models/ADConfig.js +0 -2
- package/lib/module/models/ADConfig.js +0 -2
package/android/src/main/java/com/fireworksdk/bridge/models/FWLiveStreamMessageDetailsModel.kt
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models
|
|
2
|
+
|
|
3
|
+
import android.os.Parcelable
|
|
4
|
+
import kotlinx.android.parcel.Parcelize
|
|
5
|
+
|
|
6
|
+
@Parcelize
|
|
7
|
+
data class FWLiveStreamMessageDetailsModel(
|
|
8
|
+
val messageId: String? = null,
|
|
9
|
+
val username: String? = null,
|
|
10
|
+
val text: String? = null,
|
|
11
|
+
) : Parcelable
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models
|
|
2
|
+
|
|
3
|
+
import android.os.Parcelable
|
|
4
|
+
import kotlinx.android.parcel.Parcelize
|
|
5
|
+
|
|
6
|
+
@Parcelize
|
|
7
|
+
data class FWVideoFeedConfigModel(
|
|
8
|
+
var backgroundColor: String? = null,
|
|
9
|
+
var cornerRadius: Int? = null,
|
|
10
|
+
var title: FWTitleModel? = null,
|
|
11
|
+
var titlePosition: String? = null,
|
|
12
|
+
var playIcon: FWPlayIconModel? = null,
|
|
13
|
+
var showAdBadge: Boolean? = null
|
|
14
|
+
) : Parcelable {
|
|
15
|
+
|
|
16
|
+
@Parcelize
|
|
17
|
+
data class FWTitleModel(
|
|
18
|
+
var hidden: Boolean? = null,
|
|
19
|
+
var textColor: String? = null,
|
|
20
|
+
var fontSize: Int? = null,
|
|
21
|
+
) : Parcelable
|
|
22
|
+
|
|
23
|
+
@Parcelize
|
|
24
|
+
data class FWPlayIconModel(
|
|
25
|
+
var hidden: Boolean? = null,
|
|
26
|
+
var iconWidth: Int? = null,
|
|
27
|
+
) : Parcelable
|
|
28
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.fireworksdk.bridge.models
|
|
2
2
|
|
|
3
3
|
import android.os.Parcelable
|
|
4
4
|
import kotlinx.android.parcel.Parcelize
|
|
@@ -8,4 +8,5 @@ data class FWVideoFeedItemDetailsModel(
|
|
|
8
8
|
val index: Int?,
|
|
9
9
|
val id: String?,
|
|
10
10
|
val videoDuration: Int?,
|
|
11
|
+
val source: String?,
|
|
11
12
|
) : Parcelable
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models
|
|
2
|
+
|
|
3
|
+
import android.os.Parcelable
|
|
4
|
+
import com.fireworksdk.bridge.models.FWVideoFeedConfigModel
|
|
5
|
+
import com.fireworksdk.bridge.models.FWVideoPlayerConfigModel
|
|
6
|
+
import kotlinx.android.parcel.Parcelize
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@Parcelize
|
|
10
|
+
data class FWVideoFeedPropsModel(
|
|
11
|
+
var source: String? = null,
|
|
12
|
+
var channel: String? = null,
|
|
13
|
+
var playlist: String? = null,
|
|
14
|
+
var playlistGroup: String? = null,
|
|
15
|
+
var mode: String? = null,
|
|
16
|
+
var videoFeedConfiguration: FWVideoFeedConfigModel? = null,
|
|
17
|
+
var videoPlayerConfiguration: FWVideoPlayerConfigModel? = null,
|
|
18
|
+
) : Parcelable
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models
|
|
2
|
+
|
|
3
|
+
import android.os.Parcelable
|
|
4
|
+
import kotlinx.android.parcel.Parcelize
|
|
5
|
+
|
|
6
|
+
@Parcelize
|
|
7
|
+
data class FWVideoPlayerConfigModel(
|
|
8
|
+
var playerStyle: String? = null,
|
|
9
|
+
var videoCompleteAction: String? = null,
|
|
10
|
+
var showShareButton: Boolean? = null,
|
|
11
|
+
var ctaButtonStyle: FWCtaButtonStyleModel? = null,
|
|
12
|
+
var showMuteButton: Boolean? = null,
|
|
13
|
+
var showPlaybackButton: Boolean? = null,
|
|
14
|
+
var launchBehavior: String? = null,
|
|
15
|
+
) : Parcelable {
|
|
16
|
+
|
|
17
|
+
@Parcelize
|
|
18
|
+
data class FWCtaButtonStyleModel(
|
|
19
|
+
var backgroundColor: String? = null,
|
|
20
|
+
var fontSize: String? = null,
|
|
21
|
+
var textColor: String? = null,
|
|
22
|
+
) : Parcelable
|
|
23
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.models
|
|
2
|
+
|
|
3
|
+
import java.lang.ref.WeakReference
|
|
4
|
+
import kotlin.properties.ReadWriteProperty
|
|
5
|
+
import kotlin.reflect.KProperty
|
|
6
|
+
|
|
7
|
+
fun <V> weakProperty(defaultValue: V? = null) = WeakProperty(defaultValue)
|
|
8
|
+
|
|
9
|
+
class WeakProperty<V>(defaultValue: V? = null) : ReadWriteProperty<Any?, V?> {
|
|
10
|
+
private var reference: WeakReference<V>? = WeakReference(defaultValue)
|
|
11
|
+
|
|
12
|
+
override fun getValue(thisRef: Any?, property: KProperty<*>): V? {
|
|
13
|
+
return reference?.get()
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
override fun setValue(thisRef: Any?, property: KProperty<*>, value: V?) {
|
|
17
|
+
reference = if (value != null) WeakReference(value) else null
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.fireworksdk.bridge.reactnative
|
|
2
2
|
|
|
3
3
|
import com.facebook.react.ReactPackage
|
|
4
4
|
import com.facebook.react.bridge.NativeModule
|
|
5
5
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
6
|
import com.facebook.react.uimanager.ViewManager
|
|
7
|
-
import com.
|
|
8
|
-
import com.
|
|
9
|
-
import com.
|
|
7
|
+
import com.fireworksdk.bridge.reactnative.manager.FWVideoFeedManager
|
|
8
|
+
import com.fireworksdk.bridge.reactnative.module.FWLiveStreamModule
|
|
9
|
+
import com.fireworksdk.bridge.reactnative.module.FWVideoShoppingModule
|
|
10
|
+
import com.fireworksdk.bridge.reactnative.module.FireworkSDKModule
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class FireworkSDKPackage : ReactPackage {
|
|
13
14
|
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
|
|
14
|
-
return listOf(
|
|
15
|
+
return listOf(
|
|
16
|
+
FireworkSDKModule(reactContext),
|
|
17
|
+
FWVideoShoppingModule(reactContext),
|
|
18
|
+
FWLiveStreamModule(reactContext)
|
|
19
|
+
)
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.reactnative.manager
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import com.facebook.react.bridge.ReadableArray
|
|
5
|
+
import com.facebook.react.bridge.ReadableMap
|
|
6
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
|
7
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
8
|
+
|
|
9
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
10
|
+
import com.fireworksdk.bridge.constants.FWCommandConstant
|
|
11
|
+
import com.fireworksdk.bridge.models.FWVideoFeedConfigModel
|
|
12
|
+
import com.fireworksdk.bridge.models.FWVideoPlayerConfigModel
|
|
13
|
+
import com.fireworksdk.bridge.utils.FWJsonUtils
|
|
14
|
+
import com.facebook.react.common.MapBuilder
|
|
15
|
+
import com.fireworksdk.bridge.components.videofeed.FWVideoFeed
|
|
16
|
+
import com.fireworksdk.bridge.models.FWFeedViewEventName
|
|
17
|
+
import com.fireworksdk.bridge.models.FWVideoFeedItemDetailsModel
|
|
18
|
+
import com.fireworksdk.bridge.reactnative.utils.FWEventUtils
|
|
19
|
+
import com.fireworksdk.bridge.utils.FWLogUtils
|
|
20
|
+
import com.loopnow.fireworklibrary.models.OnPlaylistGroupItemClickedListener
|
|
21
|
+
import com.loopnow.fireworklibrary.models.VideoContentStatus
|
|
22
|
+
import com.loopnow.fireworklibrary.views.OnItemClickedListener
|
|
23
|
+
import com.loopnow.fireworklibrary.views.OnVideoContentStatusListener
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class FWVideoFeedManager : SimpleViewManager<FWVideoFeed>() {
|
|
27
|
+
|
|
28
|
+
private lateinit var reactContext: ThemedReactContext
|
|
29
|
+
private lateinit var videoFeed: FWVideoFeed
|
|
30
|
+
|
|
31
|
+
override fun getName(): String {
|
|
32
|
+
return "FWVideoFeed"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
override fun createViewInstance(reactContext: ThemedReactContext): FWVideoFeed {
|
|
36
|
+
this.reactContext = reactContext
|
|
37
|
+
videoFeed = FWVideoFeed(reactContext.currentActivity as Activity)
|
|
38
|
+
return videoFeed
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
private fun addVideoFeedListener(reactContext: ThemedReactContext, videoFeed: FWVideoFeed?) {
|
|
42
|
+
val videoFeedView = videoFeed?.videoFeedView
|
|
43
|
+
videoFeedView?.addOnItemClickedListener(object: OnItemClickedListener {
|
|
44
|
+
override fun onItemClicked(index: Int, title: String, id: String, videoDuration: Long) {
|
|
45
|
+
val fwVideoFeedItemDetailsModel = FWVideoFeedItemDetailsModel(
|
|
46
|
+
index, id, videoDuration.toInt(), videoFeed.videoFeedPropsModel.source
|
|
47
|
+
)
|
|
48
|
+
FWEventUtils.sendVideoFeedClickEvent(reactContext, fwVideoFeedItemDetailsModel)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
override fun onItemClicked(index: Int) {
|
|
52
|
+
super.onItemClicked(index)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
override fun onItemClicked(index: Int, feedId: Int): Boolean {
|
|
56
|
+
return super.onItemClicked(index, feedId)
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
videoFeedView?.addOnVideoContentStatusListener(object: OnVideoContentStatusListener {
|
|
60
|
+
override fun currentStatus(status: VideoContentStatus, extra: String) {
|
|
61
|
+
when (status) {
|
|
62
|
+
VideoContentStatus.LoadingContent -> {
|
|
63
|
+
FWLogUtils.d { "VideoContentStatus.LoadingContent" }
|
|
64
|
+
}
|
|
65
|
+
VideoContentStatus.LoadingContentFailed -> {
|
|
66
|
+
FWLogUtils.e { "VideoContentStatus.LoadingContentFailed" }
|
|
67
|
+
FWEventUtils.receiveVideoFeedLoadFinishedFailedEvent(reactContext, videoFeedView.id, VideoContentStatus.LoadingContentFailed.rawValue, extra)
|
|
68
|
+
}
|
|
69
|
+
VideoContentStatus.ContentLoaded -> {
|
|
70
|
+
FWLogUtils.d { "VideoContentStatus.ContentLoaded" }
|
|
71
|
+
FWEventUtils.receiveVideoFeedLoadFinishedSuccessEvent(reactContext, videoFeedView.id)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
private fun addPlaylistGroupFeedListener(reactContext: ThemedReactContext, videoFeed: FWVideoFeed?) {
|
|
79
|
+
val playlistGroupFeedView = videoFeed?.playlistGroupFeedView
|
|
80
|
+
playlistGroupFeedView?.itemClickHandler = object : OnPlaylistGroupItemClickedListener {
|
|
81
|
+
override fun onItemClicked(index: Int, id: String?): Boolean {
|
|
82
|
+
val fwVideoFeedItemDetailsModel = FWVideoFeedItemDetailsModel(
|
|
83
|
+
index, id, 0, videoFeed?.videoFeedPropsModel?.source
|
|
84
|
+
)
|
|
85
|
+
FWEventUtils.sendVideoFeedClickEvent(reactContext, fwVideoFeedItemDetailsModel)
|
|
86
|
+
return false
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
playlistGroupFeedView?.addOnVideoContentStatusListener(object: OnVideoContentStatusListener {
|
|
91
|
+
override fun currentStatus(status: VideoContentStatus, extra: String) {
|
|
92
|
+
when (status) {
|
|
93
|
+
VideoContentStatus.LoadingContent -> {
|
|
94
|
+
FWLogUtils.d { "VideoContentStatus.LoadingContent" }
|
|
95
|
+
}
|
|
96
|
+
VideoContentStatus.LoadingContentFailed -> {
|
|
97
|
+
FWLogUtils.e { "VideoContentStatus.LoadingContentFailed" }
|
|
98
|
+
FWEventUtils.receiveVideoFeedLoadFinishedFailedEvent(reactContext, playlistGroupFeedView.id, VideoContentStatus.LoadingContentFailed.rawValue, extra)
|
|
99
|
+
}
|
|
100
|
+
VideoContentStatus.ContentLoaded -> {
|
|
101
|
+
FWLogUtils.d { "VideoContentStatus.ContentLoaded" }
|
|
102
|
+
FWEventUtils.receiveVideoFeedLoadFinishedSuccessEvent(reactContext, playlistGroupFeedView.id)
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@ReactProp(name = "source")
|
|
110
|
+
fun setSource(view: FWVideoFeed, source: String?) {
|
|
111
|
+
view.setSourceProps(source)
|
|
112
|
+
addVideoFeedListener(reactContext, videoFeed)
|
|
113
|
+
addPlaylistGroupFeedListener(reactContext, videoFeed)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@ReactProp(name = "channel")
|
|
117
|
+
fun setChannel(view: FWVideoFeed, channel: String?) {
|
|
118
|
+
view.setChannelProps(channel)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@ReactProp(name = "playlist")
|
|
122
|
+
fun setPlaylist(view: FWVideoFeed, playlist: String?) {
|
|
123
|
+
view.setPlaylistProps(playlist)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@ReactProp(name = "playlistGroup")
|
|
127
|
+
fun setPlaylistGroup(view: FWVideoFeed, playlistGroup: String?) {
|
|
128
|
+
view.setPlaylistGroupProps(playlistGroup)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@ReactProp(name = "mode")
|
|
132
|
+
fun setMode(view: FWVideoFeed, mode: String?) {
|
|
133
|
+
view.setModeProps(mode)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@ReactProp(name = "videoFeedConfiguration")
|
|
137
|
+
fun setVideoFeedConfig(view: FWVideoFeed, config: ReadableMap?) {
|
|
138
|
+
val configMap = config?.toHashMap()
|
|
139
|
+
val videoFeedConfigModel = FWJsonUtils.fromMap(configMap, FWVideoFeedConfigModel::class.java)
|
|
140
|
+
view.setVideoFeedConfigProps(videoFeedConfigModel)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@ReactProp(name = "videoPlayerConfiguration")
|
|
144
|
+
fun setVideoPlayerConfig(view: FWVideoFeed, config: ReadableMap?) {
|
|
145
|
+
val configMap = config?.toHashMap()
|
|
146
|
+
val videoPlayerConfigModel = FWJsonUtils.fromMap(configMap, FWVideoPlayerConfigModel::class.java)
|
|
147
|
+
view.setVideoPlayerConfigProps(videoPlayerConfigModel)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
override fun getCommandsMap(): MutableMap<String, Int> {
|
|
151
|
+
val map: MutableMap<String, Int> = HashMap()
|
|
152
|
+
map["refresh"] = FWCommandConstant.FW_COMMAND_VIDEO_FEED_REFRESH
|
|
153
|
+
return map
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
override fun receiveCommand(root: FWVideoFeed, commandId: Int, args: ReadableArray?) {
|
|
157
|
+
when (commandId) {
|
|
158
|
+
FWCommandConstant.FW_COMMAND_VIDEO_FEED_REFRESH -> {
|
|
159
|
+
root.refresh()
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* To map the "onVideoFeedLoadFinished" event name to the "onVideoFeedLoadFinished" callback prop in JavaScript
|
|
166
|
+
* first onVideoFeedLoadFinished is event name
|
|
167
|
+
* second onVideoFeedLoadFinished is callback prop in JavaScript
|
|
168
|
+
*/
|
|
169
|
+
override fun getExportedCustomBubblingEventTypeConstants(): MutableMap<String, Any>? {
|
|
170
|
+
return MapBuilder.builder<String, Any>()
|
|
171
|
+
.put(FWFeedViewEventName.VideoFeedLoadFinished.rawValue, MapBuilder.of("phasedRegistrationNames", MapBuilder.of("bubbled", FWFeedViewEventName.VideoFeedLoadFinished.rawValue)))
|
|
172
|
+
.build()
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.fireworksdk.bridge.reactnative.models
|
|
2
2
|
|
|
3
|
+
import com.facebook.react.bridge.ReadableArray
|
|
3
4
|
import com.facebook.react.bridge.ReadableMap
|
|
4
5
|
|
|
5
6
|
interface FWVideoShoppingInterface {
|
|
6
7
|
|
|
7
8
|
fun init()
|
|
8
|
-
fun
|
|
9
|
+
fun updateVideoProducts(productArray: ReadableArray?, videoId: String?)
|
|
9
10
|
fun updateProductViewConfig(config: ReadableMap?, callbackId: Int?)
|
|
10
11
|
fun updateAddToCartStatus(res: String?, tip: String?, callbackId: Int?)
|
|
11
12
|
fun jumpToCartPage(callbackId: Int?)
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.fireworksdk.bridge.reactnative.models
|
|
2
2
|
|
|
3
|
+
import com.facebook.react.bridge.Promise
|
|
3
4
|
import com.facebook.react.bridge.ReadableMap
|
|
4
5
|
|
|
5
6
|
interface FireworkSDKInterface {
|
|
6
7
|
|
|
7
8
|
fun init(userId: String?, adConfig: ReadableMap?)
|
|
8
9
|
fun openVideoPlayer(url: String, config: ReadableMap?)
|
|
9
|
-
fun setShareBaseURL(url: String
|
|
10
|
+
fun setShareBaseURL(url: String?, promise: Promise)
|
|
11
|
+
fun setAdBadgeConfiguration(config: ReadableMap?, promise: Promise)
|
|
10
12
|
fun setCustomCTAClickEnabled(value: Boolean?)
|
|
11
13
|
fun setVideoPlaybackEventEnabled(value: Boolean?)
|
|
12
14
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.reactnative.module
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
4
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
5
|
+
import com.facebook.react.bridge.ReactMethod
|
|
6
|
+
import com.fireworksdk.bridge.models.FWLiveStreamMessageDetailsModel
|
|
7
|
+
import com.fireworksdk.bridge.models.FWLiveStreamEventDetailsModel
|
|
8
|
+
import com.fireworksdk.bridge.models.FWLiveStreamEventName
|
|
9
|
+
import com.fireworksdk.bridge.reactnative.models.FWLiveStreamInterface
|
|
10
|
+
import com.fireworksdk.bridge.reactnative.utils.FWEventUtils
|
|
11
|
+
import com.fireworksdk.bridge.utils.FWLogUtils
|
|
12
|
+
import com.loopnow.fireworklibrary.FireworkLiveStream
|
|
13
|
+
import com.loopnow.fireworklibrary.FireworkLiveStreamChatDetails
|
|
14
|
+
import com.loopnow.fireworklibrary.FireworkLiveStreamEventDetails
|
|
15
|
+
import com.loopnow.fireworklibrary.FireworkLiveStreamEventListener
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class FWLiveStreamModule(
|
|
19
|
+
reactContext: ReactApplicationContext
|
|
20
|
+
) : ReactContextBaseJavaModule(reactContext), FWLiveStreamInterface {
|
|
21
|
+
|
|
22
|
+
@ReactMethod
|
|
23
|
+
override fun init() {
|
|
24
|
+
addFireworkLiveStreamEventListener()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
private fun addFireworkLiveStreamEventListener() {
|
|
28
|
+
FireworkLiveStream.addFireworkLiveStreamEventListener(object : FireworkLiveStreamEventListener {
|
|
29
|
+
override fun userJoined(liveStreamDetails: FireworkLiveStreamEventDetails) {
|
|
30
|
+
super.userJoined(liveStreamDetails)
|
|
31
|
+
FWLogUtils.d { "userJoined: $liveStreamDetails" }
|
|
32
|
+
FWEventUtils.sendLiveStreamEvent(
|
|
33
|
+
reactApplicationContext,
|
|
34
|
+
FWLiveStreamEventName.UserJoin.rawValue,
|
|
35
|
+
FWLiveStreamEventDetailsModel(liveStreamDetails.id)
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
override fun userLeft(liveStreamDetails: FireworkLiveStreamEventDetails) {
|
|
40
|
+
super.userLeft(liveStreamDetails)
|
|
41
|
+
FWLogUtils.d { "userLeft: $liveStreamDetails" }
|
|
42
|
+
FWEventUtils.sendLiveStreamEvent(
|
|
43
|
+
reactApplicationContext,
|
|
44
|
+
FWLiveStreamEventName.UserLeave.rawValue,
|
|
45
|
+
FWLiveStreamEventDetailsModel(liveStreamDetails.id)
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
override fun userSentChat(chatDetails: FireworkLiveStreamChatDetails) {
|
|
50
|
+
super.userSentChat(chatDetails)
|
|
51
|
+
FWLogUtils.d { "userSentChat: $chatDetails" }
|
|
52
|
+
FWEventUtils.sendLiveStreamChatEvent(
|
|
53
|
+
reactApplicationContext,
|
|
54
|
+
FWLiveStreamEventName.UserSendChat.rawValue,
|
|
55
|
+
FWLiveStreamMessageDetailsModel(chatDetails.chatId, chatDetails.username, chatDetails.text),
|
|
56
|
+
FWLiveStreamEventDetailsModel(chatDetails.liveStreamDetails.id)
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
override fun userSentLike(liveStreamDetails: FireworkLiveStreamEventDetails) {
|
|
61
|
+
super.userSentLike(liveStreamDetails)
|
|
62
|
+
FWLogUtils.d { "userSentLike: $liveStreamDetails" }
|
|
63
|
+
FWEventUtils.sendLiveStreamEvent(
|
|
64
|
+
reactApplicationContext,
|
|
65
|
+
FWLiveStreamEventName.UserSendLike.rawValue,
|
|
66
|
+
FWLiveStreamEventDetailsModel(liveStreamDetails.id)
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@ReactMethod
|
|
73
|
+
fun addListener(eventName: String?) {
|
|
74
|
+
// Set up any upstream listeners or background tasks as necessary
|
|
75
|
+
FWLogUtils.d { "addListener: $eventName" }
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@ReactMethod
|
|
79
|
+
fun removeListeners(count: Int?) {
|
|
80
|
+
// Remove upstream listeners, stop unnecessary background tasks
|
|
81
|
+
FWLogUtils.d { "removeListeners: $count" }
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
override fun getName(): String {
|
|
85
|
+
return "LiveStreamModule"
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.fireworksdk.bridge.reactnative.module
|
|
2
2
|
|
|
3
3
|
import android.app.Activity
|
|
4
4
|
import com.facebook.react.bridge.*
|
|
5
|
+
import com.fasterxml.jackson.core.type.TypeReference
|
|
5
6
|
import com.loopnow.fireworklibrary.baya.Baya
|
|
6
7
|
import com.loopnow.fireworklibrary.baya.UpdateCartStatus
|
|
7
|
-
import com.
|
|
8
|
-
import com.
|
|
9
|
-
import com.
|
|
10
|
-
import com.
|
|
11
|
-
import com.
|
|
12
|
-
import com.
|
|
13
|
-
import com.
|
|
8
|
+
import com.fireworksdk.bridge.reactnative.models.FWVideoShoppingInterface
|
|
9
|
+
import com.fireworksdk.bridge.models.FWVideoShoppingProduct
|
|
10
|
+
import com.fireworksdk.bridge.reactnative.pages.FWVideoShoppingCartActivity
|
|
11
|
+
import com.fireworksdk.bridge.reactnative.utils.FWEventUtils
|
|
12
|
+
import com.fireworksdk.bridge.utils.FWJsonUtils
|
|
13
|
+
import com.fireworksdk.bridge.utils.FWLogUtils
|
|
14
|
+
import com.loopnow.fireworklibrary.data.Product
|
|
15
|
+
import com.loopnow.fireworklibrary.utils.Util
|
|
16
|
+
|
|
14
17
|
|
|
15
18
|
class FWVideoShoppingModule(
|
|
16
19
|
reactContext: ReactApplicationContext
|
|
@@ -18,7 +21,7 @@ class FWVideoShoppingModule(
|
|
|
18
21
|
|
|
19
22
|
private var addToCartHandler: Triple<Int, String, String>? = null
|
|
20
23
|
private var cartClickHandler: Pair<Int, Activity>? = null
|
|
21
|
-
private val updateProductHandler: HashMap<String, Product
|
|
24
|
+
private val updateProductHandler: HashMap<String, List<Product>> = HashMap()
|
|
22
25
|
|
|
23
26
|
@ReactMethod
|
|
24
27
|
override fun init() {
|
|
@@ -27,40 +30,52 @@ class FWVideoShoppingModule(
|
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
@ReactMethod
|
|
30
|
-
override fun
|
|
31
|
-
FWLogUtils.d { "FWVideoShoppingModule updateVideoProduct: $
|
|
32
|
-
if (
|
|
33
|
+
override fun updateVideoProducts(productArray: ReadableArray?, videoId: String?) {
|
|
34
|
+
FWLogUtils.d { "FWVideoShoppingModule updateVideoProduct: $videoId" }
|
|
35
|
+
if (videoId.isNullOrBlank()) {
|
|
33
36
|
return
|
|
34
37
|
}
|
|
35
38
|
|
|
36
|
-
val
|
|
37
|
-
val
|
|
38
|
-
|
|
39
|
-
val productId = videoShoppingProduct.productId
|
|
40
|
-
if (productId.isNullOrBlank()) {
|
|
39
|
+
val configArrayList = productArray?.toArrayList()
|
|
40
|
+
val videoShoppingProducts = FWJsonUtils.fromJson(FWJsonUtils.toJson(configArrayList), object : TypeReference<List<FWVideoShoppingProduct>?>() {})
|
|
41
|
+
if (videoShoppingProducts.isNullOrEmpty()) {
|
|
41
42
|
return
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
val
|
|
45
|
+
val products = updateProductHandler[videoId] ?: return
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
for (product in products) {
|
|
48
|
+
for (videoShoppingProduct in videoShoppingProducts) {
|
|
49
|
+
if (product.extId == videoShoppingProduct.productId) {
|
|
50
|
+
|
|
51
|
+
if (videoShoppingProduct.name != null) {
|
|
52
|
+
product.name = videoShoppingProduct.name
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (videoShoppingProduct.description != null) {
|
|
56
|
+
product.description = videoShoppingProduct.description
|
|
57
|
+
}
|
|
49
58
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
59
|
+
if (videoShoppingProduct.units != null) {
|
|
60
|
+
for (videoShoppingProductUnit in videoShoppingProduct.units) {
|
|
61
|
+
for (productUnit in product.productUnits) {
|
|
62
|
+
if (videoShoppingProductUnit.unitId.equals(productUnit.extId)) {
|
|
63
|
+
productUnit.name = videoShoppingProductUnit.name
|
|
64
|
+
productUnit.price = videoShoppingProductUnit.price?.amount
|
|
65
|
+
productUnit.currencyCode = videoShoppingProductUnit.price?.currencyCode
|
|
66
|
+
productUnit.priceLiteral = Util.getPriceLocaleFormatter(productUnit.price, productUnit.currencyCode)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
57
70
|
}
|
|
71
|
+
|
|
58
72
|
}
|
|
59
73
|
}
|
|
60
74
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
75
|
+
UiThreadUtil.runOnUiThread {
|
|
76
|
+
Baya.updateProductsComplete(videoId)
|
|
77
|
+
}
|
|
78
|
+
updateProductHandler.remove(videoId)
|
|
64
79
|
}
|
|
65
80
|
|
|
66
81
|
@ReactMethod
|
|
@@ -110,9 +125,8 @@ class FWVideoShoppingModule(
|
|
|
110
125
|
|
|
111
126
|
@ReactMethod
|
|
112
127
|
override fun exitCartPage() {
|
|
113
|
-
val activity = reactApplicationContext.currentActivity
|
|
114
128
|
UiThreadUtil.runOnUiThread {
|
|
115
|
-
|
|
129
|
+
currentActivity?.finish()
|
|
116
130
|
}
|
|
117
131
|
}
|
|
118
132
|
|
|
@@ -156,13 +170,13 @@ class FWVideoShoppingModule(
|
|
|
156
170
|
|
|
157
171
|
private fun productListener() {
|
|
158
172
|
Baya.productInterface = object: Baya.ProductInterface {
|
|
159
|
-
override fun
|
|
160
|
-
FWLogUtils.d { "FWVideoShoppingModule
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
updateProductHandler[id] = product
|
|
164
|
-
FWEventUtils.sendUpdateProductDetailsEvent(reactApplicationContext, id, callbackId)
|
|
173
|
+
override fun hydrateProducts(videoId: String, products: List<Product>) {
|
|
174
|
+
FWLogUtils.d { "FWVideoShoppingModule hydrateProducts, videoId: $videoId" }
|
|
175
|
+
if (videoId.isNullOrBlank() || products.isNullOrEmpty()) {
|
|
176
|
+
return
|
|
165
177
|
}
|
|
178
|
+
updateProductHandler[videoId] = products
|
|
179
|
+
FWEventUtils.sendUpdateProductsDetailsEvent(reactApplicationContext, products, videoId)
|
|
166
180
|
}
|
|
167
181
|
|
|
168
182
|
override fun displayProductInfo(
|