react-native-firework-sdk 2.6.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  2. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Info.plist +0 -0
  3. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.private.swiftinterface +1 -1
  4. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  5. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftinterface +1 -1
  6. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  7. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Info.plist +0 -0
  8. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +1 -1
  9. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  10. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -1
  11. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +1 -1
  12. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  13. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +1 -1
  14. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +17 -17
  15. package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +20 -0
  16. package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +1 -1
  17. package/ios/Components/StoryBlock.swift +56 -0
  18. package/ios/Components/StoryBlockConfiguration.swift +4 -0
  19. package/ios/Components/VideoPlayerConfiguration.swift +20 -20
  20. package/ios/FireworkVideoUI/FireworkVideoUI.xcodeproj/project.pbxproj +20 -20
  21. package/ios/FireworkVideoUI/Podfile +2 -2
  22. package/ios/FireworkVideoUI/Podfile.lock +4 -4
  23. package/ios/Modules/FWNavigatorModule/FWNavigatorModule.m +2 -0
  24. package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +65 -0
  25. package/ios/Modules/FWNavigatorModule/FWRNPresentContainerViewController.swift +33 -0
  26. package/ios/Modules/Shopping/ProductInfoViewConfiguration.swift +7 -0
  27. package/ios/Modules/Shopping/ShoppingModule.swift +18 -2
  28. package/ios/Support/MultiHostStreaming/FWMultiHostStreaming.podspec +1 -1
  29. package/lib/commonjs/FWNavigator.js +38 -0
  30. package/lib/commonjs/FWNavigator.js.map +1 -1
  31. package/lib/commonjs/components/StoryBlock.js +4 -0
  32. package/lib/commonjs/components/StoryBlock.js.map +1 -1
  33. package/lib/commonjs/index.js.map +1 -1
  34. package/lib/commonjs/modules/FWNavigatorModule.js.map +1 -1
  35. package/lib/module/FWNavigator.js +37 -0
  36. package/lib/module/FWNavigator.js.map +1 -1
  37. package/lib/module/components/StoryBlock.js +4 -0
  38. package/lib/module/components/StoryBlock.js.map +1 -1
  39. package/lib/module/index.js.map +1 -1
  40. package/lib/module/modules/FWNavigatorModule.js.map +1 -1
  41. package/lib/typescript/FWNavigator.d.ts +16 -0
  42. package/lib/typescript/index.d.ts +2 -2
  43. package/lib/typescript/models/ProductInfoViewConfiguration.d.ts +15 -0
  44. package/lib/typescript/models/StoryBlockConfiguration.d.ts +28 -0
  45. package/lib/typescript/modules/FWNavigatorModule.d.ts +2 -0
  46. package/package.json +1 -1
  47. package/react-native-firework-sdk.podspec +2 -2
  48. package/src/FWNavigator.ts +33 -0
  49. package/src/components/StoryBlock.tsx +4 -0
  50. package/src/index.ts +2 -0
  51. package/src/models/ProductInfoViewConfiguration.ts +16 -0
  52. package/src/models/StoryBlockConfiguration.ts +28 -0
  53. package/src/modules/FWNavigatorModule.ts +2 -0
@@ -1,6 +1,6 @@
1
1
  // swift-interface-format-version: 1.0
2
2
  // swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
3
- // swift-module-flags: -target arm64-apple-ios12.1 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name FireworkVideoUI
3
+ // swift-module-flags: -target arm64-apple-ios13.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name FireworkVideoUI
4
4
  // swift-module-flags-ignorable: -enable-bare-slash-regex
5
5
  import AVFoundation
6
6
  import FireworkVideo
@@ -1,6 +1,6 @@
1
1
  // swift-interface-format-version: 1.0
2
2
  // swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
3
- // swift-module-flags: -target arm64-apple-ios12.1 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name FireworkVideoUI
3
+ // swift-module-flags: -target arm64-apple-ios13.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name FireworkVideoUI
4
4
  // swift-module-flags-ignorable: -enable-bare-slash-regex
5
5
  import AVFoundation
6
6
  import FireworkVideo
@@ -1,6 +1,6 @@
1
1
  // swift-interface-format-version: 1.0
