react-native-firework-sdk 1.10.2 → 1.11.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 (42) hide show
  1. package/FireworkVideoUI.xcframework/Info.plist +5 -5
  2. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  3. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Info.plist +0 -0
  4. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.abi.json +0 -7
  5. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  6. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Info.plist +0 -0
  7. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.abi.json +0 -7
  8. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json +0 -7
  9. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +9 -9
  10. package/ios/Components/VideoFeed.swift +10 -3
  11. package/ios/Components/VideoFeedConfiguration.swift +1 -0
  12. package/ios/Components/VideoPlayerConfiguration.swift +17 -0
  13. package/ios/FireworkSdk.xcodeproj/project.pbxproj +0 -4
  14. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/URLSession+AppLanguage.swift +1 -18
  15. package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +1 -9
  16. package/lib/commonjs/FireworkSDK.js +21 -16
  17. package/lib/commonjs/FireworkSDK.js.map +1 -1
  18. package/lib/commonjs/components/StoryBlock.js +30 -22
  19. package/lib/commonjs/components/StoryBlock.js.map +1 -1
  20. package/lib/commonjs/components/VideoFeed.js +55 -31
  21. package/lib/commonjs/components/VideoFeed.js.map +1 -1
  22. package/lib/commonjs/index.js.map +1 -1
  23. package/lib/module/FireworkSDK.js +21 -16
  24. package/lib/module/FireworkSDK.js.map +1 -1
  25. package/lib/module/components/StoryBlock.js +28 -21
  26. package/lib/module/components/StoryBlock.js.map +1 -1
  27. package/lib/module/components/VideoFeed.js +54 -31
  28. package/lib/module/components/VideoFeed.js.map +1 -1
  29. package/lib/module/index.js.map +1 -1
  30. package/lib/typescript/components/VideoFeed.d.ts +4 -4
  31. package/lib/typescript/index.d.ts +2 -2
  32. package/lib/typescript/models/VideoFeedConfiguration.d.ts +5 -0
  33. package/lib/typescript/models/VideoPlayerConfiguration.d.ts +6 -0
  34. package/package.json +1 -1
  35. package/react-native-firework-sdk.podspec +1 -1
  36. package/src/FireworkSDK.ts +20 -19
  37. package/src/components/StoryBlock.tsx +37 -27
  38. package/src/components/VideoFeed.tsx +75 -43
  39. package/src/index.ts +2 -0
  40. package/src/models/VideoFeedConfiguration.ts +5 -0
  41. package/src/models/VideoPlayerConfiguration.ts +6 -0
  42. package/ios/Modules/FWNavigatorModule/FWNavigatorProtocol.swift +0 -18
@@ -6,30 +6,30 @@
6
6
  <array>
7
7
  <dict>
8
8
  <key>LibraryIdentifier</key>
9
- <string>ios-arm64</string>
9
+ <string>ios-arm64_x86_64-simulator</string>
10
10
  <key>LibraryPath</key>
11
11
  <string>FireworkVideoUI.framework</string>
12
12
  <key>SupportedArchitectures</key>
13
13
  <array>
14
14
  <string>arm64</string>
15
+ <string>x86_64</string>
15
16
  </array>
16
17
  <key>SupportedPlatform</key>
17
18
  <string>ios</string>
19
+ <key>SupportedPlatformVariant</key>
20
+ <string>simulator</string>
18
21
  </dict>
19
22
  <dict>
20
23
  <key>LibraryIdentifier</key>
21
- <string>ios-arm64_x86_64-simulator</string>
24
+ <string>ios-arm64</string>
22
25
  <key>LibraryPath</key>
23
26
  <string>FireworkVideoUI.framework</string>
24
27
  <key>SupportedArchitectures</key>
25
28
  <array>
26
29
  <string>arm64</string>
27
- <string>x86_64</string>
28
30
  </array>
29
31
  <key>SupportedPlatform</key>
30
32
  <string>ios</string>
31
- <key>SupportedPlatformVariant</key>
32
- <string>simulator</string>
33
33
  </dict>
34
34
  </array>
35
35
  <key>CFBundlePackageType</key>
@@ -1008,13 +1008,6 @@
1008
1008
  "json_format_version": 8
1009
1009
  },
