react-native-firework-sdk 1.0.6-beta.2 → 1.1.2
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 +8 -2
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/FireworkSDKPackage.kt +10 -5
- 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/fireworksdk/bridge/reactnative/FWInitializationProvider.kt +99 -0
- 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 +1 -1
- 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 +20 -14
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/module/FireworkSDKModule.kt +23 -13
- 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 +46 -5
- package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/utils/FWJsonUtils.kt +1 -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 +29 -0
- package/ios/{Component → Components}/VideoFeedConfiguration.swift +1 -0
- package/ios/{Component → Components}/VideoFeedManager.m +0 -0
- package/ios/{Component → Components}/VideoFeedManager.swift +0 -0
- package/ios/{Component → Components}/VideoPlayerConfiguration.swift +0 -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} +0 -0
- package/ios/Models/{RCTConvert+VideoFeed.swift → RNToNative/RCTConvert+VideoFeed.swift} +0 -0
- 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 -19
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +2 -1
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +11 -3
- package/ios/Modules/LiveStream/LiveStreamModule.m +14 -0
- package/ios/Modules/LiveStream/LiveStreamModule.swift +43 -0
- 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 +16 -15
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +46 -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 +10 -10
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/VideoFeed.js +41 -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 +5 -5
- package/lib/typescript/components/VideoFeed.d.ts +7 -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 +14 -11
- 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 +5 -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 +3 -1
- package/package.json +3 -3
- package/react-native-firework-sdk.podspec +3 -1
- package/src/FireworkSDK.ts +49 -33
- package/src/LiveStream.ts +51 -0
- package/src/VideoShopping.ts +10 -9
- package/src/components/VideoFeed.tsx +63 -7
- package/src/index.tsx +31 -12
- 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 +16 -12
- 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 +7 -1
- package/src/modules/FireworkSDKModule.ts +10 -4
- package/src/modules/LiveStreamModule.ts +26 -0
- package/src/modules/ShoppingModule.ts +13 -6
- package/android/src/main/java/com/reactnativefireworksdk/components/videofeed/FWVideoFeed.kt +0 -143
- 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 -22
- package/android/src/main/java/com/reactnativefireworksdk/utils/FWVideoPlayerUtils.kt +0 -20
- package/lib/commonjs/models/ADConfig.js +0 -2
- package/lib/module/models/ADConfig.js +0 -2
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.fireworksdk.bridge.reactnative.module
|
|
2
2
|
|
|
3
3
|
import android.annotation.SuppressLint
|
|
4
4
|
import android.content.pm.PackageManager
|
|
5
5
|
import android.provider.Settings
|
|
6
6
|
import com.facebook.react.bridge.*
|
|
7
|
-
import com.
|
|
8
|
-
import com.
|
|
9
|
-
import com.
|
|
10
|
-
import com.
|
|
11
|
-
import com.reactnativefireworksdk.models.FWVideoPlaybackSubEventName
|
|
12
|
-
import com.reactnativefireworksdk.models.FWVideoPlayerConfigModel
|
|
13
|
-
import com.reactnativefireworksdk.utils.*
|
|
7
|
+
import com.fireworksdk.bridge.models.FWVideoPlaybackDetails
|
|
8
|
+
import com.fireworksdk.bridge.models.FWVideoPlaybackSubEventName
|
|
9
|
+
import com.fireworksdk.bridge.models.FWVideoPlayerConfigModel
|
|
10
|
+
import com.fireworksdk.bridge.utils.*
|
|
14
11
|
import org.json.JSONObject
|
|
15
12
|
import com.facebook.react.bridge.ReactMethod
|
|
16
|
-
import com.
|
|
13
|
+
import com.fireworksdk.bridge.models.FWAdBadgeConfigModel
|
|
14
|
+
import com.fireworksdk.bridge.reactnative.models.FireworkSDKInterface
|
|
15
|
+
import com.fireworksdk.bridge.reactnative.utils.FWEventUtils
|
|
16
|
+
import com.loopnow.fireworklibrary.*
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class FireworkSDKModule(
|
|
@@ -79,10 +79,19 @@ class FireworkSDKModule(
|
|
|
79
79
|
*
|
|
80
80
|
*/
|
|
81
81
|
@ReactMethod
|
|
82
|
-
override fun setShareBaseURL(url: String
|
|
82
|
+
override fun setShareBaseURL(url: String?, promise: Promise) {
|
|
83
83
|
if (!url.isNullOrBlank()) {
|
|
84
84
|
FwSDK.setBasePlayerUrl(url)
|
|
85
85
|
}
|
|
86
|
+
promise.resolve(Arguments.createMap())
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@ReactMethod
|
|
90
|
+
override fun setAdBadgeConfiguration(config: ReadableMap?, promise: Promise) {
|
|
91
|
+
val configMap = config?.toHashMap()
|
|
92
|
+
val adBadgeConfigModel = FWJsonUtils.fromMap(configMap, FWAdBadgeConfigModel::class.java)
|
|
93
|
+
FWVideoPlayerUtils.setAdBadgeConfig(adBadgeConfigModel)
|
|
94
|
+
promise.resolve(Arguments.createMap())
|
|
86
95
|
}
|
|
87
96
|
|
|
88
97
|
@ReactMethod
|
|
@@ -128,7 +137,6 @@ class FireworkSDKModule(
|
|
|
128
137
|
}
|
|
129
138
|
}
|
|
130
139
|
})
|
|
131
|
-
handleVideoPlaybackEvent()
|
|
132
140
|
}
|
|
133
141
|
}
|
|
134
142
|
|
|
@@ -221,15 +229,17 @@ class FireworkSDKModule(
|
|
|
221
229
|
}
|
|
222
230
|
|
|
223
231
|
@ReactMethod
|
|
224
|
-
fun addListener(eventName: String
|
|
232
|
+
fun addListener(eventName: String?, promise: Promise) {
|
|
225
233
|
// Set up any upstream listeners or background tasks as necessary
|
|
226
234
|
FWLogUtils.d { "addListener: $eventName" }
|
|
235
|
+
promise.resolve(Arguments.createMap())
|
|
227
236
|
}
|
|
228
237
|
|
|
229
238
|
@ReactMethod
|
|
230
|
-
fun removeListeners(count: Int
|
|
239
|
+
fun removeListeners(count: Int?, promise: Promise) {
|
|
231
240
|
// Remove upstream listeners, stop unnecessary background tasks
|
|
232
241
|
FWLogUtils.d { "removeListeners: $count" }
|
|
242
|
+
promise.resolve(Arguments.createMap())
|
|
233
243
|
}
|
|
234
244
|
|
|
235
245
|
override fun getName(): String {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.fireworksdk.bridge.reactnative.pages
|
|
2
2
|
|
|
3
3
|
import android.app.Activity
|
|
4
4
|
import android.content.Intent
|
|
5
5
|
import android.os.Bundle
|
|
6
6
|
import androidx.appcompat.app.AppCompatActivity
|
|
7
7
|
import androidx.fragment.app.Fragment
|
|
8
|
-
import com.
|
|
8
|
+
import com.fireworksdk.bridge.R
|
|
9
9
|
import com.facebook.react.ReactFragment
|
|
10
10
|
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler
|
|
11
11
|
|
|
@@ -14,7 +14,7 @@ class FWVideoShoppingCartActivity : AppCompatActivity(), DefaultHardwareBackBtnH
|
|
|
14
14
|
|
|
15
15
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
16
16
|
super.onCreate(savedInstanceState)
|
|
17
|
-
setContentView(R.layout.
|
|
17
|
+
setContentView(R.layout.fw_bridge_fragment_shoppingcart)
|
|
18
18
|
|
|
19
19
|
val reactNativeFragment: Fragment = ReactFragment.Builder()
|
|
20
20
|
.setComponentName("FWShoppingCartPage")
|
|
@@ -23,7 +23,7 @@ class FWVideoShoppingCartActivity : AppCompatActivity(), DefaultHardwareBackBtnH
|
|
|
23
23
|
|
|
24
24
|
supportFragmentManager
|
|
25
25
|
.beginTransaction()
|
|
26
|
-
.add(R.id.
|
|
26
|
+
.add(R.id.fw_bridge_shopping_cart_container, reactNativeFragment)
|
|
27
27
|
.commit()
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.fireworksdk.bridge.reactnative.utils
|
|
2
2
|
|
|
3
3
|
import com.facebook.react.bridge.Arguments
|
|
4
4
|
import com.facebook.react.bridge.ReactContext
|
|
5
5
|
import com.facebook.react.bridge.WritableMap
|
|
6
6
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
7
7
|
import com.facebook.react.uimanager.events.RCTEventEmitter
|
|
8
|
-
import com.
|
|
9
|
-
import com.
|
|
8
|
+
import com.fireworksdk.bridge.models.*
|
|
9
|
+
import com.loopnow.fireworklibrary.data.Product
|
|
10
10
|
|
|
11
11
|
object FWEventUtils {
|
|
12
12
|
|
|
@@ -26,8 +26,9 @@ object FWEventUtils {
|
|
|
26
26
|
val eventMap = Arguments.createMap()
|
|
27
27
|
val contentMap = Arguments.createMap()
|
|
28
28
|
contentMap.putInt("index", info.index?:0)
|
|
29
|
-
contentMap.putString("
|
|
29
|
+
contentMap.putString("id", info.id)
|
|
30
30
|
contentMap.putInt("duration", info.videoDuration?:0)
|
|
31
|
+
contentMap.putString("source", info.source)
|
|
31
32
|
eventMap.putMap("info", contentMap)
|
|
32
33
|
sendEvent(reactContext, FWEventName.VideoFeedClick.rawValue, eventMap)
|
|
33
34
|
}
|
|
@@ -109,7 +110,7 @@ object FWEventUtils {
|
|
|
109
110
|
}
|
|
110
111
|
|
|
111
112
|
fun receiveVideoFeedLoadFinishedSuccessEvent(reactContext: ReactContext, targetTag: Int) {
|
|
112
|
-
receiveEvent(reactContext, targetTag, FWFeedViewEventName.VideoFeedLoadFinished.rawValue,
|
|
113
|
+
receiveEvent(reactContext, targetTag, FWFeedViewEventName.VideoFeedLoadFinished.rawValue, null)
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
fun receiveVideoFeedLoadFinishedFailedEvent(reactContext: ReactContext, targetTag: Int, name: String, reason: String?) {
|
|
@@ -137,4 +138,44 @@ object FWEventUtils {
|
|
|
137
138
|
// event
|
|
138
139
|
// )
|
|
139
140
|
}
|
|
141
|
+
|
|
142
|
+
// live stream
|
|
143
|
+
fun sendLiveStreamEvent(reactContext: ReactContext, eventName: String, info: FWLiveStreamEventDetailsModel?) {
|
|
144
|
+
val eventMap = Arguments.createMap()
|
|
145
|
+
eventMap.putString("eventName", eventName)
|
|
146
|
+
|
|
147
|
+
val contentMap = Arguments.createMap()
|
|
148
|
+
if (!info?.id.isNullOrBlank()) {
|
|
149
|
+
contentMap.putString("id", info?.id)
|
|
150
|
+
}
|
|
151
|
+
eventMap.putMap("info", contentMap)
|
|
152
|
+
sendEvent(reactContext, FWEventName.LiveStream.rawValue, eventMap)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
fun sendLiveStreamChatEvent(reactContext: ReactContext, eventName: String, message: FWLiveStreamMessageDetailsModel?, liveStream: FWLiveStreamEventDetailsModel?) {
|
|
156
|
+
val eventMap = Arguments.createMap()
|
|
157
|
+
eventMap.putString("eventName", eventName)
|
|
158
|
+
|
|
159
|
+
// chat map
|
|
160
|
+
val chatMap = Arguments.createMap()
|
|
161
|
+
if (!message?.messageId.isNullOrBlank()) {
|
|
162
|
+
chatMap.putString("messageId", message?.messageId)
|
|
163
|
+
}
|
|
164
|
+
if (!message?.username.isNullOrBlank()) {
|
|
165
|
+
chatMap.putString("username", message?.username)
|
|
166
|
+
}
|
|
167
|
+
if (!message?.text.isNullOrBlank()) {
|
|
168
|
+
chatMap.putString("text", message?.text)
|
|
169
|
+
}
|
|
170
|
+
eventMap.putMap("chat", chatMap)
|
|
171
|
+
|
|
172
|
+
// live stream map
|
|
173
|
+
val liveStreamMap = Arguments.createMap()
|
|
174
|
+
if (!liveStream?.id.isNullOrBlank()) {
|
|
175
|
+
liveStreamMap.putString("id", liveStream?.id)
|
|
176
|
+
}
|
|
177
|
+
eventMap.putMap("liveStream", liveStreamMap)
|
|
178
|
+
|
|
179
|
+
sendEvent(reactContext, FWEventName.LiveStreamChat.rawValue, eventMap)
|
|
180
|
+
}
|
|
140
181
|
}
|
package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/utils/FWLogUtils.kt
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
package com.
|
|
1
|
+
package com.fireworksdk.bridge.utils
|
|
2
2
|
|
|
3
3
|
import android.os.Looper
|
|
4
4
|
import android.os.SystemClock
|
|
5
5
|
import android.util.Log
|
|
6
|
-
import com.
|
|
6
|
+
import com.fireworksdk.bridge.BuildConfig
|
|
7
7
|
import kotlin.math.max
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
package com.fireworksdk.bridge.utils
|
|
2
|
+
|
|
3
|
+
import android.graphics.Color
|
|
4
|
+
import com.loopnow.fireworklibrary.VideoPlayerProperties
|
|
5
|
+
import com.fireworksdk.bridge.constants.FWVideoPlayerConstant
|
|
6
|
+
import com.fireworksdk.bridge.models.FWAdBadgeConfigModel
|
|
7
|
+
import com.fireworksdk.bridge.models.FWVideoFeedConfigModel
|
|
8
|
+
import com.fireworksdk.bridge.models.FWVideoFeedTitlePosition
|
|
9
|
+
import com.fireworksdk.bridge.models.FWVideoPlayerConfigModel
|
|
10
|
+
import com.loopnow.fireworklibrary.AdLabelType
|
|
11
|
+
import com.loopnow.fireworklibrary.VideoFeedProperties
|
|
12
|
+
import com.loopnow.fireworklibrary.models.FeedTitlePosition
|
|
13
|
+
import com.loopnow.fireworklibrary.views.PlaylistGroupFeedView
|
|
14
|
+
import com.loopnow.fireworklibrary.views.VideoFeedView
|
|
15
|
+
|
|
16
|
+
object FWVideoPlayerUtils {
|
|
17
|
+
|
|
18
|
+
var customCTAClickEnabled: Boolean = false
|
|
19
|
+
var videoPlaybackEventEnabled: Boolean = false
|
|
20
|
+
|
|
21
|
+
private var hasAssignedLaunchAppWithMute = false
|
|
22
|
+
/**
|
|
23
|
+
* if true, mute when open player (can be set only once)
|
|
24
|
+
*/
|
|
25
|
+
private var launchPlayerWithMute = false
|
|
26
|
+
set(value) {
|
|
27
|
+
if (!hasAssignedLaunchAppWithMute) {
|
|
28
|
+
hasAssignedLaunchAppWithMute = true
|
|
29
|
+
VideoPlayerProperties.launchPlayerWithMute = value
|
|
30
|
+
field = value
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
fun setAdBadgeConfig(config: FWAdBadgeConfigModel?) {
|
|
36
|
+
val badgeTextType = config?.badgeTextType
|
|
37
|
+
when {
|
|
38
|
+
badgeTextType.equals(FWVideoPlayerConstant.FW_AD_BADGE_LABEL_AD) -> {
|
|
39
|
+
VideoFeedProperties.setAdLabel(AdLabelType.AD)
|
|
40
|
+
}
|
|
41
|
+
badgeTextType.equals(FWVideoPlayerConstant.FW_AD_BADGE_LABEL_SPONSORED) -> {
|
|
42
|
+
VideoFeedProperties.setAdLabel(AdLabelType.SPONSORED)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
fun setPlaylistGroupFeedConfig(feedView: PlaylistGroupFeedView?, config: FWVideoFeedConfigModel?) {
|
|
48
|
+
val backgroundColor = config?.backgroundColor
|
|
49
|
+
if (!backgroundColor.isNullOrBlank()) {
|
|
50
|
+
feedView?.setBackgroundColor(Color.parseColor(backgroundColor))
|
|
51
|
+
} else {
|
|
52
|
+
feedView?.setBackgroundColor(Color.TRANSPARENT)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
feedView?.setTitleVisible(config?.title?.hidden != true)
|
|
56
|
+
|
|
57
|
+
val titlePosition = when {
|
|
58
|
+
config?.titlePosition.equals(FWVideoFeedTitlePosition.Stacked.rawValue) -> FeedTitlePosition.BELOW
|
|
59
|
+
else -> FeedTitlePosition.ALIGN_BOTTOM
|
|
60
|
+
}
|
|
61
|
+
feedView?.setTitlePosition(titlePosition)
|
|
62
|
+
VideoFeedProperties.displayAdLabel = config?.showAdBadge == true
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
fun setVideoFeedConfig(feedView: VideoFeedView?, config: FWVideoFeedConfigModel?) {
|
|
66
|
+
val backgroundColor = config?.backgroundColor
|
|
67
|
+
if (!backgroundColor.isNullOrBlank()) {
|
|
68
|
+
feedView?.setBackgroundColor(Color.parseColor(backgroundColor))
|
|
69
|
+
} else {
|
|
70
|
+
feedView?.setBackgroundColor(Color.TRANSPARENT)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
feedView?.setTitleVisible(config?.title?.hidden != true)
|
|
74
|
+
|
|
75
|
+
val titlePosition = when {
|
|
76
|
+
config?.titlePosition.equals(FWVideoFeedTitlePosition.Stacked.rawValue) -> FeedTitlePosition.BELOW
|
|
77
|
+
else -> FeedTitlePosition.ALIGN_BOTTOM
|
|
78
|
+
}
|
|
79
|
+
feedView?.setTitlePosition(titlePosition)
|
|
80
|
+
VideoFeedProperties.displayAdLabel = config?.showAdBadge == true
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
fun setVideoPlayerConfig(config: FWVideoPlayerConfigModel?) {
|
|
84
|
+
VideoPlayerProperties.share = config?.showShareButton != false
|
|
85
|
+
VideoPlayerProperties.loop = config?.videoCompleteAction != FWVideoPlayerConstant.FW_VIDEO_COMPLETE_ACTION_ADVANCE_TO_NEXT
|
|
86
|
+
// VideoPlayerProperties.autoPlayOnComplete = config?.videoCompleteAction != FWVideoPlayerConstant.FW_VIDEO_COMPLETE_ACTION_LOOP
|
|
87
|
+
VideoPlayerProperties.fullScreenPlayer = config?.playerStyle != FWVideoPlayerConstant.FW_PLAYER_STYLE_FIT
|
|
88
|
+
VideoPlayerProperties.enableOneTouchMute = config?.showMuteButton == true
|
|
89
|
+
VideoPlayerProperties.enablePlayPauseControl = config?.showPlaybackButton == true
|
|
90
|
+
if (config?.launchBehavior != null) {
|
|
91
|
+
launchPlayerWithMute = config.launchBehavior == FWVideoPlayerConstant.FW_PLAYER_LAUNCH_BEHAVIOR_MUTE_ON_FIRST_LAUNCH
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<androidx.constraintlayout.widget.ConstraintLayout
|
|
3
|
+
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
4
|
+
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
5
|
+
android:id="@+id/fw_bridge_playlistfeed_container"
|
|
6
|
+
android:background="@color/fw_bridge_white"
|
|
7
|
+
android:layout_width="match_parent"
|
|
8
|
+
android:layout_height="match_parent">
|
|
9
|
+
|
|
10
|
+
<com.loopnow.fireworklibrary.views.PlaylistGroupFeedView
|
|
11
|
+
android:id="@+id/fw_bridge_playlistfeed"
|
|
12
|
+
android:layout_width="match_parent"
|
|
13
|
+
android:layout_height="match_parent"
|
|
14
|
+
app:imageStyle="@style/FWFeedViewImageStyle"
|
|
15
|
+
app:textStyle="@style/FWFeedViewCaptionStyle"
|
|
16
|
+
/>
|
|
17
|
+
|
|
18
|
+
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
2
|
<androidx.constraintlayout.widget.ConstraintLayout
|
|
3
3
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
4
|
-
android:id="@+id/
|
|
4
|
+
android:id="@+id/fw_bridge_shopping_cart_container"
|
|
5
5
|
android:layout_width="match_parent"
|
|
6
6
|
android:layout_height="match_parent">
|
|
7
7
|
|
package/android/src/main/res/layout/{fwrn_fragment_videofeed.xml → fw_bridge_fragment_videofeed.xml}
RENAMED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
<androidx.constraintlayout.widget.ConstraintLayout
|
|
3
3
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
4
4
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
5
|
+
android:id="@+id/fw_bridge_videofeed_container"
|
|
5
6
|
android:layout_width="match_parent"
|
|
6
7
|
android:layout_height="match_parent">
|
|
7
8
|
|
|
8
9
|
<com.loopnow.fireworklibrary.views.VideoFeedView
|
|
9
|
-
android:id="@+id/
|
|
10
|
+
android:id="@+id/fw_bridge_videofeed"
|
|
10
11
|
android:layout_width="match_parent"
|
|
11
12
|
android:layout_height="match_parent"
|
|
12
13
|
app:feedLayout="horizontal"
|
|
@@ -153,6 +153,28 @@ public class VideoFeed: UIView, VideoFeedViewControllerDelegate {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
extension VideoFeed {
|
|
156
|
+
private func convertToFWAdBadgeConfiguration(_ adBadgeConfiguration: AdBadgeConfiguration?) -> FireworkVideo.AdBadgeConfiguration? {
|
|
157
|
+
guard let adBadgeConfiguration = adBadgeConfiguration else {
|
|
158
|
+
return nil
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
var fwAdBadgeConfiguration = FireworkVideo.AdBadgeConfiguration()
|
|
162
|
+
if let textColor = adBadgeConfiguration.textColor {
|
|
163
|
+
fwAdBadgeConfiguration.textColor = textColor.uicolor()
|
|
164
|
+
}
|
|
165
|
+
if let backgroundColor = adBadgeConfiguration.backgroundColor {
|
|
166
|
+
fwAdBadgeConfiguration.backgroundColor = backgroundColor.uicolor()
|
|
167
|
+
}
|
|
168
|
+
switch adBadgeConfiguration.badgeTextType {
|
|
169
|
+
case .sponsored:
|
|
170
|
+
fwAdBadgeConfiguration.badgeText = FireworkVideo.AdBadgeConfiguration.BadgeText.sponsored
|
|
171
|
+
default:
|
|
172
|
+
fwAdBadgeConfiguration.badgeText = FireworkVideo.AdBadgeConfiguration.BadgeText.ad
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return fwAdBadgeConfiguration
|
|
176
|
+
}
|
|
177
|
+
|
|
156
178
|
private func convertToVideoFeedConentConfiguration() -> VideoFeedContentConfiguration {
|
|
157
179
|
var videoConfig = VideoFeedContentConfiguration()
|
|
158
180
|
//set default value so that behavior will the same with Android
|
|
@@ -174,6 +196,10 @@ extension VideoFeed {
|
|
|
174
196
|
if let shareBaseUrl = gShareBaseURL {
|
|
175
197
|
videoConfig.playerView.shareButton.behavior.baseURL = URL(string:shareBaseUrl)
|
|
176
198
|
}
|
|
199
|
+
let adBadge = self.convertToFWAdBadgeConfiguration(gAdBadgeConfiguration)
|
|
200
|
+
if let adBadge = adBadge {
|
|
201
|
+
videoConfig.adBadge = adBadge
|
|
202
|
+
}
|
|
177
203
|
|
|
178
204
|
//set a value different from default value to compatible with FireworkVideo SDK misalign bug
|
|
179
205
|
videoConfig.itemView.titleLayoutConfiguration.insets = UIEdgeInsets(top: 7, left: 7, bottom: 7, right: 7)
|
|
@@ -224,6 +250,9 @@ extension VideoFeed {
|
|
|
224
250
|
if let showSponsored = config.showSponsored {
|
|
225
251
|
vfcConfig.sponsored.isHidden = !showSponsored
|
|
226
252
|
}
|
|
253
|
+
if let showAdBadge = config.showAdBadge {
|
|
254
|
+
vfcConfig.sponsored.isHidden = !showAdBadge
|
|
255
|
+
}
|
|
227
256
|
|
|
228
257
|
return vfcConfig
|
|
229
258
|
}
|
|
@@ -15,6 +15,7 @@ public class VideoFeedConfiguration: NSObject, Codable {
|
|
|
15
15
|
var titlePosition: VideoFeedTitlePosition?
|
|
16
16
|
var playIcon: VideoFeedPlayIconConfiguration?
|
|
17
17
|
var showSponsored: Bool?
|
|
18
|
+
var showAdBadge: Bool?
|
|
18
19
|
|
|
19
20
|
class VideoFeedTitleConfiguration: NSObject, Codable {
|
|
20
21
|
public var hidden: Bool?
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -7,11 +7,14 @@
|
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
9
9
|
|
|
10
|
+
/// Video event
|
|
10
11
|
enum FWEventName: String, CaseIterable {
|
|
11
12
|
case SDKInit = "fw:sdk-init"
|
|
12
13
|
case CustomCTAClick = "fw:custom-cta-click"
|
|
13
14
|
case VideoPlayback = "fw:video-playback"
|
|
14
15
|
case VideoFeedClick = "fw:video-feed-click"
|
|
16
|
+
case ShareBaseURLUpdated = "fw:share-base-url-updated" //emitted in JS side
|
|
17
|
+
case AdBadgeConfigurationUpdated = "fw:ad-badge-configuration-updated" //emitted in JS side
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
enum VideoPlaybackSubEventName: String {
|
|
@@ -26,9 +29,26 @@ enum VideoPlaybackSubEventName: String {
|
|
|
26
29
|
case ClickShare = "fw:video:click-share"
|
|
27
30
|
}
|
|
28
31
|
|
|
32
|
+
/// Shopping event
|
|
29
33
|
enum ShoppingEventName: String, CaseIterable {
|
|
30
34
|
case UpdateProductDetails = "fw:shopping:update-product-details"
|
|
31
35
|
case WillDisplayProduct = "fw:shopping:will-display-product"
|
|
32
36
|
case AddToCart = "fw:shopping:add-to-cart"
|
|
33
37
|
case ClickCartIcon = "fw:shopping:click-cart-icon"
|
|
34
38
|
}
|
|
39
|
+
|
|
40
|
+
/// Live stream event
|
|
41
|
+
enum LiveStreamEventName: String, CaseIterable {
|
|
42
|
+
case livestream = "fw:livestream"
|
|
43
|
+
case livestreamChat = "fw:livestream-chat"
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
enum LiveStreamSubEventName: String {
|
|
47
|
+
case UserDidjoin = "fw:livestream:user-join"
|
|
48
|
+
case UserDidLeave = "fw:livestream:user-leave"
|
|
49
|
+
case UserSendLike = "fw:livestream:user-send-like"
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
enum LiveStreamChatSubEventName: String {
|
|
53
|
+
case UserSendChat = "fw:livestream:user-send-chat"
|
|
54
|
+
}
|
|
@@ -55,8 +55,38 @@ extension VideoFeedError {
|
|
|
55
55
|
|
|
56
56
|
extension FeedEventDetails {
|
|
57
57
|
var jsObject: [String: Any] {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
var sourceStr: String = ""
|
|
59
|
+
switch(source) {
|
|
60
|
+
case .discover:
|
|
61
|
+
sourceStr = "discover"
|
|
62
|
+
case .channel(channelID: _):
|
|
63
|
+
sourceStr = "channel"
|
|
64
|
+
case .channelPlaylist(channelID: _, playlistID: _):
|
|
65
|
+
sourceStr = "playlist"
|
|
66
|
+
case .playlistGroup(groupID: _):
|
|
67
|
+
sourceStr = "playlistGroup"
|
|
68
|
+
default:
|
|
69
|
+
break
|
|
70
|
+
}
|
|
71
|
+
return [
|
|
72
|
+
"index": index,
|
|
73
|
+
"id": id,
|
|
74
|
+
"duration": duration,
|
|
75
|
+
"source": sourceStr
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
extension LiveStreamEventDetails {
|
|
81
|
+
var jsObject: [String: Any] {
|
|
82
|
+
return ["id": id]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
extension LiveStreamMessageDetails {
|
|
87
|
+
var jsObject: [String: Any] {
|
|
88
|
+
return ["messageId": messageID,
|
|
89
|
+
"username": username,
|
|
90
|
+
"text": text]
|
|
61
91
|
}
|
|
62
92
|
}
|
|
@@ -88,4 +88,24 @@ extension RCTConvert {
|
|
|
88
88
|
|
|
89
89
|
return result
|
|
90
90
|
}
|
|
91
|
+
|
|
92
|
+
static func adBadgeConfiguration(_ config: [String: AnyObject]?) -> AdBadgeConfiguration? {
|
|
93
|
+
guard let rConfig = config else {
|
|
94
|
+
return nil
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
let jsonData = try? JSONSerialization.data(withJSONObject: rConfig, options: .prettyPrinted)
|
|
98
|
+
guard let rJsonData = jsonData else {
|
|
99
|
+
return nil
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
var result: AdBadgeConfiguration?
|
|
103
|
+
do {
|
|
104
|
+
result = try JSONDecoder().decode(AdBadgeConfiguration.self, from: rJsonData)
|
|
105
|
+
} catch let error {
|
|
106
|
+
print(error.localizedDescription)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return result
|
|
110
|
+
}
|
|
91
111
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// AdBadgeConfiguration.swift
|
|
3
|
+
// react-native-firework-sdk
|
|
4
|
+
//
|
|
5
|
+
// Created by Jeff Zheng on 2022/3/8.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
|
|
10
|
+
struct AdBadgeConfiguration: Codable {
|
|
11
|
+
var badgeTextType: BadgeTextType = .ad
|
|
12
|
+
var backgroundColor: String?
|
|
13
|
+
var textColor: String?
|
|
14
|
+
|
|
15
|
+
enum BadgeTextType: String, Codable {
|
|
16
|
+
case ad, sponsored
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -10,7 +10,7 @@ import FireworkVideo
|
|
|
10
10
|
|
|
11
11
|
extension FireworkSDKModule: FireworkVideoCTADelegate {
|
|
12
12
|
func handleCustomCTAClick(_ viewController: PlayerViewController, url: URL) -> Bool {
|
|
13
|
-
sendEvent(withName: FWEventName.CustomCTAClick.rawValue, body: [url: url])
|
|
13
|
+
sendEvent(withName: FWEventName.CustomCTAClick.rawValue, body: ["url": url.absoluteString])
|
|
14
14
|
|
|
15
15
|
return customCTAClickEnabled
|
|
16
16
|
}
|
|
@@ -19,42 +19,42 @@ extension FireworkSDKModule: FireworkVideoPlaybackDelegate {
|
|
|
19
19
|
|
|
20
20
|
func fireworkVideoDidRecordImpression(_ videoPlayback: VideoPlaybackDetails) {
|
|
21
21
|
guard enableVideoPlayBackEvent else { return }
|
|
22
|
-
sendEvent(withName: FWEventName.VideoPlayback.rawValue, body: [VideoPlaybackSubEventName.Impression.rawValue: videoPlayback.jsObject])
|
|
22
|
+
sendEvent(withName: FWEventName.VideoPlayback.rawValue, body: ["eventName": VideoPlaybackSubEventName.Impression.rawValue, "info": videoPlayback.jsObject])
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
func fireworkVideoDidStartPlaying(_ videoPlayback: VideoPlaybackDetails) {
|
|
26
26
|
guard enableVideoPlayBackEvent else { return }
|
|
27
|
-
sendEvent(withName: FWEventName.VideoPlayback.rawValue, body: [VideoPlaybackSubEventName.Start.rawValue: videoPlayback.jsObject])
|
|
27
|
+
sendEvent(withName: FWEventName.VideoPlayback.rawValue, body: ["eventName":VideoPlaybackSubEventName.Start.rawValue, "info": videoPlayback.jsObject])
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
func fireworkVideoReachedFirstQuartile(_ videoPlayback: VideoPlaybackDetails) {
|
|
31
31
|
guard enableVideoPlayBackEvent else { return }
|
|
32
|
-
sendEvent(withName: FWEventName.VideoPlayback.rawValue, body: [VideoPlaybackSubEventName.FirstQuartile.rawValue: videoPlayback.jsObject])
|
|
32
|
+
sendEvent(withName: FWEventName.VideoPlayback.rawValue, body: ["eventName":VideoPlaybackSubEventName.FirstQuartile.rawValue, "info": videoPlayback.jsObject])
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
func fireworkVideoReachedMidPoint(_ videoPlayback: VideoPlaybackDetails) {
|
|
36
36
|
guard enableVideoPlayBackEvent else { return }
|
|
37
|
-
sendEvent(withName: FWEventName.VideoPlayback.rawValue, body: [VideoPlaybackSubEventName.Midpoint.rawValue: videoPlayback.jsObject])
|
|
37
|
+
sendEvent(withName: FWEventName.VideoPlayback.rawValue, body: ["eventName":VideoPlaybackSubEventName.Midpoint.rawValue, "info": videoPlayback.jsObject])
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
func fireworkVideoReachedThirdQuartile(_ videoPlayback: VideoPlaybackDetails) {
|
|
41
41
|
guard enableVideoPlayBackEvent else { return }
|
|
42
|
-
sendEvent(withName: FWEventName.VideoPlayback.rawValue, body: [VideoPlaybackSubEventName.ThirdQuartile.rawValue: videoPlayback.jsObject])
|
|
42
|
+
sendEvent(withName: FWEventName.VideoPlayback.rawValue, body: ["eventName":VideoPlaybackSubEventName.ThirdQuartile.rawValue, "info": videoPlayback.jsObject])
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
func fireworkVideoDidFinishPlaying(_ videoPlayback: VideoPlaybackDetails) {
|
|
46
46
|
guard enableVideoPlayBackEvent else { return }
|
|
47
|
-
sendEvent(withName: FWEventName.VideoPlayback.rawValue, body: [VideoPlaybackSubEventName.Complete.rawValue: videoPlayback.jsObject])
|
|
47
|
+
sendEvent(withName: FWEventName.VideoPlayback.rawValue, body: ["eventName":VideoPlaybackSubEventName.Complete.rawValue, "info": videoPlayback.jsObject])
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
func fireworkVideoDidTapCTAButton(_ videoPlayback: VideoPlaybackDetails) {
|
|
51
51
|
guard enableVideoPlayBackEvent else { return }
|
|
52
|
-
sendEvent(withName: FWEventName.VideoPlayback.rawValue, body: [VideoPlaybackSubEventName.ClickCTA.rawValue: videoPlayback.jsObject])
|
|
52
|
+
sendEvent(withName: FWEventName.VideoPlayback.rawValue, body: ["eventName":VideoPlaybackSubEventName.ClickCTA.rawValue, "info": videoPlayback.jsObject])
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
func fireworkVideoDidTapShareButton(_ videoPlayback: VideoPlaybackDetails) {
|
|
56
56
|
guard enableVideoPlayBackEvent else { return }
|
|
57
|
-
sendEvent(withName: FWEventName.VideoPlayback.rawValue, body: [VideoPlaybackSubEventName.ClickShare.rawValue: videoPlayback.jsObject])
|
|
57
|
+
sendEvent(withName: FWEventName.VideoPlayback.rawValue, body: ["eventName":VideoPlaybackSubEventName.ClickShare.rawValue, "info": videoPlayback.jsObject])
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
func fireworkVideoDidStartPlayingAd(_ videoPlayback: VideoPlaybackDetails) {
|
|
@@ -63,21 +63,12 @@ extension FireworkSDKModule: FireworkVideoPlaybackDelegate {
|
|
|
63
63
|
|
|
64
64
|
func fireworkVideoDidFinishPlayingAd(_ videoPlayback: VideoPlaybackDetails) {
|
|
65
65
|
guard enableVideoPlayBackEvent else { return }
|
|
66
|
-
sendEvent(withName: FWEventName.VideoPlayback.rawValue, body: [VideoPlaybackSubEventName.AdEnd.rawValue: videoPlayback.jsObject])
|
|
66
|
+
sendEvent(withName: FWEventName.VideoPlayback.rawValue, body: ["eventName":VideoPlaybackSubEventName.AdEnd.rawValue, "info": videoPlayback.jsObject])
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
extension FireworkSDKModule: FireworkVideoFeedDelegate {
|
|
71
71
|
func fireworkVideoDidTapThumbnail(_ eventDetails: FeedEventDetails) {
|
|
72
|
-
|
|
73
|
-
case .playlistGroup(_): break
|
|
74
|
-
|
|
75
|
-
default:
|
|
76
|
-
sendEvent(withName: FWEventName.VideoFeedClick.rawValue, body: eventDetails.jsObject)
|
|
77
|
-
}
|
|
72
|
+
sendEvent(withName: FWEventName.VideoFeedClick.rawValue, body: ["info": eventDetails.jsObject])
|
|
78
73
|
}
|
|
79
|
-
|
|
80
|
-
// func fireworkVideoDidTapVideoThumbnail(_ eventDetails: FeedEventDetails) {
|
|
81
|
-
// sendEvent(withName: FWEventName.VideoFeedClick.rawValue, body: eventDetails.jsObject)
|
|
82
|
-
// }
|
|
83
74
|
}
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
_RCT_EXTERN_REMAP_METHOD(init, initializeSDK:(NSString * __nullable)userId config:(NSDictionary *__nullable)config, NO)
|
|
14
14
|
RCT_EXTERN_METHOD(openVideoPlayer:(NSString *)url config:(NSDictionary *)config)
|
|
15
15
|
RCT_EXTERN_METHOD(setCustomCTAClickEnabled:(BOOL)enabled)
|
|
16
|
-
RCT_EXTERN_METHOD(setShareBaseURL:(NSString *)url)
|
|
16
|
+
RCT_EXTERN_METHOD(setShareBaseURL:(NSString *)url resolver: (RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
17
17
|
RCT_EXTERN_METHOD(setVideoPlaybackEventEnabled:(BOOL)enabled)
|
|
18
|
+
RCT_EXTERN_METHOD(setAdBadgeConfiguration:(NSDictionary *)config resolver: (RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
18
19
|
|
|
19
20
|
@end
|