2
2
  // swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
3
- // swift-module-flags: -target arm64-apple-ios12.1-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name FireworkVideoUI
3
+ // swift-module-flags: -target arm64-apple-ios13.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name FireworkVideoUI
4
4
  // swift-module-flags-ignorable: -enable-bare-slash-regex
5
5
  import AVFoundation
6
6
  import FireworkVideo
@@ -1,6 +1,6 @@
1
1
  // swift-interface-format-version: 1.0
2
2
  // swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
3
- // swift-module-flags: -target arm64-apple-ios12.1-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name FireworkVideoUI
3
+ // swift-module-flags: -target arm64-apple-ios13.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name FireworkVideoUI
4
4
  // swift-module-flags-ignorable: -enable-bare-slash-regex
5
5
  import AVFoundation
6
6
  import FireworkVideo
@@ -1,6 +1,6 @@
1
1
  // swift-interface-format-version: 1.0
2
2
  // swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
3
- // swift-module-flags: -target x86_64-apple-ios12.1-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name FireworkVideoUI
3
+ // swift-module-flags: -target x86_64-apple-ios13.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name FireworkVideoUI
4
4
  // swift-module-flags-ignorable: -enable-bare-slash-regex
5
5
  import AVFoundation
6
6
  import FireworkVideo
@@ -1,6 +1,6 @@
1
1
  // swift-interface-format-version: 1.0
2
2
  // swift-compiler-version: Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
3
- // swift-module-flags: -target x86_64-apple-ios12.1-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name FireworkVideoUI
3
+ // swift-module-flags: -target x86_64-apple-ios13.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name FireworkVideoUI
4
4
  // swift-module-flags-ignorable: -enable-bare-slash-regex
5
5
  import AVFoundation
6
6
  import FireworkVideo
@@ -14,7 +14,7 @@
14
14
  </data>
15
15
  <key>Info.plist</key>
16
16
  <data>
17
- cHxK0wNHzV0MNPDkok4AoDVzRqA=
17
+ xSys4PQnG8lKSIv1Abhys20ti8o=
18
18
  </data>
19
19
  <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
20
20
  <data>
@@ -22,19 +22,19 @@
22
22
  </data>
23
23
  <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
24
24
  <data>
25
- /GzNFf9jFv/sl4Q4Lhabxi0gbc8=
25
+ 0XKpQYvLNcs6gusQUQX4HRW4/Tc=
26
26
  </data>
27
27
  <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
28
28
  <data>
29
- atyRF4RCvp3Q7O/mp4rYXB1jE0Q=
29
+ +yf24NLDrISOUQFdYdfsoS5A8NI=
30
30
  </data>
31
31
  <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
32
32
  <data>
33
- /GzNFf9jFv/sl4Q4Lhabxi0gbc8=
33
+ 0XKpQYvLNcs6gusQUQX4HRW4/Tc=
34
34
  </data>
35
35
  <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
36
36
  <data>
37
- F2Umii8apCaLMJVyMWQgIUzpn1E=
37
+ zpV8IQS3IkfCGGDXHjXGWHZwa9M=
38
38
  </data>
39
39
  <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
40
40
  <data>
@@ -42,19 +42,19 @@
42
42
  </data>
43
43
  <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
44
44
  <data>
45
- 8oDUzC+RXaFFWpOa7QJIXGVBvy8=
45
+ 8HyKG5hen35fWUnYH4rt30wTzis=
46
46
  </data>
47
47
  <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
48
48
  <data>
49
- JazAtiVxFvmfMtiCcVLmAg7e1KM=
49
+ h5aNQF/gt+daU/+BF0c1O+102NQ=
50
50
  </data>
51
51
  <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
52
52
  <data>
53
- 8oDUzC+RXaFFWpOa7QJIXGVBvy8=
53
+ 8HyKG5hen35fWUnYH4rt30wTzis=
54
54
  </data>
55
55
  <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
56
56
  <data>
57
- sx659FYeam5PK2jbM7Y1WGtkf6o=
57
+ Xp/plaW74zCakL/eCFwuVUsXIMc=
58
58
  </data>
59
59
  <key>Modules/module.modulemap</key>