1010
1010
  "ConstValues": [
1011
- {
1012
- "filePath": "\/Users\/runner\/work\/bogano\/bogano\/ios\/FireworkVideoUI\/FireworkVideoUI\/Sources\/AppLanguage\/Extensions\/Foundation\/URLSession+AppLanguage.swift",
1013
- "kind": "Array",
1014
- "offset": 141,
1015
- "length": 47,
1016
- "value": "[\"api.firework.tv\", \"p2.fwpixel.com\"]"
1017
- },
1018
1011
  {
1019
1012
  "filePath": "\/Users\/runner\/work\/bogano\/bogano\/ios\/FireworkVideoUI\/FireworkVideoUI\/Sources\/LayoutFlip\/LayoutFlipManager.swift",
1020
1013
  "kind": "BooleanLiteral",
@@ -1008,13 +1008,6 @@
1008
1008
  "json_format_version": 8
1009
1009
  },
1010
1010
  "ConstValues": [
1011
- {
1012
- "filePath": "\/Users\/runner\/work\/bogano\/bogano\/ios\/FireworkVideoUI\/FireworkVideoUI\/Sources\/AppLanguage\/Extensions\/Foundation\/URLSession+AppLanguage.swift",
1013
- "kind": "Array",
1014
- "offset": 141,
1015
- "length": 47,
1016
- "value": "[\"api.firework.tv\", \"p2.fwpixel.com\"]"
1017
- },
1018
1011
  {
1019
1012
  "filePath": "\/Users\/runner\/work\/bogano\/bogano\/ios\/FireworkVideoUI\/FireworkVideoUI\/Sources\/LayoutFlip\/LayoutFlipManager.swift",
1020
1013
  "kind": "BooleanLiteral",
@@ -1008,13 +1008,6 @@
1008
1008
  "json_format_version": 8
1009
1009
  },
1010
1010
  "ConstValues": [
1011
- {
1012
- "filePath": "\/Users\/runner\/work\/bogano\/bogano\/ios\/FireworkVideoUI\/FireworkVideoUI\/Sources\/AppLanguage\/Extensions\/Foundation\/URLSession+AppLanguage.swift",
1013
- "kind": "Array",
1014
- "offset": 141,
1015
- "length": 47,
1016
- "value": "[\"api.firework.tv\", \"p2.fwpixel.com\"]"
1017
- },
1018
1011
  {
1019
1012
  "filePath": "\/Users\/runner\/work\/bogano\/bogano\/ios\/FireworkVideoUI\/FireworkVideoUI\/Sources\/LayoutFlip\/LayoutFlipManager.swift",
1020
1013
  "kind": "BooleanLiteral",
@@ -14,11 +14,11 @@
14
14
  </data>
15
15
  <key>Info.plist</key>
16
16
  <data>
17
- hmtbTlDgDLmHJs93EgFIc89ZI2A=
17
+ 84mRY5l/cj441cpS01BcanPfb1E=
18
18
  </data>
19
19
  <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
20
20
  <data>
21
- Au+a1vc6m45SBkvfSdh3UT+uM2E=
21
+ BALX7cA285rsgDWZYy2Je4uz2tQ=
22
22
  </data>
23
23
  <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
24
24
  <data>
@@ -34,11 +34,11 @@
34
34
  </data>
35
35
  <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
36
36
  <data>
37
- GstdOocn005n9Y9BSuCOjaZ/KBo=
37
+ W9mmzqImg/hv90rqvn9mnbfPUTk=
38
38
  </data>
39
39
  <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
40
40
  <data>
41
- Au+a1vc6m45SBkvfSdh3UT+uM2E=
41
+ BALX7cA285rsgDWZYy2Je4uz2tQ=
42
42
  </data>
43
43
  <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
44
44
  <data>
@@ -54,7 +54,7 @@
54
54
  </data>
55
55
  <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
56
56
  <data>
57
- ufdIb2xdE4Uk5fET7rrUGlF8CFY=
57
+ KksjlpjE++zgDeAOhq4zQycU1hc=
58
58
  </data>
59
59
  <key>Modules/module.modulemap</key>
60
60
  <data>
@@ -81,7 +81,7 @@
81
81
  <dict>
82
82
  <key>hash2</key>
83
83
  <data>
84
- A0FxvzFLyYWeXhK8cUOfscPrLasCqhaZNJhKluYu59k=
84
+ ew2ebx6hDr4uQCZOoc23fEvJeorlh509fxV5vyTy++U=
85
85
  </data>
86
86
  </dict>
87
87
  <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
@@ -109,14 +109,14 @@
109
109
  <dict>
110
110
  <key>hash2</key>
111
111
  <data>
112
- gHcFcwcr1aAv9W0SVThpQzKZ4iwioor9z8/+tAL9+5Q=
112
+ +MicKOZQ009eDWeHltIkXbwl/dn994NdLr3pCQcdI9E=
113
113
  </data>
114
114
  </dict>
115
115
  <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
116
116
  <dict>
117
117
  <key>hash2</key>
118
118
  <data>
119
- A0FxvzFLyYWeXhK8cUOfscPrLasCqhaZNJhKluYu59k=
119
+ ew2ebx6hDr4uQCZOoc23fEvJeorlh509fxV5vyTy++U=
120
120
  </data>
121
121
  </dict>
122
122
  <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
@@ -144,7 +144,7 @@
144
144
  <dict>
145
145
  <key>hash2</key>
146
146
  <data>
147
- 3LgfAp0SD5Qb24w+Jt+yH3P1gvMKdtH25ZZQHYt25Os=
147
+ wjBxaRVzBx1PuPF4e58RBVmEsmRxo31dlkunsyupS7Q=
148
148
  </data>
149
149
  </dict>
150
150
  <key>Modules/module.modulemap</key>
@@ -258,6 +258,9 @@ extension VideoFeed {
258
258
  if let textcolor = title.textColor {
259
259
  vfcConfig.title.textColor = textcolor.uicolor()
260
260
  }
261
+ if let numberOfLines = title.numberOfLines {
262
+ vfcConfig.title.numberOfLines = numberOfLines
263
+ }
261
264
  if let fontSize = title.fontSize {
262
265
  let iOSFontInfo = title.iOSFontInfo ?? FontInfo()
263
266
  vfcConfig.title.font = iOSFontInfo.getFont(fontSize)
@@ -373,14 +376,15 @@ extension VideoFeed {
373
376
  }
374
377
  }
375
378
 
379
+ if let ctaWidth = config.ctaWidth {
380
+ vpcConfig.ctaButton.width = ctaWidth.width()
381
+ }
382
+
376
383
  return vpcConfig
377
384
  }
378
385
 
379
386
  private func convertToVideoFeedContentConfiguration() -> VideoFeedContentConfiguration {
380
387
  var videoConfig = VideoFeedContentConfiguration()
381
- // default value so that behavior will the same with Android
382
- videoConfig.itemView.title.isHidden = false
383
- videoConfig.itemView.titleLayoutConfiguration.titlePosition = .nested
384
388
 
385
389
  let vfcConfig = VideoFeed.convertToVideoFeedItemContentConfiguration(feedViewConfig)
386
390
  let vpcConfig = VideoFeed.convertToVideoPlayerContentConfiguration(playerViewConfig)
@@ -399,6 +403,9 @@ extension VideoFeed {
399
403
  videoConfig.adBadge = adBadge
400
404
  }
401
405
 
406
+ // set a value different from default value to compatible with FireworkVideo SDK misalign bug
407
+ videoConfig.itemView.titleLayoutConfiguration.insets = UIEdgeInsets(top: 7, left: 7, bottom: 7, right: 7)
408
+
402
409
  // set a value different from default value to compatible with FireworkVideo SDK misalign bug
403
410
  videoConfig.itemView.titleLayoutConfiguration.insets = UIEdgeInsets(
404
411
  top: 7, left: 7, bottom: 7, right: 7)
@@ -28,6 +28,7 @@ public class VideoFeedConfiguration: NSObject, Codable {
28
28
  public var hidden: Bool?
29
29
  public var textColor: String?
30
30
  public var fontSize: Double?
31
+ public var numberOfLines: Int?
31
32
  public var iOSFontInfo: FontInfo?
32
33
  }
33
34
 
@@ -6,6 +6,7 @@
6
6
  //
7
7
 
8
8
  import Foundation
9
+ import FireworkVideo
9
10
 
10
11
  @objc
11
12
  public class VideoPlayerConfiguration: NSObject, Codable {
@@ -19,6 +20,7 @@ public class VideoPlayerConfiguration: NSObject, Codable {
19
20
  var showBranding: Bool?
20
21
  var ctaDelay: VideoPlayerCTADelay?
21
22
  var ctaHighlightDelay: VideoPlayerCTADelay?
23
+ var ctaWidth: VideoPlayerCTAWidth?
22
24
 
23
25
  public enum VideoPlayerStyle: String, Codable {
24
26
  case full, fit
@@ -47,4 +49,19 @@ public class VideoPlayerConfiguration: NSObject, Codable {
47
49
  var type: VideoPlayerCTADelayType?
48
50
  var value: Double?
49
51
  }
52
+
53
+ public enum VideoPlayerCTAWidth: String, Codable {
54
+ case fullWidth, compact, sizeToFit
55
+
56
+ func width() -> VideoPlayerCTAConfiguration.VideoPlayerCTAWidth {
57
+ switch self {
58
+ case .fullWidth:
59
+ return .fullWidth
60
+ case .compact:
61
+ return .compact
62
+ case .sizeToFit:
63
+ return .sizeToFit
64
+ }
65
+ }
66
+ }
50
67
  }
@@ -29,7 +29,6 @@
29
29
  894FAD9D29BAD4C4000FB51A /* VideoFeed.swift in Sources */ = {isa = PBXBuildFile; fileRef = 894FAD5829BAD4C3000FB51A /* VideoFeed.swift */; };
30
30
  894FAD9E29BAD4C4000FB51A /* VideoPlayerConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 894FAD5929BAD4C3000FB51A /* VideoPlayerConfiguration.swift */; };
31
31
  894FAD9F29BAD4C4000FB51A /* VideoFeedManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 894FAD5A29BAD4C3000FB51A /* VideoFeedManager.m */; };
32
- 894FADA029BAD4C4000FB51A /* FWNavigatorProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 894FAD5D29BAD4C3000FB51A /* FWNavigatorProtocol.swift */; };
33
32
  894FADA129BAD4C4000FB51A /* FWNavigatorContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 894FAD5E29BAD4C3000FB51A /* FWNavigatorContainerViewController.swift */; };
34
33
  894FADA229BAD4C4000FB51A /* FWNavigatorModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 894FAD5F29BAD4C3000FB51A /* FWNavigatorModule.swift */; };
35
34
  894FADA329BAD4C4000FB51A /* FWNavigatorModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 894FAD6029BAD4C4000FB51A /* FWNavigatorModule.m */; };
@@ -86,7 +85,6 @@
86
85
  894FAD5829BAD4C3000FB51A /* VideoFeed.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoFeed.swift; sourceTree = "<group>"; };
87
86
  894FAD5929BAD4C3000FB51A /* VideoPlayerConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoPlayerConfiguration.swift; sourceTree = "<group>"; };
88
87
  894FAD5A29BAD4C3000FB51A /* VideoFeedManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideoFeedManager.m; sourceTree = "<group>"; };
89
- 894FAD5D29BAD4C3000FB51A /* FWNavigatorProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FWNavigatorProtocol.swift; sourceTree = "<group>"; };
90
88
  894FAD5E29BAD4C3000FB51A /* FWNavigatorContainerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FWNavigatorContainerViewController.swift; sourceTree = "<group>"; };
91
89
  894FAD5F29BAD4C3000FB51A /* FWNavigatorModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FWNavigatorModule.swift; sourceTree = "<group>"; };
92
90
  894FAD6029BAD4C4000FB51A /* FWNavigatorModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FWNavigatorModule.m; sourceTree = "<group>"; };
@@ -230,7 +228,6 @@
230
228
  894FAD5C29BAD4C3000FB51A /* FWNavigatorModule */ = {
231
229
  isa = PBXGroup;
232
230
  children = (
233
- 894FAD5D29BAD4C3000FB51A /* FWNavigatorProtocol.swift */,
234
231
  894FAD5E29BAD4C3000FB51A /* FWNavigatorContainerViewController.swift */,
235
232
  894FAD5F29BAD4C3000FB51A /* FWNavigatorModule.swift */,
236
233
  894FAD6029BAD4C4000FB51A /* FWNavigatorModule.m */,
@@ -341,7 +338,6 @@
341
338
  894FAD9B29BAD4C4000FB51A /* StoryBlockManager.m in Sources */,
342
339
  894FADB029BAD4C4000FB51A /* LiveStreamModule.m in Sources */,
343
340
  894FADA829BAD4C4000FB51A /* ShoppingModule.swift in Sources */,
344
- 894FADA029BAD4C4000FB51A /* FWNavigatorProtocol.swift in Sources */,
345
341
  894FAD9929BAD4C4000FB51A /* AdConfiguration.swift in Sources */,
346
342
  894FAD9D29BAD4C4000FB51A /* VideoFeed.swift in Sources */,
347
343
  894FAD9729BAD4C4000FB51A /* StoryBlock.swift in Sources */,
@@ -6,11 +6,6 @@
6
6
 
7
7
  import Foundation
8
8
 
9
- private var FWHostList: [String] = [
10
- "api.firework.tv",
11
- "p2.fwpixel.com"
12
- ]
13
-
14
9
  extension URLSession {
15
10
  static func swizzleURLSessionMethodsForAppLanguage() {
16
11
  // swiftlint:disable:next line_length
@@ -41,20 +36,8 @@ extension URLSession {
41
36
  }
42
37
 
43
38
  private func swizzleRequest(_ request: URLRequest) -> URLRequest {
44
- var host = ""
45
- #if compiler(>=5.7)
46
- if #available(iOS 16, *) {
47
- host = request.url?.host() ?? ""
48
- } else {
49
- host = request.url?.host ?? ""
50
- }
51
- #else
52
- host = request.url?.host ?? ""
53
- #endif
54
-
55
39
  if let language = AppLanguageManager.shared.appLanguage,
56
- let languageCode = AppLanguageManager.shared.appLanguageCode,
57
- FWHostList.contains(host) {
40
+ let languageCode = AppLanguageManager.shared.appLanguageCode {
58
41
  var mutableRequest = request
59
42
  if language != languageCode {
60
43
  mutableRequest.setValue("\(language),\(languageCode);q=0.9", forHTTPHeaderField: "Accept-Language")
@@ -12,16 +12,8 @@ private let FWExitButtonImageNames: [String] = [
12
12
  "down-arrow-light"
13
13
  ]
14
14
 
15
- private struct PlayerInfo {
16
- enum PlayerMode: Int {
17
- case fullscreen, floating
18
- }
19
- var playerVC: PlayerViewController
20
- var mode: PlayerMode
21
- }
22
-
23
15
  @objc(FWNavigatorModule)
24
- class FWNavigatorModule: RCTEventEmitter, FWNavigator {
16
+ class FWNavigatorModule: RCTEventEmitter {
25
17
  override func supportedEvents() -> [String]! {
26
18
  return [FWEventName.logMessage.rawValue]
27
19
  }
@@ -99,14 +99,14 @@ class FireworkSDK {
99
99
  }
100
100
 
101
101
  set shareBaseURL(value) {
102
- _FireworkSDKModule.default.setShareBaseURL(value !== null && value !== void 0 ? value : '').then(() => {
103
- const valueHasChanged = this._shareBaseURL !== value;
104
- this._shareBaseURL = value;
102
+ const valueHasChanged = this._shareBaseURL !== value;
103
+ this._shareBaseURL = value;
105
104
 
106
- if (valueHasChanged) {
107
- this.eventEmitter.emit(_FWEventName.FWEventName.ShareBaseURLUpdated);
108
- }
109
- });
105
+ if (valueHasChanged) {
106
+ this.eventEmitter.emit(_FWEventName.FWEventName.ShareBaseURLUpdated);
107
+ }
108
+
109
+ _FireworkSDKModule.default.setShareBaseURL(value !== null && value !== void 0 ? value : '');
110
110
  }
111
111
 
112
112
  /**
@@ -118,16 +118,16 @@ class FireworkSDK {
118
118
  }
119
119
 
120
120
  set adBadgeConfiguration(value) {
121
- _FireworkSDKModule.default.setAdBadgeConfiguration(value !== null && value !== void 0 ? value : {}).then(() => {
122
- var _this$_adBadgeConfigu, _this$_adBadgeConfigu2, _this$_adBadgeConfigu3;
121
+ var _this$_adBadgeConfigu, _this$_adBadgeConfigu2, _this$_adBadgeConfigu3;
123
122
 
124
- const valueHasChanged = ((_this$_adBadgeConfigu = this._adBadgeConfiguration) === null || _this$_adBadgeConfigu === void 0 ? void 0 : _this$_adBadgeConfigu.badgeTextType) !== (value === null || value === void 0 ? void 0 : value.badgeTextType) || ((_this$_adBadgeConfigu2 = this._adBadgeConfiguration) === null || _this$_adBadgeConfigu2 === void 0 ? void 0 : _this$_adBadgeConfigu2.backgroundColor) !== (value === null || value === void 0 ? void 0 : value.backgroundColor) || ((_this$_adBadgeConfigu3 = this._adBadgeConfiguration) === null || _this$_adBadgeConfigu3 === void 0 ? void 0 : _this$_adBadgeConfigu3.textColor) !== (value === null || value === void 0 ? void 0 : value.textColor);
125
- this._adBadgeConfiguration = value;
123
+ const valueHasChanged = ((_this$_adBadgeConfigu = this._adBadgeConfiguration) === null || _this$_adBadgeConfigu === void 0 ? void 0 : _this$_adBadgeConfigu.badgeTextType) !== (value === null || value === void 0 ? void 0 : value.badgeTextType) || ((_this$_adBadgeConfigu2 = this._adBadgeConfiguration) === null || _this$_adBadgeConfigu2 === void 0 ? void 0 : _this$_adBadgeConfigu2.backgroundColor) !== (value === null || value === void 0 ? void 0 : value.backgroundColor) || ((_this$_adBadgeConfigu3 = this._adBadgeConfiguration) === null || _this$_adBadgeConfigu3 === void 0 ? void 0 : _this$_adBadgeConfigu3.textColor) !== (value === null || value === void 0 ? void 0 : value.textColor);
124
+ this._adBadgeConfiguration = value;
126
125
 
127
- if (valueHasChanged) {
128
- this.eventEmitter.emit(_FWEventName.FWEventName.AdBadgeConfigurationUpdated);
129
- }
130
- });
126
+ if (valueHasChanged) {
127
+ this.eventEmitter.emit(_FWEventName.FWEventName.AdBadgeConfigurationUpdated);
128
+ }
129
+
130
+ _FireworkSDKModule.default.setAdBadgeConfiguration(value !== null && value !== void 0 ? value : {});
131
131
  }
132
132
 
133
133
  /**
@@ -293,7 +293,7 @@ class FireworkSDK {
293
293
 
294
294
 
295
295
  openVideoPlayer(url, config) {
296
- _FireworkSDKModule.default.openVideoPlayer(url, config !== null && config !== void 0 ? config : {});
296
+ _FireworkSDKModule.default.openVideoPlayer(url, config);
297
297
  }
298
298
  /**
299
299
  * Records the user purchase. Only supported on iOS.
@@ -319,6 +319,11 @@ class FireworkSDK {
319
319
 
320
320
  if (result) {
321
321
  this.updateInternalAppLanguage(language);
322
+ const languageChanged = this._appLanguage !== language;
323
+
324
+ if (languageChanged && _reactNative.Platform.OS === 'ios') {
325
+ this.navigator.stopFloatingPlayer();
326
+ }
322
327
  }
323
328
 
324
329
  return result;
@@ -1 +1 @@
1
- {"version":3,"sources":["FireworkSDK.ts"],"names":["FireworkSDK","onCustomCTAClick","_onCustomCTAClick","value","FWLoggerUtil","log","FireworkSDKModule","setCustomCTAClickEnabled","customCTALinkContentPageRouteName","_customCTALinkContentPageRouteName","setCustomCTALinkContentPageRouteName","onVideoPlayback","_onVideoPlayback","setVideoPlaybackEventEnabled","shareBaseURL","_shareBaseURL","setShareBaseURL","then","valueHasChanged","eventEmitter","emit","FWEventName","ShareBaseURLUpdated","adBadgeConfiguration","_adBadgeConfiguration","setAdBadgeConfiguration","badgeTextType","backgroundColor","textColor","AdBadgeConfigurationUpdated","appComponentName","_appComponentName","setAppComponentName","appLanguage","_appLanguage","debugLogsEnabled","enabled","FireworkSDKModuleEventEmitter","shopping","_shopping","liveStream","_liveStream","navigator","_navigator","getInstance","_instance","constructor","VideoShopping","LiveStream","FWNavigator","addListener","SDKInit","event","error","onSDKInit","LogMessage","logNativeMessage","message","CustomCTAClick","url","VideoPlayback","eventName","VideoFeedClick","info","id","onVideoFeedClick","Platform","OS","NativeAppLanguageUpdated","language","updateInternalAppLanguage","init","userId","ShoppingModule","LiveStreamModule","openVideoPlayer","config","trackPurchase","parameters","changeAppLanguage","result","AppLanguageUpdated"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAEA;;AASA;;AAGA;;AACA;;AACA;;AACA;;;;;;;;;;AAOA;AACA;AACA;AACA,MAAMA,WAAN,CAAkB;AAGhB;AACF;AACA;;AAGE;AACF;AACA;;AAGE;AACF;AACA;AAC6B,MAAhBC,gBAAgB,GAAuC;AAChE,WAAO,KAAKC,iBAAZ;AACD;;AAC0B,MAAhBD,gBAAgB,CAACE,KAAD,EAA4C;AACrEC,0BAAaC,GAAb,CAAkB,iCAAgC,CAAC,CAACF,KAAM,EAA1D;;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ACA;AACA;AACA;;;AACSI,EAAAA,eAAe,CAAChB,GAAD,EAAciB,MAAd,EAAiD;AACrEtE,+BAAkBqE,eAAlB,CAAkChB,GAAlC,EAAuCiB,MAAvC,aAAuCA,MAAvC,cAAuCA,MAAvC,GAAiD,EAAjD;AACD;AAED;AACF;AACA;AACA;;;AACSC,EAAAA,aAAa,CAACC,UAAD,EAAsC;AACxD,QAAIZ,sBAASC,EAAT,KAAgB,KAApB,EAA2B;AACzB7D,iCAAkBuE,aAAlB,CAAgCC,UAAhC;AACD;AACF;AAED;AACF;AACA;AACA;AACA;AACA;;;AACgC,QAAjBC,iBAAiB,CAACV,QAAD,EAA6C;AACzE,UAAMW,MAAM,GAAG,MAAM1E,2BAAkByE,iBAAlB,CAAoCV,QAApC,CAArB;;AACA,QAAIW,MAAJ,EAAY;AACV,WAAKV,yBAAL,CAA+BD,QAA/B;AACD;;AACD,WAAOW,MAAP;AACD;;AAEOV,EAAAA,yBAAyB,CAACD,QAAD,EAA2B;AAC1D,UAAMnD,eAAe,GAAG,KAAKgB,YAAL,KAAsBmC,QAA9C;AACA,SAAKnC,YAAL,GAAoBmC,QAApB;;AACA,QAAInD,eAAJ,EAAqB;AACnB,WAAKC,YAAL,CAAkBC,IAAlB,CAAuBC,yBAAY4D,kBAAnC;AACD;AACF;;AAhRe;;gBAAZjF,W;;eAmRSA,W","sourcesContent":["import { NativeEventEmitter, Platform } from 'react-native';\n\nimport FWNavigator from './FWNavigator';\nimport LiveStream from './LiveStream';\nimport type AdBadgeConfiguration from './models/AdBadgeConfiguration';\nimport { FWEventName } from './models/FWEventName';\nimport type {\n CustomCTAClickEvent,\n SDKInitEvent,\n VideoFeedClickEvent,\n VideoPlaybackEvent,\n} from './models/FWEvents';\nimport type TrackPurchaseParameters from './models/TrackPurchaseParameters';\nimport type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport FireworkSDKModule, {\n FireworkSDKModuleEventEmitter,\n} from './modules/FireworkSDKModule';\nimport LiveStreamModule from './modules/LiveStreamModule';\nimport ShoppingModule from './modules/ShoppingModule';\nimport FWLoggerUtil from './utils/FWLoggerUtil';\nimport VideoShopping from './VideoShopping';\n\nexport type SDKInitCallback = (event: SDKInitEvent) => void;\nexport type CustomCTAClickCallback = (event: CustomCTAClickEvent) => void;\nexport type VideoPlaybackCallback = (event: VideoPlaybackEvent) => void;\nexport type VideoFeedClickCallback = (event: VideoFeedClickEvent) => void;\n\n/**\n * Entry class of Firework SDK, which supports the sdk initialization and global configuration.\n */\nclass FireworkSDK {\n private static _instance?: FireworkSDK;\n\n /**\n * The callback of SDK initialization.\n */\n public onSDKInit?: SDKInitCallback;\n\n /**\n * the callback of clicking Video Feed.\n */\n public onVideoFeedClick?: VideoFeedClickCallback;\n\n /**\n * The callback of clicking custom CTA.\n */\n public get onCustomCTAClick(): CustomCTAClickCallback | undefined {\n return this._onCustomCTAClick;\n }\n public set onCustomCTAClick(value: CustomCTAClickCallback | undefined) {\n FWLoggerUtil.log(`Set onCustomCTAClick callback ${!!value}`);\n this._onCustomCTAClick = value;\n FireworkSDKModule.setCustomCTAClickEnabled(value ? true : false);\n }\n private _onCustomCTAClick: CustomCTAClickCallback | undefined;\n\n /**\n * The custom CTA link content page route name.\n *\n * @deprecated The get accessor will be deprecated since RN SDK V2.0.\n */\n public get customCTALinkContentPageRouteName(): string | undefined {\n return this._customCTALinkContentPageRouteName;\n }\n /**\n * @deprecated The set accessor will be deprecated since RN SDK V2.0.\n */\n public set customCTALinkContentPageRouteName(value: string | undefined) {\n this._customCTALinkContentPageRouteName = value;\n FireworkSDKModule.setCustomCTALinkContentPageRouteName(value ?? '');\n }\n private _customCTALinkContentPageRouteName: string | undefined;\n\n /**\n * The callback of video playback.\n */\n public get onVideoPlayback(): VideoPlaybackCallback | undefined {\n return this._onVideoPlayback;\n }\n public set onVideoPlayback(value: VideoPlaybackCallback | undefined) {\n this._onVideoPlayback = value;\n FireworkSDKModule.setVideoPlaybackEventEnabled(value ? true : false);\n }\n private _onVideoPlayback?: VideoPlaybackCallback | undefined;\n\n /**\n * The share base URL of videos.\n * The set accessor is async.\n */\n public get shareBaseURL(): string | undefined {\n return this._shareBaseURL;\n }\n public set shareBaseURL(value: string | undefined) {\n FireworkSDKModule.setShareBaseURL(value ?? '').then(() => {\n const valueHasChanged = this._shareBaseURL !== value;\n this._shareBaseURL = value;\n if (valueHasChanged) {\n this.eventEmitter.emit(FWEventName.ShareBaseURLUpdated);\n }\n });\n }\n private _shareBaseURL: string | undefined;\n\n /**\n * The configuration for ad badges.\n * The set accessor is async.\n */\n public get adBadgeConfiguration(): AdBadgeConfiguration | undefined {\n return this._adBadgeConfiguration;\n }\n public set adBadgeConfiguration(value: AdBadgeConfiguration | undefined) {\n FireworkSDKModule.setAdBadgeConfiguration(value ?? {}).then(() => {\n const valueHasChanged =\n this._adBadgeConfiguration?.badgeTextType !== value?.badgeTextType ||\n this._adBadgeConfiguration?.backgroundColor !==\n value?.backgroundColor ||\n this._adBadgeConfiguration?.textColor !== value?.textColor;\n this._adBadgeConfiguration = value;\n if (valueHasChanged) {\n this.eventEmitter.emit(FWEventName.AdBadgeConfigurationUpdated);\n }\n });\n }\n private _adBadgeConfiguration: AdBadgeConfiguration | undefined;\n\n /**\n * The app component name.\n *\n * @deprecated The get accessor will be deprecated since RN SDK V2.0.\n */\n public get appComponentName(): string | undefined {\n return this._appComponentName;\n }\n /**\n * @deprecated The set accessor will be deprecated since RN SDK V2.0.\n */\n public set appComponentName(value: string | undefined) {\n this._appComponentName = value;\n FireworkSDKModule.setAppComponentName(value ?? '');\n }\n private _appComponentName: string | undefined;\n\n public get appLanguage(): string | undefined | null {\n return this._appLanguage;\n }\n private _appLanguage: string | undefined | null;\n\n /**\n * Defaults to false. You can enable debug logs by setting this property to true.\n */\n public get debugLogsEnabled(): boolean {\n return FWLoggerUtil.enabled;\n }\n public set debugLogsEnabled(value: boolean) {\n FWLoggerUtil.enabled = value;\n }\n\n private get eventEmitter(): NativeEventEmitter {\n return FireworkSDKModuleEventEmitter;\n }\n\n /**\n * Get VideoShopping object.\n */\n public get shopping(): VideoShopping {\n return this._shopping;\n }\n private _shopping: VideoShopping = VideoShopping.getInstance();\n\n /**\n * Get LiveStream object.\n */\n public get liveStream(): LiveStream {\n return this._liveStream;\n }\n private _liveStream: LiveStream = LiveStream.getInstance();\n\n /**\n * Get FWNavigator object.\n */\n public get navigator(): FWNavigator {\n return this._navigator;\n }\n private _navigator: FWNavigator = FWNavigator.getInstance();\n\n /**\n * Get global single instance of FireworkSDK class.\n * @returns FireworkSDK\n */\n public static getInstance() {\n if (!FireworkSDK._instance) {\n FireworkSDK._instance = new FireworkSDK();\n }\n\n return FireworkSDK._instance!;\n }\n\n private constructor() {\n FWLoggerUtil.log('FireworkSDK constructor');\n this.eventEmitter.addListener(FWEventName.SDKInit, (event) => {\n FWLoggerUtil.log(`Receive SDKInit event ${event?.error}`);\n\n if (this.onSDKInit) {\n this.onSDKInit(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.LogMessage, (event) => {\n FWLoggerUtil.logNativeMessage(event.message);\n });\n\n this.eventEmitter.addListener(FWEventName.CustomCTAClick, (event) => {\n FWLoggerUtil.log(`Receive CustomCTAClick url: ${event?.url}`);\n\n if (this.onCustomCTAClick) {\n this.onCustomCTAClick(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.VideoPlayback, (event) => {\n FWLoggerUtil.log(\n `Receive VideoPlayback event eventName: ${event?.eventName}`\n );\n\n if (this.onVideoPlayback) {\n this.onVideoPlayback(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.VideoFeedClick, (event) => {\n FWLoggerUtil.log(`Receive VideoFeedClick event id: ${event?.info.id}`);\n\n if (this.onVideoFeedClick) {\n this.onVideoFeedClick(event ?? {});\n }\n });\n\n if (Platform.OS === 'ios') {\n this.eventEmitter.addListener(\n FWEventName.NativeAppLanguageUpdated,\n (event) => {\n FWLoggerUtil.log(\n `Receive NativeAppLanguageUpdated event appLanguage: ${event.appLanguage}`\n );\n const language = event.appLanguage;\n this.updateInternalAppLanguage(language);\n }\n );\n }\n }\n\n /**\n * Initializes Firework SDK.\n * @param {string?} userId An id to uniquely identify device or user.\n */\n public init(userId?: string) {\n FWLoggerUtil.log('Call FireworkSDK init method');\n\n FireworkSDKModule.init(userId);\n ShoppingModule.init();\n LiveStreamModule.init();\n }\n\n /**\n * Open Video URL.\n * @param {string} url\n * @param {VideoPlayerConfiguration} config\n */\n public openVideoPlayer(url: string, config?: VideoPlayerConfiguration) {\n FireworkSDKModule.openVideoPlayer(url, config ?? {});\n }\n\n /**\n * Records the user purchase. Only supported on iOS.\n * @param {TrackPurchaseParameters} parameters\n */\n public trackPurchase(parameters: TrackPurchaseParameters) {\n if (Platform.OS === 'ios') {\n FireworkSDKModule.trackPurchase(parameters);\n }\n }\n\n /**\n * Change App level language.\n * @param {string | undefined | null} language Such as en, ar and en-US\n * If language is null or undefined or empty string, we will use system language.\n * @returns\n */\n public async changeAppLanguage(language?: string | null): Promise<boolean> {\n const result = await FireworkSDKModule.changeAppLanguage(language);\n if (result) {\n this.updateInternalAppLanguage(language);\n }\n return result;\n }\n\n private updateInternalAppLanguage(language?: string | null) {\n const valueHasChanged = this._appLanguage !== language;\n this._appLanguage = language;\n if (valueHasChanged) {\n this.eventEmitter.emit(FWEventName.AppLanguageUpdated);\n }\n }\n}\n\nexport default FireworkSDK;\n"]}
1
+ {"version":3,"sources":["FireworkSDK.ts"],"names":["FireworkSDK","onCustomCTAClick","_onCustomCTAClick","value","FWLoggerUtil","log","FireworkSDKModule","setCustomCTAClickEnabled","customCTALinkContentPageRouteName","_customCTALinkContentPageRouteName","setCustomCTALinkContentPageRouteName","onVideoPlayback","_onVideoPlayback","setVideoPlaybackEventEnabled","shareBaseURL","_shareBaseURL","valueHasChanged","eventEmitter","emit","FWEventName","ShareBaseURLUpdated","setShareBaseURL","adBadgeConfiguration","_adBadgeConfiguration","badgeTextType","backgroundColor","textColor","AdBadgeConfigurationUpdated","setAdBadgeConfiguration","appComponentName","_appComponentName","setAppComponentName","appLanguage","_appLanguage","debugLogsEnabled","enabled","FireworkSDKModuleEventEmitter","shopping","_shopping","liveStream","_liveStream","navigator","_navigator","getInstance","_instance","constructor","VideoShopping","LiveStream","FWNavigator","addListener","SDKInit","event","error","onSDKInit","LogMessage","logNativeMessage","message","CustomCTAClick","url","VideoPlayback","eventName","VideoFeedClick","info","id","onVideoFeedClick","Platform","OS","NativeAppLanguageUpdated","language","updateInternalAppLanguage","init","userId","ShoppingModule","LiveStreamModule","openVideoPlayer","config","trackPurchase","parameters","changeAppLanguage","result","languageChanged","stopFloatingPlayer","AppLanguageUpdated"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAEA;;AASA;;AAGA;;AACA;;AACA;;AACA;;;;;;;;;;AAOA;AACA;AACA;AACA,MAAMA,WAAN,CAAkB;AAGhB;AACF;AACA;;AAGE;AACF;AACA;;AAGE;AACF;AACA;AAC6B,MAAhBC,gBAAgB,GAAuC;AAChE,WAAO,KAAKC,iBAAZ;AACD;;AAC0B,MAAhBD,gBAAgB,CAACE,KAAD,EAA4C;AACrEC,0BAAaC,GAAb,CAAkB,iCAAgC,CAAC,CAACF,KAAM,EAA1D;;AACA,SAAKD,iBAAL,GAAyBC,KAAzB;;AACAG,+BAAkBC,wBAAlB,CAA2CJ,KAAK,GAAG,IAAH,GAAU,KAA1D;AACD;;AAGD;AACF;AACA;AACA;AACA;AAC8C,MAAjCK,iCAAiC,GAAuB;AACjE,WAAO,KAAKC,kCAAZ;AACD;AACD;AACF;AACA;;;AAC8C,MAAjCD,iCAAiC,CAACL,KAAD,EAA4B;AACtE,SAAKM,kCAAL,GAA0CN,KAA1C;;AACAG,+BAAkBI,oCAAlB,CAAuDP,KAAvD,aAAuDA,KAAvD,cAAuDA,KAAvD,GAAgE,EAAhE;AACD;;AAGD;AACF;AACA;AAC4B,MAAfQ,eAAe,GAAsC;AAC9D,WAAO,KAAKC,gBAAZ;AACD;;AACyB,MAA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L,KAAsBmC,QAA9C;;AACA,UAAIY,eAAe,IAAIf,sBAASC,EAAT,KAAgB,KAAvC,EAA8C;AAC5C,aAAKzB,SAAL,CAAewC,kBAAf;AACD;AACF;;AACD,WAAOF,MAAP;AACD;;AAEOV,EAAAA,yBAAyB,CAACD,QAAD,EAA2B;AAC1D,UAAMpD,eAAe,GAAG,KAAKiB,YAAL,KAAsBmC,QAA9C;AACA,SAAKnC,YAAL,GAAoBmC,QAApB;;AACA,QAAIpD,eAAJ,EAAqB;AACnB,WAAKC,YAAL,CAAkBC,IAAlB,CAAuBC,yBAAY+D,kBAAnC;AACD;AACF;;AAjRe;;gBAAZlF,W;;eAoRSA,W","sourcesContent":["import { NativeEventEmitter, Platform } from 'react-native';\n\nimport FWNavigator from './FWNavigator';\nimport LiveStream from './LiveStream';\nimport type AdBadgeConfiguration from './models/AdBadgeConfiguration';\nimport { FWEventName } from './models/FWEventName';\nimport type {\n CustomCTAClickEvent,\n SDKInitEvent,\n VideoFeedClickEvent,\n VideoPlaybackEvent,\n} from './models/FWEvents';\nimport type TrackPurchaseParameters from './models/TrackPurchaseParameters';\nimport type VideoPlayerConfiguration from './models/VideoPlayerConfiguration';\nimport FireworkSDKModule, {\n FireworkSDKModuleEventEmitter,\n} from './modules/FireworkSDKModule';\nimport LiveStreamModule from './modules/LiveStreamModule';\nimport ShoppingModule from './modules/ShoppingModule';\nimport FWLoggerUtil from './utils/FWLoggerUtil';\nimport VideoShopping from './VideoShopping';\n\nexport type SDKInitCallback = (event: SDKInitEvent) => void;\nexport type CustomCTAClickCallback = (event: CustomCTAClickEvent) => void;\nexport type VideoPlaybackCallback = (event: VideoPlaybackEvent) => void;\nexport type VideoFeedClickCallback = (event: VideoFeedClickEvent) => void;\n\n/**\n * Entry class of Firework SDK, which supports the sdk initialization and global configuration.\n */\nclass FireworkSDK {\n private static _instance?: FireworkSDK;\n\n /**\n * The callback of SDK initialization.\n */\n public onSDKInit?: SDKInitCallback;\n\n /**\n * the callback of clicking Video Feed.\n */\n public onVideoFeedClick?: VideoFeedClickCallback;\n\n /**\n * The callback of clicking custom CTA.\n */\n public get onCustomCTAClick(): CustomCTAClickCallback | undefined {\n return this._onCustomCTAClick;\n }\n public set onCustomCTAClick(value: CustomCTAClickCallback | undefined) {\n FWLoggerUtil.log(`Set onCustomCTAClick callback ${!!value}`);\n this._onCustomCTAClick = value;\n FireworkSDKModule.setCustomCTAClickEnabled(value ? true : false);\n }\n private _onCustomCTAClick: CustomCTAClickCallback | undefined;\n\n /**\n * The custom CTA link content page route name.\n *\n * @deprecated The get accessor will be deprecated since RN SDK V2.0.\n */\n public get customCTALinkContentPageRouteName(): string | undefined {\n return this._customCTALinkContentPageRouteName;\n }\n /**\n * @deprecated The set accessor will be deprecated since RN SDK V2.0.\n */\n public set customCTALinkContentPageRouteName(value: string | undefined) {\n this._customCTALinkContentPageRouteName = value;\n FireworkSDKModule.setCustomCTALinkContentPageRouteName(value ?? '');\n }\n private _customCTALinkContentPageRouteName: string | undefined;\n\n /**\n * The callback of video playback.\n */\n public get onVideoPlayback(): VideoPlaybackCallback | undefined {\n return this._onVideoPlayback;\n }\n public set onVideoPlayback(value: VideoPlaybackCallback | undefined) {\n this._onVideoPlayback = value;\n FireworkSDKModule.setVideoPlaybackEventEnabled(value ? true : false);\n }\n private _onVideoPlayback?: VideoPlaybackCallback | undefined;\n\n /**\n * The share base URL of videos.\n * The set accessor is async.\n */\n public get shareBaseURL(): string | undefined {\n return this._shareBaseURL;\n }\n public set shareBaseURL(value: string | undefined) {\n const valueHasChanged = this._shareBaseURL !== value;\n this._shareBaseURL = value;\n if (valueHasChanged) {\n this.eventEmitter.emit(FWEventName.ShareBaseURLUpdated);\n }\n FireworkSDKModule.setShareBaseURL(value ?? '');\n }\n private _shareBaseURL: string | undefined;\n\n /**\n * The configuration for ad badges.\n * The set accessor is async.\n */\n public get adBadgeConfiguration(): AdBadgeConfiguration | undefined {\n return this._adBadgeConfiguration;\n }\n public set adBadgeConfiguration(value: AdBadgeConfiguration | undefined) {\n const valueHasChanged =\n this._adBadgeConfiguration?.badgeTextType !== value?.badgeTextType ||\n this._adBadgeConfiguration?.backgroundColor !== value?.backgroundColor ||\n this._adBadgeConfiguration?.textColor !== value?.textColor;\n this._adBadgeConfiguration = value;\n if (valueHasChanged) {\n this.eventEmitter.emit(FWEventName.AdBadgeConfigurationUpdated);\n }\n FireworkSDKModule.setAdBadgeConfiguration(value ?? {});\n }\n private _adBadgeConfiguration: AdBadgeConfiguration | undefined;\n\n /**\n * The app component name.\n *\n * @deprecated The get accessor will be deprecated since RN SDK V2.0.\n */\n public get appComponentName(): string | undefined {\n return this._appComponentName;\n }\n /**\n * @deprecated The set accessor will be deprecated since RN SDK V2.0.\n */\n public set appComponentName(value: string | undefined) {\n this._appComponentName = value;\n FireworkSDKModule.setAppComponentName(value ?? '');\n }\n private _appComponentName: string | undefined;\n\n public get appLanguage(): string | undefined | null {\n return this._appLanguage;\n }\n private _appLanguage: string | undefined | null;\n\n /**\n * Defaults to false. You can enable debug logs by setting this property to true.\n */\n public get debugLogsEnabled(): boolean {\n return FWLoggerUtil.enabled;\n }\n public set debugLogsEnabled(value: boolean) {\n FWLoggerUtil.enabled = value;\n }\n\n private get eventEmitter(): NativeEventEmitter {\n return FireworkSDKModuleEventEmitter;\n }\n\n /**\n * Get VideoShopping object.\n */\n public get shopping(): VideoShopping {\n return this._shopping;\n }\n private _shopping: VideoShopping = VideoShopping.getInstance();\n\n /**\n * Get LiveStream object.\n */\n public get liveStream(): LiveStream {\n return this._liveStream;\n }\n private _liveStream: LiveStream = LiveStream.getInstance();\n\n /**\n * Get FWNavigator object.\n */\n public get navigator(): FWNavigator {\n return this._navigator;\n }\n private _navigator: FWNavigator = FWNavigator.getInstance();\n\n /**\n * Get global single instance of FireworkSDK class.\n * @returns FireworkSDK\n */\n public static getInstance() {\n if (!FireworkSDK._instance) {\n FireworkSDK._instance = new FireworkSDK();\n }\n\n return FireworkSDK._instance!;\n }\n\n private constructor() {\n FWLoggerUtil.log('FireworkSDK constructor');\n this.eventEmitter.addListener(FWEventName.SDKInit, (event) => {\n FWLoggerUtil.log(`Receive SDKInit event ${event?.error}`);\n\n if (this.onSDKInit) {\n this.onSDKInit(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.LogMessage, (event) => {\n FWLoggerUtil.logNativeMessage(event.message);\n });\n\n this.eventEmitter.addListener(FWEventName.CustomCTAClick, (event) => {\n FWLoggerUtil.log(`Receive CustomCTAClick url: ${event?.url}`);\n\n if (this.onCustomCTAClick) {\n this.onCustomCTAClick(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.VideoPlayback, (event) => {\n FWLoggerUtil.log(\n `Receive VideoPlayback event eventName: ${event?.eventName}`\n );\n\n if (this.onVideoPlayback) {\n this.onVideoPlayback(event ?? {});\n }\n });\n\n this.eventEmitter.addListener(FWEventName.VideoFeedClick, (event) => {\n FWLoggerUtil.log(`Receive VideoFeedClick event id: ${event?.info.id}`);\n\n if (this.onVideoFeedClick) {\n this.onVideoFeedClick(event ?? {});\n }\n });\n\n if (Platform.OS === 'ios') {\n this.eventEmitter.addListener(\n FWEventName.NativeAppLanguageUpdated,\n (event) => {\n FWLoggerUtil.log(\n `Receive NativeAppLanguageUpdated event appLanguage: ${event.appLanguage}`\n );\n const language = event.appLanguage;\n this.updateInternalAppLanguage(language);\n }\n );\n }\n }\n\n /**\n * Initializes Firework SDK.\n * @param {string?} userId An id to uniquely identify device or user.\n */\n public init(userId?: string) {\n FWLoggerUtil.log('Call FireworkSDK init method');\n\n FireworkSDKModule.init(userId);\n ShoppingModule.init();\n LiveStreamModule.init();\n }\n\n /**\n * Open Video URL.\n * @param {string} url\n * @param {VideoPlayerConfiguration} config\n */\n public openVideoPlayer(url: string, config?: VideoPlayerConfiguration) {\n FireworkSDKModule.openVideoPlayer(url, config);\n }\n\n /**\n * Records the user purchase. Only supported on iOS.\n * @param {TrackPurchaseParameters} parameters\n */\n public trackPurchase(parameters: TrackPurchaseParameters) {\n if (Platform.OS === 'ios') {\n FireworkSDKModule.trackPurchase(parameters);\n }\n }\n\n /**\n * Change App level language.\n * @param {string | undefined | null} language Such as en, ar and en-US\n * If language is null or undefined or empty string, we will use system language.\n * @returns\n */\n public async changeAppLanguage(language?: string | null): Promise<boolean> {\n const result = await FireworkSDKModule.changeAppLanguage(language);\n if (result) {\n this.updateInternalAppLanguage(language);\n const languageChanged = this._appLanguage !== language;\n if (languageChanged && Platform.OS === 'ios') {\n this.navigator.stopFloatingPlayer();\n }\n }\n return result;\n }\n\n private updateInternalAppLanguage(language?: string | null) {\n const valueHasChanged = this._appLanguage !== language;\n this._appLanguage = language;\n if (valueHasChanged) {\n this.eventEmitter.emit(FWEventName.AppLanguageUpdated);\n }\n }\n}\n\nexport default FireworkSDK;\n"]}
@@ -73,14 +73,6 @@ const StoryBlock = (props, forwardedRef) => {
73
73
  forceUpdate();
74
74
  });
75
75
 
76
- if (_reactNative.Platform.OS === 'android') {
77
- const viewId = (0, _reactNative.findNodeHandle)(nativeComponentRef.current);
78
-
79
- _FWLoggerUtil.default.log(`StoryBlock createFragment viewId: ${viewId}`);
80
-
81
- _reactNative.UIManager.dispatchViewManagerCommand(viewId, _reactNative.UIManager.getViewManagerConfig(NativeComponentName).Commands.create.toString(), [viewId]);
82
- }
83
-
84
76
  return () => {
85
77
  subscriptionOfShareBaseURLUpdated.remove();
86
78
  subscriptionOfAdBadgeConfigurationUpdated.remove();
@@ -171,8 +163,14 @@ const StoryBlock = (props, forwardedRef) => {
171
163
  };
172
164
 
173
165
  const generateKey = () => {
174
- var _FireworkSDK$getInsta, _FireworkSDK$getInsta2, _adBadgeConfiguration, _adBadgeConfiguration2, _adBadgeConfiguration3, _FireworkSDK$getInsta3, _adConfiguration$requ, _adConfiguration$adsF;
166
+ var _FireworkSDK$getInsta, _FireworkSDK$getInsta2, _FireworkSDK$getInsta3, _adBadgeConfiguration, _adBadgeConfiguration2, _adBadgeConfiguration3, _adConfiguration$requ, _adConfiguration$adsF;
175
167
 
168
+ const shareBaseURL = (_FireworkSDK$getInsta = _FireworkSDK.default.getInstance().shareBaseURL) !== null && _FireworkSDK$getInsta !== void 0 ? _FireworkSDK$getInsta : '';
169
+ const appLanguage = (_FireworkSDK$getInsta2 = _FireworkSDK.default.getInstance().appLanguage) !== null && _FireworkSDK$getInsta2 !== void 0 ? _FireworkSDK$getInsta2 : '';
170
+ const adBadgeConfiguration = (_FireworkSDK$getInsta3 = _FireworkSDK.default.getInstance().adBadgeConfiguration) !== null && _FireworkSDK$getInsta3 !== void 0 ? _FireworkSDK$getInsta3 : {};
171
+ const adBadgeTextType = (_adBadgeConfiguration = adBadgeConfiguration.badgeTextType) !== null && _adBadgeConfiguration !== void 0 ? _adBadgeConfiguration : '';
172
+ const backgroundColorOfAdBadge = (_adBadgeConfiguration2 = adBadgeConfiguration.backgroundColor) !== null && _adBadgeConfiguration2 !== void 0 ? _adBadgeConfiguration2 : '';
173
+ const textColorOfAdBadge = (_adBadgeConfiguration3 = adBadgeConfiguration.textColor) !== null && _adBadgeConfiguration3 !== void 0 ? _adBadgeConfiguration3 : '';
176
174
  const {
177
175
  source,
178
176
  channel = '',
@@ -181,39 +179,49 @@ const StoryBlock = (props, forwardedRef) => {
181
179
  adConfiguration,
182
180
  hashtagFilterExpression = ''
183
181
  } = props;
184
- const shareBaseURL = (_FireworkSDK$getInsta = _FireworkSDK.default.getInstance().shareBaseURL) !== null && _FireworkSDK$getInsta !== void 0 ? _FireworkSDK$getInsta : '';
185
- const adBadgeConfiguration = (_FireworkSDK$getInsta2 = _FireworkSDK.default.getInstance().adBadgeConfiguration) !== null && _FireworkSDK$getInsta2 !== void 0 ? _FireworkSDK$getInsta2 : {};
186
- const adBadgeTextType = (_adBadgeConfiguration = adBadgeConfiguration.badgeTextType) !== null && _adBadgeConfiguration !== void 0 ? _adBadgeConfiguration : '';
187
- const backgroundColorOfAdBadge = (_adBadgeConfiguration2 = adBadgeConfiguration.backgroundColor) !== null && _adBadgeConfiguration2 !== void 0 ? _adBadgeConfiguration2 : '';
188
- const textColorOfAdBadge = (_adBadgeConfiguration3 = adBadgeConfiguration.textColor) !== null && _adBadgeConfiguration3 !== void 0 ? _adBadgeConfiguration3 : '';
189
182
  const dynamicContentParametersString = generateDynamicContentParametersString();
190
- const appLanguage = (_FireworkSDK$getInsta3 = _FireworkSDK.default.getInstance().appLanguage) !== null && _FireworkSDK$getInsta3 !== void 0 ? _FireworkSDK$getInsta3 : '';
191
183
  const requiresAds = (_adConfiguration$requ = adConfiguration === null || adConfiguration === void 0 ? void 0 : adConfiguration.requiresAds) !== null && _adConfiguration$requ !== void 0 ? _adConfiguration$requ : false;
192
184
  const adsFetchTimeout = (_adConfiguration$adsF = adConfiguration === null || adConfiguration === void 0 ? void 0 : adConfiguration.adsFetchTimeout) !== null && _adConfiguration$adsF !== void 0 ? _adConfiguration$adsF : 10;
193
185
  const vastAttributesString = generateVastAttributesString();
194
- let key = `source:${source}`;
195
- key += `_channel:${channel}`;
196
- key += `_playlist:${playlist}`;
197
- key += `_shareBaseURL:${shareBaseURL}`;
186
+ let key = `shareBaseURL:${shareBaseURL}`;
187
+
188
+ if (_reactNative.Platform.OS === 'ios') {
189
+ key += `_appLanguage:${appLanguage}`;
190
+ }
191
+
198
192
  key += `_adBadgeTextType:${adBadgeTextType}`;
199
193
  key += `_backgroundColorOfAdBadge:${backgroundColorOfAdBadge}`;
200
194
  key += `_textColorOfAdBadge:${textColorOfAdBadge}`;
195
+ key += `source:${source}`;
196
+ key += `_channel:${channel}`;
197
+ key += `_playlist:${playlist}`;
201
198
  key += `_dynamicContentParameters:${dynamicContentParametersString}`;
199
+ key += `_hashtagFilterExpression:${hashtagFilterExpression}`;
202
200
  key += `_enablePictureInPicture:${enablePictureInPicture}`;
203
- key += `_appLanguage:${appLanguage}`;
204
201
  key += `_requiresAds:${requiresAds}`;
205
202
  key += `_adsFetchTimeout:${adsFetchTimeout}`;
206
203
  key += `_vastAttributes:${vastAttributesString}`;
207
- key += `_hashtagFilterExpression:${hashtagFilterExpression}`;
208
204
  return key;
209
205
  };
210
206
 
207
+ const key = generateKey();
208
+ (0, _react.useEffect)(() => {
209
+ if (_reactNative.Platform.OS === 'android') {
210
+ setTimeout(() => {
211
+ const viewId = (0, _reactNative.findNodeHandle)(nativeComponentRef.current);
212
+
213
+ _FWLoggerUtil.default.log(`StoryBlock createFragment viewId: ${viewId}`);
214
+
215
+ _reactNative.UIManager.dispatchViewManagerCommand(viewId, _reactNative.UIManager.getViewManagerConfig(NativeComponentName).Commands.create.toString(), [viewId]);
216
+ }, 500);
217
+ }
218
+ }, [key]);
211
219
  const {
212
220
  style
213
221
  } = props;
214
222
  return /*#__PURE__*/_react.default.createElement(_FWStoryBlock.default, _extends({
215
223
  ref: nativeComponentRef,
216
- key: generateKey()
224
+ key: key
217
225
  }, props, {
218
226
  onStoryBlockLoadFinished: handleStoryBlockLoadFinished,
219
227
  style: Object.assign({}, style, {