60
60
  <data>
@@ -88,28 +88,28 @@
88
88
  <dict>
89
89
  <key>hash2</key>
90
90
  <data>
91
- fwhJa76QexBQzAQwXNih4Oj7aVZg9RrTP6/kE+nQpQU=
91
+ 5NPzn4LnvqX0tEp8qisADTWcY343bJFvqiysen3m24I=
92
92
  </data>
93
93
  </dict>
94
94
  <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
95
95
  <dict>
96
96
  <key>hash2</key>
97
97
  <data>
98
- ijGRDjteeQYBsYlAIa1ygEoPzdBUK0odDABdGpCdg6I=
98
+ ta85UXRpX/ciy/P7Bwc84q6T+V9vBLuOrilB/TzaRSk=
99
99
  </data>
100
100
  </dict>
101
101
  <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
102
102
  <dict>
103
103
  <key>hash2</key>
104
104
  <data>
105
- fwhJa76QexBQzAQwXNih4Oj7aVZg9RrTP6/kE+nQpQU=
105
+ 5NPzn4LnvqX0tEp8qisADTWcY343bJFvqiysen3m24I=
106
106
  </data>
107
107
  </dict>
108
108
  <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
109
109
  <dict>
110
110
  <key>hash2</key>
111
111
  <data>
112
- Vu9VotUZ3qa07wHJJHfcF7zHGfazMs4gqsPKw71trU8=
112
+ xypcOEQ5+poy6H+qmEMsjs3Z3xEDRf+ZTrouSmsXF9w=
113
113
  </data>
114
114
  </dict>
115
115
  <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
@@ -123,28 +123,28 @@
123
123
  <dict>
124
124
  <key>hash2</key>
125
125
  <data>
126
- xJ9DQwaZOyNiYkXjHRehoDvIZpAhv8v50ToAhTRMTkE=
126
+ 4UfyrWEVo8zN0Rv2i/FuKZol8bbI7YkSfQCkBUrIk2c=
127
127
  </data>
128
128
  </dict>
129
129
  <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
130
130
  <dict>
131
131
  <key>hash2</key>
132
132
  <data>
133
- /VtAsoSxZoVfhFW8ufywQGyBJU+cSfB3cI/rcVkUFGU=
133
+ Wi0OREamh7l3ic/XXkQyRTqKJ1legjNa97cS0rRDQpw=
134
134
  </data>
135
135
  </dict>
136
136
  <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
137
137
  <dict>
138
138
  <key>hash2</key>
139
139
  <data>
140
- xJ9DQwaZOyNiYkXjHRehoDvIZpAhv8v50ToAhTRMTkE=
140
+ 4UfyrWEVo8zN0Rv2i/FuKZol8bbI7YkSfQCkBUrIk2c=
141
141
  </data>
142
142
  </dict>
143
143
  <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
144
144
  <dict>
145
145
  <key>hash2</key>
146
146
  <data>
147
- PLzWyLq9D4PE/sfLnT90BiC90QSacxTwX6PxCpMT0Tg=
147
+ UK0fgWeGwsn4VvGtres2LE8ptm9mFojznI8zzenM2hc=
148
148
  </data>
149
149
  </dict>
150
150
  <key>Modules/module.modulemap</key>
@@ -4,6 +4,7 @@ import android.content.Context
4
4
  import android.util.AttributeSet
5
5
  import android.view.ViewGroup
6
6
  import android.widget.FrameLayout
7
+ import com.firework.videofeed.FeedViewStateListener
7
8
  import com.firework.videofeed.FwVideoFeedView
8
9
  import com.fireworksdk.bridge.models.*
9
10
  import com.fireworksdk.bridge.utils.FWConfigUtil
@@ -21,6 +22,9 @@ class FWVideoFeed(
21
22
  var videoFeedPropsModel: FWVideoFeedPropsModel = FWVideoFeedPropsModel()
22
23
  private var isInit = false
23
24
 
25
+ private var onWindowFocusChanged = false
26
+ private var feedViewStateListener: FeedViewStateListener? = null
27
+
24
28
  init {
25
29
  FWLanguageUtil.getInstance(context).updateBaseContextLocale(context)
26
30
  videoFeedView.layoutDirection = LAYOUT_DIRECTION_LOCALE
@@ -46,4 +50,20 @@ class FWVideoFeed(
46
50
  videoFeedView.refresh()
47
51
  }
48
52
 
53
+ fun setOnFeedViewStateListener(feedViewStateListener: FeedViewStateListener?) {
54
+ this.feedViewStateListener = feedViewStateListener
55
+ if (feedViewStateListener != null) {
56
+ videoFeedView.setOnFeedViewStateListener { feedViewState ->
57
+ if (!onWindowFocusChanged) {
58
+ videoFeedView.dispatchWindowFocusChanged(true)
59
+ onWindowFocusChanged = true
60
+ }
61
+
62
+ feedViewStateListener.onLoadStateChanged(
63
+ feedViewState
64
+ )
65
+ }
66
+ }
67
+ }
68
+
49
69
  }
@@ -163,7 +163,7 @@ class FWVideoFeedManager : SimpleViewManager<FWVideoFeed>() {
163
163
  FWEventUtils.sendVideoFeedClickEvent(reactContext, fwVideoFeedItemDetailsModel)
164
164
  })
165
165
 
166
- videoFeedView.setOnFeedViewStateListener { feedViewState ->
166
+ videoFeed.setOnFeedViewStateListener { feedViewState ->
167
167
  when (feedViewState) {
168
168
  is FeedViewState.Loading -> {
169
169
  FWLogUtils.d { "FeedViewState.Loading" }
@@ -159,6 +159,15 @@ public class StoryBlock: UIView, StoryBlockViewControllerDelegate {
159
159
  return
160
160
  }
161
161
 
162
+ if let playerStyle = config.playerStyle {
163
+ switch playerStyle {
164
+ case .full:
165
+ resultConfig.fullScreenPlayerView.playerStyle = .fullBleed
166
+ default:
167
+ resultConfig.fullScreenPlayerView.playerStyle = .fit
168
+ }
169
+ }
170
+
162
171
  if let videoCompleteAction = config.videoCompleteAction {
163
172
  switch videoCompleteAction {
164
173
  case .loop:
@@ -173,6 +182,27 @@ public class StoryBlock: UIView, StoryBlockViewControllerDelegate {
173
182
  resultConfig.fullScreenPlayerView.shareButton.isHidden = !showShareButton
174
183
  }
175
184
 
185
+ if let ctaButtonStyle = config.ctaButtonStyle {
186
+ if let backgroundColor = ctaButtonStyle.backgroundColor, let color = backgroundColor.uicolor() {
187
+ resultConfig.fullScreenPlayerView.ctaButton.contentConfiguration.backgroundColor = color
188
+ }
189
+ if let textcolor = ctaButtonStyle.textColor, let color = textcolor.uicolor() {
190
+ resultConfig.fullScreenPlayerView.ctaButton.contentConfiguration.textColor = color
191
+ }
192
+ if let fontSize = ctaButtonStyle.fontSize {
193
+ let iOSFontInfo = ctaButtonStyle.iOSFontInfo ?? FontInfo()
194
+ resultConfig.fullScreenPlayerView.ctaButton.contentConfiguration.font = iOSFontInfo.getFont(fontSize)
195
+ }
196
+ }
197
+
198
+ // if let showPlaybackButton = config.showPlaybackButton {
199
+ // resultConfig.fullScreenPlayerView.playbackButton.isHidden = !showPlaybackButton
200
+ // }
201
+ //
202
+ // if let showMuteButton = config.showMuteButton {
203
+ // resultConfig.fullScreenPlayerView.muteButton.isHidden = !showMuteButton
204
+ // }
205
+
176
206
  if let showBranding = config.showBranding {
177
207
  resultConfig.videoDetail.fireworkAttribution.isHidden = !showBranding
178
208
  resultConfig.fullScreenPlayerView.videoDetail.fireworkAttribution.isHidden = !showBranding
@@ -222,6 +252,32 @@ public class StoryBlock: UIView, StoryBlockViewControllerDelegate {
222
252
  }
223
253
  }
224
254
 
255
+ if let buttonConfiguration = config.buttonConfiguration {
256
+ if let videoDetailButtonDisplay = buttonConfiguration.videoDetailButton?.getButtonDisplayConfiguration() {
257
+ resultConfig.fullScreenPlayerView.videoDetailButtonDisplayConfiguration = videoDetailButtonDisplay
258
+ }
259
+
260
+ if let closeButtonDisplay = buttonConfiguration.closeButton?.getButtonDisplayConfiguration() {
261
+ resultConfig.fullScreenPlayerView.closeButtonConfiguration.closeDisplay = closeButtonDisplay
262
+ }
263
+
264
+ if let muteButtonDisplay = buttonConfiguration.muteButton?.getButtonDisplayConfiguration() {
265
+ resultConfig.fullScreenPlayerView.muteButton.muteDisplay = muteButtonDisplay
266
+ }
267
+
268
+ if let unmuteButtonDisplay = buttonConfiguration.unmuteButton?.getButtonDisplayConfiguration() {
269
+ resultConfig.fullScreenPlayerView.muteButton.unmuteDisplay = unmuteButtonDisplay
270
+ }
271
+
272
+ if let playButtonDisplay = buttonConfiguration.playButton?.getButtonDisplayConfiguration() {
273
+ resultConfig.fullScreenPlayerView.playbackButton.playDisplay = playButtonDisplay
274
+ }
275
+
276
+ if let pauseButtonDisplay = buttonConfiguration.pauseButton?.getButtonDisplayConfiguration() {
277
+ resultConfig.fullScreenPlayerView.playbackButton.pauseDisplay = pauseButtonDisplay
278
+ }
279
+ }
280
+
225
281
  if let adBadge = FireworkSDKModule.convertToFWAdBadgeConfiguration(gAdBadgeConfiguration) {
226
282
  resultConfig.adBadge = adBadge
227
283
  }
@@ -9,14 +9,18 @@ import Foundation
9
9
 
10
10
  @objc
11
11
  public class StoryBlockConfiguration: NSObject, Codable {
12
+ var playerStyle: VideoPlayerStyle?
12
13
  var videoCompleteAction: VideoPlayerCompleteAction?
13
14
  var showShareButton: Bool?
15
+ var ctaButtonStyle: VideoPlayerCTAStyle?
14
16
  var showPlaybackButton: Bool?
17
+ var showMuteButton: Bool?
15
18
  var showBranding: Bool?
16
19
  var shareBaseURL: String?
17
20
  var ctaWidth: VideoPlayerCTAWidth?
18
21
  var ctaDelay: VideoPlayerCTADelay?
19
22
  var ctaHighlightDelay: VideoPlayerCTADelay?
20
23
  var enablePictureInPicture: Bool?
24
+ var buttonConfiguration: VideoPlayerButtonConfiguration?
21
25
  var showVideoDetailTitle: Bool?
22
26
  }
@@ -8,6 +8,17 @@
8
8
  import Foundation
9
9
  import FireworkVideo
10
10
 
11
+ public enum VideoPlayerStyle: String, Codable {
12
+ case full, fit
13
+ }
14
+
15
+ public class VideoPlayerCTAStyle: NSObject, Codable {
16
+ var backgroundColor: String?
17
+ var textColor: String?
18
+ var fontSize: Double?
19
+ var iOSFontInfo: FontInfo?
20
+ }
21
+
11
22
  public enum VideoPlayerCompleteAction: String, Codable {
12
23
  case loop, advanceToNext
13
24
  }
@@ -36,6 +47,15 @@ public enum VideoPlayerCTAWidth: String, Codable {
36
47
  }
37
48
  }
38
49
 
50
+ public class VideoPlayerButtonConfiguration: NSObject, Codable {
51
+ var videoDetailButton: ButtonInfo?
52
+ var closeButton: ButtonInfo?
53
+ var muteButton: ButtonInfo?
54
+ var unmuteButton: ButtonInfo?
55
+ var playButton: ButtonInfo?
56
+ var pauseButton: ButtonInfo?
57
+ }
58
+
39
59
  @objc
40
60
  public class VideoPlayerConfiguration: NSObject, Codable {
41
61
  var playerStyle: VideoPlayerStyle?
@@ -52,24 +72,4 @@ public class VideoPlayerConfiguration: NSObject, Codable {
52
72
  var enablePictureInPicture: Bool?
53
73
  var buttonConfiguration: VideoPlayerButtonConfiguration?
54
74
  var showVideoDetailTitle: Bool?
55
-
56
- public enum VideoPlayerStyle: String, Codable {
57
- case full, fit
58
- }
59
-
60
- public class VideoPlayerCTAStyle: NSObject, Codable {
61
- var backgroundColor: String?
62
- var textColor: String?
63
- var fontSize: Double?
64
- var iOSFontInfo: FontInfo?
65
- }
66
-
67
- public class VideoPlayerButtonConfiguration: NSObject, Codable {
68
- var videoDetailButton: ButtonInfo?
69
- var closeButton: ButtonInfo?
70
- var muteButton: ButtonInfo?
71
- var unmuteButton: ButtonInfo?
72
- var playButton: ButtonInfo?
73
- var pauseButton: ButtonInfo?
74
- }
75
75
  }
@@ -325,7 +325,7 @@
325
325
  89DF336429F813F600A8B124 /* Sources */,
326
326
  89DF336529F813F600A8B124 /* Frameworks */,
327
327
  89DF336629F813F600A8B124 /* Resources */,
328
- 6C2BDC8A3A425354D82BE358 /* [CP] Embed Pods Frameworks */,
328
+ E41A9C7B9A1CDE7BFB4DE25F /* [CP] Embed Pods Frameworks */,
329
329
  );
330
330
  buildRules = (
331
331
  );
@@ -392,23 +392,6 @@
392
392
  /* End PBXResourcesBuildPhase section */
393
393
 
394
394
  /* Begin PBXShellScriptBuildPhase section */
395
- 6C2BDC8A3A425354D82BE358 /* [CP] Embed Pods Frameworks */ = {
396
- isa = PBXShellScriptBuildPhase;
397
- buildActionMask = 2147483647;
398
- files = (
399
- );
400
- inputFileListPaths = (
401
- "${PODS_ROOT}/Target Support Files/Pods-FireworkVideoUI-FireworkVideoUITests/Pods-FireworkVideoUI-FireworkVideoUITests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
402
- );
403
- name = "[CP] Embed Pods Frameworks";
404
- outputFileListPaths = (
405
- "${PODS_ROOT}/Target Support Files/Pods-FireworkVideoUI-FireworkVideoUITests/Pods-FireworkVideoUI-FireworkVideoUITests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
406
- );
407
- runOnlyForDeploymentPostprocessing = 0;
408
- shellPath = /bin/sh;
409
- shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FireworkVideoUI-FireworkVideoUITests/Pods-FireworkVideoUI-FireworkVideoUITests-frameworks.sh\"\n";
410
- showEnvVarsInLog = 0;
411
- };
412
395
  88FF76CA511D81BEBB5DA460 /* [CP] Check Pods Manifest.lock */ = {
413
396
  isa = PBXShellScriptBuildPhase;
414
397
  buildActionMask = 2147483647;
@@ -453,6 +436,23 @@
453
436
  shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
454
437
  showEnvVarsInLog = 0;
455
438
  };
439
+ E41A9C7B9A1CDE7BFB4DE25F /* [CP] Embed Pods Frameworks */ = {
440
+ isa = PBXShellScriptBuildPhase;
441
+ buildActionMask = 2147483647;
442
+ files = (
443
+ );
444
+ inputFileListPaths = (
445
+ "${PODS_ROOT}/Target Support Files/Pods-FireworkVideoUI-FireworkVideoUITests/Pods-FireworkVideoUI-FireworkVideoUITests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
446
+ );
447
+ name = "[CP] Embed Pods Frameworks";
448
+ outputFileListPaths = (
449
+ "${PODS_ROOT}/Target Support Files/Pods-FireworkVideoUI-FireworkVideoUITests/Pods-FireworkVideoUI-FireworkVideoUITests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
450
+ );
451
+ runOnlyForDeploymentPostprocessing = 0;
452
+ shellPath = /bin/sh;
453
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FireworkVideoUI-FireworkVideoUITests/Pods-FireworkVideoUI-FireworkVideoUITests-frameworks.sh\"\n";
454
+ showEnvVarsInLog = 0;
455
+ };
456
456
  /* End PBXShellScriptBuildPhase section */
457
457
 
458
458
  /* Begin PBXSourcesBuildPhase section */
@@ -639,7 +639,7 @@
639
639
  GENERATE_INFOPLIST_FILE = YES;
640
640
  INFOPLIST_KEY_NSHumanReadableCopyright = "";
641
641
  INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
642
- IPHONEOS_DEPLOYMENT_TARGET = 12.1;
642
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
643
643
  LD_RUNPATH_SEARCH_PATHS = (
644
644
  "$(inherited)",
645
645
  "@executable_path/Frameworks",
@@ -673,7 +673,7 @@
673
673
  GENERATE_INFOPLIST_FILE = YES;
674
674
  INFOPLIST_KEY_NSHumanReadableCopyright = "";
675
675
  INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
676
- IPHONEOS_DEPLOYMENT_TARGET = 12.1;
676
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
677
677
  LD_RUNPATH_SEARCH_PATHS = (
678
678
  "$(inherited)",
679
679
  "@executable_path/Frameworks",
@@ -1,12 +1,12 @@
1
1
  # Uncomment the next line to define a global platform for your project
2
- platform :ios, '12.1'
2
+ platform :ios, '13.0'
3
3
 
4
4
  target 'FireworkVideoUI' do
5
5
  # Comment the next line if you don't want to use dynamic frameworks
6
6
  use_frameworks!
7
7
 
8
8
  # Pods for FireworkVideoUI
9
- pod 'FireworkVideo', '1.12.0'
9
+ pod 'FireworkVideo', '1.13.0'
10
10
 
11
11
  target 'FireworkVideoUITests' do
12
12
  # Pods for testing
@@ -1,16 +1,16 @@
1
1
  PODS:
2
- - FireworkVideo (1.12.0)
2
+ - FireworkVideo (1.13.0)
3
3
 
4
4
  DEPENDENCIES:
5
- - FireworkVideo (= 1.12.0)
5
+ - FireworkVideo (= 1.13.0)
6
6
 
7
7
  SPEC REPOS:
8
8
  trunk:
9
9
  - FireworkVideo
10
10
 
11
11
  SPEC CHECKSUMS:
12
- FireworkVideo: 8f7667ac08b5bb5a0bc09656f4cb6b782dcddccd
12
+ FireworkVideo: 97ef1b615991fe967bd3ed6a7380a250fb02f403
13
13
 
14
- PODFILE CHECKSUM: 45fcc23fac9e8972f203deb221c0838163e06f6d
14
+ PODFILE CHECKSUM: c22dec34b8972d810f5d4e1c0347d4da880ffd0f
15
15
 
16
16
  COCOAPODS: 1.12.1
@@ -16,5 +16,7 @@ RCT_EXTERN_METHOD(popRNContainer:(RCTPromiseResolveBlock)resolver rejecter:(RCTP
16
16
  RCT_EXTERN_METHOD(popNativeContainer:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
17
17
  RCT_EXTERN_METHOD(startFloatingPlayer:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
18
18
  RCT_EXTERN_METHOD(stopFloatingPlayer:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
19
+ RCT_EXTERN_METHOD(bringRNContainerToTop:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
20
+ RCT_EXTERN_METHOD(bringRNContainerToBottom:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
19
21
 
20
22
  @end
@@ -149,6 +149,71 @@ class FWNavigatorModule: RCTEventEmitter {
149
149
  let result = FWNavigatorModule.stopFloatingPlayer()
150
150
  resolver(result)
151
151
  }
152
+
153
+ @objc(bringRNContainerToTop:rejecter:)
154
+ func bringRNContainerToTop(
155
+ resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock
156
+ ) {
157
+ guard let presentedVC = RCTPresentedViewController() else {
158
+ resolver(false)
159
+ return
160
+ }
161
+
162
+ let containerViewController = FWRNPresentContainerViewController()
163
+ containerViewController.modalPresentationStyle = .fullScreen
164
+
165
+ guard let window = UIApplication.shared.delegate?.window as? UIWindow,
166
+ let rootView = window.rootViewController?.view as? RCTRootView else {
167
+ resolver(false)
168
+ return
169
+ }
170
+
171
+ let childViewControllers = rootView.reactViewController()?.children
172
+ childViewControllers?.forEach { (childViewController) in
173
+ let detachedController = childViewController
174
+ detachedController.willMove(toParent: nil)
175
+ detachedController.removeFromParent()
176
+ containerViewController.addChild(detachedController)
177
+ detachedController.didMove(toParent: containerViewController)
178
+ }
179
+ rootView.removeFromSuperview()
180
+ window.rootViewController?.view = UIView()
181
+ containerViewController.rootView = rootView
182
+ presentedVC.present(containerViewController, animated: true) {
183
+ resolver(true)
184
+ }
185
+ }
186
+
187
+ @objc(bringRNContainerToBottom:rejecter:)
188
+ func bringRNContainerToBottom(
189
+ _ resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock
190
+ ) {
191
+ if let containerVC = RCTPresentedViewController() as? FWRNPresentContainerViewController,
192
+ let rootView = containerVC.rootView,
193
+ containerVC.presentingViewController != nil {
194
+ guard let window = UIApplication.shared.delegate?.window as? UIWindow,
195
+ let rootViewController = window.rootViewController else {
196
+ resolver(false)
197
+ return
198
+ }
199
+ let childViewControllers = rootView.reactViewController()?.children
200
+ containerVC.dismiss(animated: true) {
201
+ childViewControllers?.forEach { (childViewController) in
202
+ let detachedController = childViewController
203
+ detachedController.willMove(toParent: nil)
204
+ detachedController.removeFromParent()
205
+ rootViewController.addChild(detachedController)
206
+ detachedController.didMove(toParent: rootViewController)
207
+ }
208
+ rootView.removeFromSuperview()
209
+ rootViewController.view = rootView
210
+ resolver(true)
211
+ }
212
+ } else {
213
+ resolver(false)
214
+ }
215
+ }
216
+
152
217
  }
153
218
 
154
219
  extension FWNavigatorModule {
@@ -0,0 +1,33 @@
1
+ //
2
+ // FWRNPresentContainerViewController.swift
3
+ // react-native-firework-sdk
4
+ //
5
+ // Created by Haitao Shangguan on 2023/8/22.
6
+ //
7
+
8
+ import Foundation
9
+
10
+ class FWRNPresentContainerViewController: UIViewController {
11
+ var rootView: RCTRootView?
12
+
13
+ override func viewDidLoad() {
14
+ super.viewDidLoad()
15
+ loadContent()
16
+ }
17
+
18
+ private func loadContent() {
19
+ guard let rootView = rootView else {
20
+ return
21
+ }
22
+
23
+ view.addSubview(rootView)
24
+ rootView.translatesAutoresizingMaskIntoConstraints = false
25
+
26
+ NSLayoutConstraint.activate([
27
+ rootView.leftAnchor.constraint(equalTo: view.leftAnchor),
28
+ rootView.topAnchor.constraint(equalTo: view.topAnchor),
29
+ rootView.rightAnchor.constraint(equalTo: view.rightAnchor),
30
+ rootView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
31
+ ])
32
+ }
33
+ }
@@ -31,6 +31,9 @@ struct ProductInfoViewConfiguration: Codable {
31
31
  struct ProductCardConfiguration: Codable {
32
32
  var theme: ProductCardTheme?
33
33
  var ctaButtonText: ProductCardCTAButtonText?
34
+ var cornerRadius: CGFloat?
35
+ var priceConfiguration: ProductCardPriceConfiguration?
36
+ var isCtaButtonHidden: Bool?
34
37
  }
35
38
 
36
39
  enum ProductCardTheme: String, Codable {
@@ -42,4 +45,8 @@ struct ProductInfoViewConfiguration: Codable {
42
45
  case shopNow
43
46
  case buyNow
44
47
  }
48
+
49
+ struct ProductCardPriceConfiguration: Codable {
50
+ var isHidden: Bool?
51
+ }
45
52
  }