react-native-firework-sdk 2.10.1 → 2.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 (158) hide show
  1. package/android/gradle.properties +1 -1
  2. package/android/src/main/java/com/fireworksdk/bridge/components/storyblock/StoryBlockFragment.kt +18 -1
  3. package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +4 -0
  4. package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModel.kt +0 -1
  5. package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModelDeserializer.kt +0 -3
  6. package/android/src/main/java/com/fireworksdk/bridge/models/FWSDKInitOptionsModelSerializer.kt +0 -2
  7. package/android/src/main/java/com/fireworksdk/bridge/models/FWSdkInitResultModel.kt +6 -0
  8. package/android/src/main/java/com/fireworksdk/bridge/models/FWTrackPurchaseModel.kt +9 -0
  9. package/android/src/main/java/com/fireworksdk/bridge/models/FWTrackPurchaseModelDeserializer.kt +45 -0
  10. package/android/src/main/java/com/fireworksdk/bridge/models/FWTrackPurchaseModelSerializer.kt +34 -0
  11. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedItemDetailsModel.kt +1 -0
  12. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlaybackDetails.kt +1 -0
  13. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +2 -1
  14. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelDeserializer.kt +4 -1
  15. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModelSerializer.kt +2 -0
  16. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerLogoConfigurationModel.kt +8 -0
  17. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerLogoConfigurationModelDeserializer.kt +23 -0
  18. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerLogoConfigurationModelSerializer.kt +18 -0
  19. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWEventName.kt +2 -0
  20. package/android/src/main/java/com/fireworksdk/bridge/models/enums/FWVideoPlayerLogoOption.kt +19 -0
  21. package/android/src/main/java/com/fireworksdk/bridge/reactnative/FWReactNativeSDK.kt +103 -0
  22. package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +12 -0
  23. package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +8 -0
  24. package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FireworkSDKInterface.kt +2 -0
  25. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +22 -9
  26. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +74 -122
  27. package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +34 -9
  28. package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +13 -0
  29. package/android/src/main/java/com/fireworksdk/bridge/utils/FWFragmentUtil.kt +3 -3
  30. package/android/src/main/java/com/fireworksdk/bridge/utils/FWGlobalDataUtil.kt +5 -2
  31. package/android/src/main/java/com/fireworksdk/bridge/utils/FWModelUtils.kt +64 -0
  32. package/ios/Components/ReplayBadgeConfiguration.swift +12 -0
  33. package/ios/Components/StoryBlock.swift +31 -0
  34. package/ios/Components/StoryBlockConfiguration.swift +1 -0
  35. package/ios/Components/StoryBlockManager.m +24 -0
  36. package/ios/Components/StoryBlockManager.swift +6 -3
  37. package/ios/Components/VideoFeed.swift +18 -3
  38. package/ios/Components/VideoFeedConfiguration.swift +1 -0
  39. package/ios/Components/VideoFeedManager.m +4 -1
  40. package/ios/Components/VideoFeedManager.swift +6 -3
  41. package/ios/Components/VideoPlayerConfiguration.swift +1 -0
  42. package/ios/FWReactNativeSDK.swift +14 -0
  43. package/ios/FireworkSdk.xcodeproj/project.pbxproj +4 -0
  44. package/ios/Modules/FireworkSDKModule/FireworkSDKModule+CTA.swift +17 -15
  45. package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +1 -11
  46. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +1 -0
  47. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +80 -81
  48. package/ios/Modules/FireworkSDKModule/SDKInitOptions.swift +9 -5
  49. package/ios/Modules/Shopping/ShoppingModule.swift +10 -74
  50. package/lib/commonjs/FireworkSDK.js +30 -25
  51. package/lib/commonjs/FireworkSDK.js.map +1 -1
  52. package/lib/commonjs/VideoShopping.js +6 -12
  53. package/lib/commonjs/VideoShopping.js.map +1 -1
  54. package/lib/commonjs/components/StoryBlock.js +54 -3
  55. package/lib/commonjs/components/StoryBlock.js.map +1 -1
  56. package/lib/commonjs/components/VideoFeed.js +46 -4
  57. package/lib/commonjs/components/VideoFeed.js.map +1 -1
  58. package/lib/commonjs/index.js.map +1 -1
  59. package/lib/commonjs/models/FWNativeErrorAction.js +14 -0
  60. package/lib/commonjs/models/FWNativeErrorAction.js.map +1 -0
  61. package/lib/commonjs/models/ReplayBadgeConfiguration.js +2 -0
  62. package/lib/commonjs/models/ReplayBadgeConfiguration.js.map +1 -0
  63. package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
  64. package/lib/module/FireworkSDK.js +29 -25
  65. package/lib/module/FireworkSDK.js.map +1 -1
  66. package/lib/module/VideoShopping.js +6 -12
  67. package/lib/module/VideoShopping.js.map +1 -1
  68. package/lib/module/components/StoryBlock.js +53 -3
  69. package/lib/module/components/StoryBlock.js.map +1 -1
  70. package/lib/module/components/VideoFeed.js +42 -4
  71. package/lib/module/components/VideoFeed.js.map +1 -1
  72. package/lib/module/index.js.map +1 -1
  73. package/lib/module/models/FWNativeErrorAction.js +7 -0
  74. package/lib/module/models/FWNativeErrorAction.js.map +1 -0
  75. package/lib/module/models/ReplayBadgeConfiguration.js +2 -0
  76. package/lib/module/models/ReplayBadgeConfiguration.js.map +1 -0
  77. package/lib/module/modules/FireworkSDKModule.js.map +1 -1
  78. package/lib/typescript/VideoShopping.d.ts +2 -2
  79. package/lib/typescript/components/StoryBlock.d.ts +18 -1
  80. package/lib/typescript/components/VideoFeed.d.ts +7 -1
  81. package/lib/typescript/index.d.ts +2 -2
  82. package/lib/typescript/models/FWEvents.d.ts +26 -3
  83. package/lib/typescript/models/FWNativeErrorAction.d.ts +4 -0
  84. package/lib/typescript/models/FeedItemDetails.d.ts +6 -1
  85. package/lib/typescript/models/ReplayBadgeConfiguration.d.ts +7 -0
  86. package/lib/typescript/models/StoryBlockConfiguration.d.ts +6 -1
  87. package/lib/typescript/models/VideoFeedConfiguration.d.ts +6 -0
  88. package/lib/typescript/models/VideoPlayerConfiguration.d.ts +6 -1
  89. package/lib/typescript/modules/FireworkSDKModule.d.ts +1 -0
  90. package/package.json +1 -5
  91. package/react-native-firework-sdk.podspec +3 -5
  92. package/src/FireworkSDK.ts +27 -24
  93. package/src/VideoShopping.ts +9 -11
  94. package/src/components/StoryBlock.tsx +69 -7
  95. package/src/components/VideoFeed.tsx +57 -12
  96. package/src/index.ts +2 -0
  97. package/src/models/FWEvents.ts +28 -3
  98. package/src/models/FWNativeErrorAction.ts +4 -0
  99. package/src/models/FeedItemDetails.ts +7 -1
  100. package/src/models/ReplayBadgeConfiguration.ts +7 -0
  101. package/src/models/StoryBlockConfiguration.ts +6 -1
  102. package/src/models/VideoFeedConfiguration.ts +6 -0
  103. package/src/models/VideoPlayerConfiguration.ts +6 -1
  104. package/src/modules/FireworkSDKModule.ts +1 -0
  105. package/FireworkVideoUI.xcframework/Info.plist +0 -40
  106. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  107. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Headers/FireworkVideoUI-Swift.h +0 -280
  108. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Headers/FireworkVideoUI.h +0 -18
  109. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Info.plist +0 -0
  110. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.abi.json +0 -1313
  111. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.private.swiftinterface +0 -42
  112. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  113. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios.swiftinterface +0 -42
  114. package/FireworkVideoUI.xcframework/ios-arm64/FireworkVideoUI.framework/Modules/module.modulemap +0 -11
  115. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  116. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Headers/FireworkVideoUI-Swift.h +0 -556
  117. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Headers/FireworkVideoUI.h +0 -18
  118. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Info.plist +0 -0
  119. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.abi.json +0 -1313
  120. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +0 -42
  121. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  122. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +0 -42
  123. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json +0 -1313
  124. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +0 -42
  125. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  126. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +0 -42
  127. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Modules/module.modulemap +0 -11
  128. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +0 -245
  129. package/ios/FireworkVideoUI/FireworkVideoUI/FireworkVideoUI.docc/FireworkVideoUI.md +0 -13
  130. package/ios/FireworkVideoUI/FireworkVideoUI/FireworkVideoUI.h +0 -18
  131. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/AppLanguageManager.swift +0 -154
  132. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/Bundle+AppLanguage.swift +0 -73
  133. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/NumberFormatter+AppLanguage.swift +0 -25
  134. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/Foundation/URLSession+AppLanguage.swift +0 -52
  135. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIImageView+AppLanguage.swift +0 -60
  136. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UILabel+AppLanguage.swift +0 -98
  137. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UITextField+AppLanguage.swift +0 -97
  138. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UITextView+AppLanguage.swift +0 -97
  139. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIView+AppLanguage.swift +0 -71
  140. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIViewController+AppLanguage.swift +0 -48
  141. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/Extensions/UIKit/UIWindow+AppLanguage.swift +0 -26
  142. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/AppLanguage/LanguageUtil.swift +0 -43
  143. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/Foundation/NSObject+LayoutFlip.swift +0 -42
  144. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/CALayer+LayoutFlip.swift +0 -149
  145. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/UILabel+LayoutFlip.swift +0 -35
  146. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/Extensions/UIKit/UIView+LayoutFlip.swift +0 -202
  147. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/LayoutFlip/LayoutFlipManager.swift +0 -59
  148. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/Foundation/DispatchQueue+Once.swift +0 -32
  149. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/Foundation/String+Base64.swift +0 -18
  150. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Extensions/UIKit/UIView+UIHierarchy.swift +0 -46
  151. package/ios/FireworkVideoUI/FireworkVideoUI/Sources/Utils/Swizzle.swift +0 -37
  152. package/ios/FireworkVideoUI/FireworkVideoUI.xcodeproj/project.pbxproj +0 -766
  153. package/ios/FireworkVideoUI/FireworkVideoUI.xcworkspace/contents.xcworkspacedata +0 -10
  154. package/ios/FireworkVideoUI/FireworkVideoUI.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  155. package/ios/FireworkVideoUI/FireworkVideoUITests/FireworkVideoUITests.swift +0 -37
  156. package/ios/FireworkVideoUI/Podfile +0 -15
  157. package/ios/FireworkVideoUI/Podfile.lock +0 -16
  158. package/ios/scripts/react_native_firework_sdk_pods.rb +0 -27
@@ -1,42 +0,0 @@
1
- // swift-interface-format-version: 1.0
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-ios13.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name FireworkVideoUI
4
- // swift-module-flags-ignorable: -enable-bare-slash-regex
5
- import AVFoundation
6
- import FireworkVideo
7
- @_exported import FireworkVideoUI
8
- import Foundation
9
- import Swift
10
- import UIKit
11
- import WebKit
12
- import _Concurrency
13
- import _StringProcessing
14
- extension Dispatch.DispatchQueue {
15
- public class func once(file: Swift.String = #file, function: Swift.String = #function, line: Swift.Int = #line, block: () -> Swift.Void)
16
- public class func once(token: Swift.String, block: () -> Swift.Void)
17
- }
18
- extension UIKit.UIView {
19
- @_Concurrency.MainActor(unsafe) public var parentViewController: UIKit.UIViewController? {
20
- get
21
- }
22
- @_Concurrency.MainActor(unsafe) public var isIOSSDKView: Swift.Bool {
23
- get
24
- }
25
- }
26
- @_hasMissingDesignatedInitializers public class Swizzle {
27
- public static func swizzleSelector(cls: Swift.AnyClass, originalSelector: ObjectiveC.Selector, customSelector: ObjectiveC.Selector)
28
- public static func swizzleClassSelector(cls: Swift.AnyClass, originalSelector: ObjectiveC.Selector, customSelector: ObjectiveC.Selector)
29
- @objc deinit
30
- }
31
- @_hasMissingDesignatedInitializers public class AppLanguageManager {
32
- public struct NotificationName {
33
- public static let AppLanguageChanged: Foundation.Notification.Name
34
- }
35
- public static let shared: FireworkVideoUI.AppLanguageManager
36
- public var appLanguage: Swift.String? {
37
- get
38
- }
39
- @discardableResult
40
- public func changeAppLanguage(_ language: Swift.String?) -> Swift.Bool
41
- @objc deinit
42
- }
@@ -1,42 +0,0 @@
1
- // swift-interface-format-version: 1.0
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-ios13.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name FireworkVideoUI
4
- // swift-module-flags-ignorable: -enable-bare-slash-regex
5
- import AVFoundation
6
- import FireworkVideo
7
- @_exported import FireworkVideoUI
8
- import Foundation
9
- import Swift
10
- import UIKit
11
- import WebKit
12
- import _Concurrency
13
- import _StringProcessing
14
- extension Dispatch.DispatchQueue {
15
- public class func once(file: Swift.String = #file, function: Swift.String = #function, line: Swift.Int = #line, block: () -> Swift.Void)
16
- public class func once(token: Swift.String, block: () -> Swift.Void)
17
- }
18
- extension UIKit.UIView {
19
- @_Concurrency.MainActor(unsafe) public var parentViewController: UIKit.UIViewController? {
20
- get
21
- }
22
- @_Concurrency.MainActor(unsafe) public var isIOSSDKView: Swift.Bool {
23
- get
24
- }
25
- }
26
- @_hasMissingDesignatedInitializers public class Swizzle {
27
- public static func swizzleSelector(cls: Swift.AnyClass, originalSelector: ObjectiveC.Selector, customSelector: ObjectiveC.Selector)
28
- public static func swizzleClassSelector(cls: Swift.AnyClass, originalSelector: ObjectiveC.Selector, customSelector: ObjectiveC.Selector)
29
- @objc deinit
30
- }
31
- @_hasMissingDesignatedInitializers public class AppLanguageManager {
32
- public struct NotificationName {
33
- public static let AppLanguageChanged: Foundation.Notification.Name
34
- }
35
- public static let shared: FireworkVideoUI.AppLanguageManager
36
- public var appLanguage: Swift.String? {
37
- get
38
- }
39
- @discardableResult
40
- public func changeAppLanguage(_ language: Swift.String?) -> Swift.Bool
41
- @objc deinit
42
- }
@@ -1,11 +0,0 @@
1
- framework module FireworkVideoUI {
2
- umbrella header "FireworkVideoUI.h"
3
-
4
- export *
5
- module * { export * }
6
- }
7
-
8
- module FireworkVideoUI.Swift {
9
- header "FireworkVideoUI-Swift.h"
10
- requires objc
11
- }
@@ -1,245 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>files</key>
6
- <dict>
7
- <key>Headers/FireworkVideoUI-Swift.h</key>
8
- <data>
9
- i583HibrN7k0YmXoCN8LIDbmSt4=
10
- </data>
11
- <key>Headers/FireworkVideoUI.h</key>
12
- <data>
13
- NRZg85mNKv6PczcMet582mQjwKE=
14
- </data>
15
- <key>Info.plist</key>
16
- <data>
17
- jsYX5ACeWlZ/lQWyUHo7zHtGu1Y=
18
- </data>
19
- <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
20
- <data>
21
- JD+JGaE1pyP/erK3A8uz3Z7svAw=
22
- </data>
23
- <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
24
- <data>
25
- 0XKpQYvLNcs6gusQUQX4HRW4/Tc=
26
- </data>
27
- <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
28
- <data>
29
- +yf24NLDrISOUQFdYdfsoS5A8NI=
30
- </data>
31
- <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
32
- <data>
33
- 0XKpQYvLNcs6gusQUQX4HRW4/Tc=
34
- </data>
35
- <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
36
- <data>
37
- zpV8IQS3IkfCGGDXHjXGWHZwa9M=
38
- </data>
39
- <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
40
- <data>
41
- JD+JGaE1pyP/erK3A8uz3Z7svAw=
42
- </data>
43
- <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
44
- <data>
45
- 8HyKG5hen35fWUnYH4rt30wTzis=
46
- </data>
47
- <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
48
- <data>
49
- h5aNQF/gt+daU/+BF0c1O+102NQ=
50
- </data>
51
- <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
52
- <data>
53
- 8HyKG5hen35fWUnYH4rt30wTzis=
54
- </data>
55
- <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
56
- <data>
57
- Xp/plaW74zCakL/eCFwuVUsXIMc=
58
- </data>
59
- <key>Modules/module.modulemap</key>
60
- <data>
61
- acpgMXnxtKZurb9LYb4tLOcX2cM=
62
- </data>
63
- </dict>
64
- <key>files2</key>
65
- <dict>
66
- <key>Headers/FireworkVideoUI-Swift.h</key>
67
- <dict>
68
- <key>hash2</key>
69
- <data>
70
- xWiKQmcf3DHCgH9dBkmdlAsxIZiUklEHKL8VF5guI8w=
71
- </data>
72
- </dict>
73
- <key>Headers/FireworkVideoUI.h</key>
74
- <dict>
75
- <key>hash2</key>
76
- <data>
77
- C2EMdBka9kS6ugy1NmcysmLzhwcZtW52x27D4Pi5P2Q=
78
- </data>
79
- </dict>
80
- <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
81
- <dict>
82
- <key>hash2</key>
83
- <data>
84
- oCsc58odDNLMVdMzw7mJXy5H9hjzH0Q+nIMvCe+bXmo=
85
- </data>
86
- </dict>
87
- <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
88
- <dict>
89
- <key>hash2</key>
90
- <data>
91
- 5NPzn4LnvqX0tEp8qisADTWcY343bJFvqiysen3m24I=
92
- </data>
93
- </dict>
94
- <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
95
- <dict>
96
- <key>hash2</key>
97
- <data>
98
- ta85UXRpX/ciy/P7Bwc84q6T+V9vBLuOrilB/TzaRSk=
99
- </data>
100
- </dict>
101
- <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
102
- <dict>
103
- <key>hash2</key>
104
- <data>
105
- 5NPzn4LnvqX0tEp8qisADTWcY343bJFvqiysen3m24I=
106
- </data>
107
- </dict>
108
- <key>Modules/FireworkVideoUI.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
109
- <dict>
110
- <key>hash2</key>
111
- <data>
112
- xypcOEQ5+poy6H+qmEMsjs3Z3xEDRf+ZTrouSmsXF9w=
113
- </data>
114
- </dict>
115
- <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
116
- <dict>
117
- <key>hash2</key>
118
- <data>
119
- oCsc58odDNLMVdMzw7mJXy5H9hjzH0Q+nIMvCe+bXmo=
120
- </data>
121
- </dict>
122
- <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
123
- <dict>
124
- <key>hash2</key>
125
- <data>
126
- 4UfyrWEVo8zN0Rv2i/FuKZol8bbI7YkSfQCkBUrIk2c=
127
- </data>
128
- </dict>
129
- <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
130
- <dict>
131
- <key>hash2</key>
132
- <data>
133
- Wi0OREamh7l3ic/XXkQyRTqKJ1legjNa97cS0rRDQpw=
134
- </data>
135
- </dict>
136
- <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
137
- <dict>
138
- <key>hash2</key>
139
- <data>
140
- 4UfyrWEVo8zN0Rv2i/FuKZol8bbI7YkSfQCkBUrIk2c=
141
- </data>
142
- </dict>
143
- <key>Modules/FireworkVideoUI.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
144
- <dict>
145
- <key>hash2</key>
146
- <data>
147
- UK0fgWeGwsn4VvGtres2LE8ptm9mFojznI8zzenM2hc=
148
- </data>
149
- </dict>
150
- <key>Modules/module.modulemap</key>
151
- <dict>
152
- <key>hash2</key>
153
- <data>
154
- e6XgRro0MbWm+Nu76XbtPBOQtqanmjktK8gkROMrsUo=
155
- </data>
156
- </dict>
157
- </dict>
158
- <key>rules</key>
159
- <dict>
160
- <key>^.*</key>
161
- <true/>
162
- <key>^.*\.lproj/</key>
163
- <dict>
164
- <key>optional</key>
165
- <true/>
166
- <key>weight</key>
167
- <real>1000</real>
168
- </dict>
169
- <key>^.*\.lproj/locversion.plist$</key>
170
- <dict>
171
- <key>omit</key>
172
- <true/>
173
- <key>weight</key>
174
- <real>1100</real>
175
- </dict>
176
- <key>^Base\.lproj/</key>
177
- <dict>
178
- <key>weight</key>
179
- <real>1010</real>
180
- </dict>
181
- <key>^version.plist$</key>
182
- <true/>
183
- </dict>
184
- <key>rules2</key>
185
- <dict>
186
- <key>.*\.dSYM($|/)</key>
187
- <dict>
188
- <key>weight</key>
189
- <real>11</real>
190
- </dict>
191
- <key>^(.*/)?\.DS_Store$</key>
192
- <dict>
193
- <key>omit</key>
194
- <true/>
195
- <key>weight</key>
196
- <real>2000</real>
197
- </dict>
198
- <key>^.*</key>
199
- <true/>
200
- <key>^.*\.lproj/</key>
201
- <dict>
202
- <key>optional</key>
203
- <true/>
204
- <key>weight</key>
205
- <real>1000</real>
206
- </dict>
207
- <key>^.*\.lproj/locversion.plist$</key>
208
- <dict>
209
- <key>omit</key>
210
- <true/>
211
- <key>weight</key>
212
- <real>1100</real>
213
- </dict>
214
- <key>^Base\.lproj/</key>
215
- <dict>
216
- <key>weight</key>
217
- <real>1010</real>
218
- </dict>
219
- <key>^Info\.plist$</key>
220
- <dict>
221
- <key>omit</key>
222
- <true/>
223
- <key>weight</key>
224
- <real>20</real>
225
- </dict>
226
- <key>^PkgInfo$</key>
227
- <dict>
228
- <key>omit</key>
229
- <true/>
230
- <key>weight</key>
231
- <real>20</real>
232
- </dict>
233
- <key>^embedded\.provisionprofile$</key>
234
- <dict>
235
- <key>weight</key>
236
- <real>20</real>
237
- </dict>
238
- <key>^version\.plist$</key>
239
- <dict>
240
- <key>weight</key>
241
- <real>20</real>
242
- </dict>
243
- </dict>
244
- </dict>
245
- </plist>
@@ -1,13 +0,0 @@
1
- # ``FireworkVideoUI``
2
-
3
- <!--@START_MENU_TOKEN@-->Summary<!--@END_MENU_TOKEN@-->
4
-
5
- ## Overview
6
-
7
- <!--@START_MENU_TOKEN@-->Text<!--@END_MENU_TOKEN@-->
8
-
9
- ## Topics
10
-
11
- ### <!--@START_MENU_TOKEN@-->Group<!--@END_MENU_TOKEN@-->
12
-
13
- - <!--@START_MENU_TOKEN@-->``Symbol``<!--@END_MENU_TOKEN@-->
@@ -1,18 +0,0 @@
1
- //
2
- // FireworkVideoUI.h
3
- // FireworkVideoUI
4
- //
5
- // Created by linjie jiang on 4/25/23.
6
- //
7
-
8
- #import <Foundation/Foundation.h>
9
-
10
- //! Project version number for FireworkVideoUI.
11
- FOUNDATION_EXPORT double FireworkVideoUIVersionNumber;
12
-
13
- //! Project version string for FireworkVideoUI.
14
- FOUNDATION_EXPORT const unsigned char FireworkVideoUIVersionString[];
15
-
16
- // In this header, you should import all the public headers of your framework using statements like #import <FireworkVideoUI/PublicHeader.h>
17
-
18
-
@@ -1,154 +0,0 @@
1
- //
2
- // AppLanguageManager.swift
3
- //
4
- // Created by linjie jiang on 2023/2/7.
5
- //
6
-
7
- import UIKit
8
-
9
- private let appLanguageStorageKey = "firework_sdk_app_language_storage_key"
10
-
11
- enum LanguageLayoutDirection: Int {
12
- case ltr, rtl, unsupported
13
- }
14
-
15
- /// The manager of supporting app language
16
- public class AppLanguageManager {
17
- public struct NotificationName {
18
- /// The notification name for language change
19
- public static let AppLanguageChanged = Notification.Name(
20
- rawValue: "firework.notification.name.appLanguageChanged"
21
- )
22
- }
23
-
24
- public static let shared = AppLanguageManager()
25
-
26
- var systemLanguage: String?
27
- private var systemLanguageCode: String? {
28
- guard let language = systemLanguage else {
29
- return nil
30
- }
31
-
32
- return LanguageUtil.getLanguageCode(language)
33
- }
34
-
35
- /// Get current app language.
36
- public private(set) var appLanguage: String? {
37
- didSet {
38
- if appLanguage != nil {
39
- AppLanguageManager.swizzelMethods()
40
- }
41
-
42
- LayoutFlipManager.shared.enableHorizontalFlip = shouldHorizontalFlip
43
-
44
- if appLanguage != oldValue {
45
- NotificationCenter.default.post(name: NotificationName.AppLanguageChanged, object: nil)
46
- }
47
- }
48
- }
49
-
50
- var appLanguageCode: String? {
51
- guard let language = appLanguage else {
52
- return nil
53
- }
54
-
55
- return LanguageUtil.getLanguageCode(language)
56
- }
57
-
58
- var appLanguageLayoutDirection: LanguageLayoutDirection? {
59
- guard let languageCode = appLanguageCode else {
60
- return nil
61
- }
62
- let direction = Locale.characterDirection(forLanguage: languageCode)
63
- switch direction {
64
- case .leftToRight:
65
- return .ltr
66
- case .rightToLeft:
67
- return .rtl
68
- default:
69
- return .unsupported
70
- }
71
- }
72
-
73
- var systemLanguageLayoutDirection: LanguageLayoutDirection? {
74
- guard let languageCode = systemLanguageCode else {
75
- return nil
76
- }
77
- let direction = Locale.characterDirection(forLanguage: languageCode)
78
- switch direction {
79
- case .leftToRight:
80
- return .ltr
81
- case .rightToLeft:
82
- return .rtl
83
- default:
84
- return .unsupported
85
- }
86
- }
87
-
88
- var shouldHorizontalFlip: Bool {
89
- if appLanguageLayoutDirection == .rtl,
90
- systemLanguageLayoutDirection == .ltr {
91
- return true
92
- }
93
-
94
- if appLanguageLayoutDirection == .ltr,
95
- systemLanguageLayoutDirection == .rtl {
96
- return true
97
- }
98
-
99
- return false
100
- }
101
-
102
- private static func swizzelMethods() {
103
- DispatchQueue.once {
104
- UIViewController.swizzleViewControllerMethodsForAppLanguage()
105
- Bundle.swizzleBundleMethodsForAppLanguage()
106
- URLSession.swizzleURLSessionMethodsForAppLanguage()
107
- NumberFormatter.swizzleNumberFormatterMethodsForAppLanguage()
108
- UIImageView.swizzleImageViewMethodsForAppLanguage()
109
- UILabel.swizzleLabelMethodsForAppLanguage()
110
- UITextField.swizzleTextFieldMethodsForAppLanguage()
111
- UITextView.swizzleTextViewMethodsForAppLanguage()
112
- UIWindow.swizzleWindowMethodsForAppLanguage()
113
- UIView.swizzleViewMethodsForAppLanguage()
114
- }
115
-
116
- LayoutFlipManager.swizzelMethods()
117
- }
118
-
119
- private init() {
120
- initializeManager()
121
- }
122
-
123
- private func initializeManager() {
124
- self.systemLanguage = Locale.preferredLanguages.first
125
- let cachedAppLanguage = UserDefaults.standard.object(forKey: appLanguageStorageKey) as? String
126
- if LanguageUtil.isValidLanguage(cachedAppLanguage) {
127
- self.appLanguage = cachedAppLanguage
128
- }
129
- }
130
-
131
- /// Change app language
132
- ///
133
- /// - Parameters:
134
- /// - language: app language. We will use system langauge when language is nil.
135
- /// - Returns: The result of changing app language.
136
- @discardableResult
137
- public func changeAppLanguage(_ language: String?) -> Bool {
138
- guard let language = language, language.count > 0 else {
139
- appLanguage = nil
140
- UserDefaults.standard.removeObject(forKey: appLanguageStorageKey)
141
- UserDefaults.standard.synchronize()
142
- return true
143
- }
144
-
145
- if LanguageUtil.isValidLanguage(language) {
146
- appLanguage = language
147
- UserDefaults.standard.set(language, forKey: appLanguageStorageKey)
148
- UserDefaults.standard.synchronize()
149
- return true
150
- } else {
151
- return false
152
- }
153
- }
154
- }
@@ -1,73 +0,0 @@
1
- //
2
- // Bundle+AppLanguage.swift
3
- //
4
- // Created by linjie jiang on 2023/2/7.
5
- //
6
-
7
- import Foundation
8
- import FireworkVideo
9
-
10
- extension Bundle {
11
- static func swizzleBundleMethodsForAppLanguage() {
12
- Swizzle.swizzleSelector(
13
- cls: self,
14
- originalSelector: #selector(Bundle.localizedString(forKey:value:table:)),
15
- customSelector: #selector(Bundle.fw_localizedString(forKey:value:table:)))
16
- }
17
-
18
- @objc func fw_localizedString(
19
- forKey key: String,
20
- value: String?,
21
- table tableName: String?
22
- ) -> String {
23
- if let language = AppLanguageManager.shared.appLanguage,
24
- let languageCode = AppLanguageManager.shared.appLanguageCode,
25
- Bundle(for: FireworkVideoSDK.self) == self {
26
- let iOSSDKBundle = Bundle(for: FireworkVideoSDK.self)
27
- var languageBundlePath: String?
28
- let defaultLanguageBundlePath = iOSSDKBundle.path(forResource: "Base", ofType: "lproj")
29
- if let path = iOSSDKBundle.path(forResource: language, ofType: "lproj") {
30
- languageBundlePath = path
31
- } else if let path = iOSSDKBundle.path(forResource: languageCode, ofType: "lproj") {
32
- languageBundlePath = path
33
- } else {
34
- let targeLanguageList = iOSSDKBundle.localizations.filter { $0 != "Base" }
35
- if let targeLanguage = targeLanguageList.first(where: { item in
36
- let targeLanguageCode = LanguageUtil.getLanguageCode(item)
37
- return languageCode == targeLanguageCode
38
- }) {
39
- languageBundlePath = iOSSDKBundle.path(forResource: targeLanguage, ofType: "lproj")
40
- }
41
- }
42
-
43
- if let resultLanguageBundlePath = languageBundlePath ?? defaultLanguageBundlePath,
44
- let resultLanguageBundle = Bundle(path: resultLanguageBundlePath) {
45
- let localizedString = resultLanguageBundle.fw_localizedString(
46
- forKey: key,
47
- value: value,
48
- table: tableName
49
- )
50
- var keyNotFound = false
51
- if (value ?? "").isEmpty && localizedString == key {
52
- keyNotFound = true
53
- } else if (value ?? "").count > 0 && localizedString == value {
54
- keyNotFound = true
55
- }
56
- if keyNotFound, resultLanguageBundlePath != defaultLanguageBundlePath {
57
- let defaultLanguageBundle = Bundle(path: defaultLanguageBundlePath ?? "")
58
- return defaultLanguageBundle?.fw_localizedString(
59
- forKey: key,
60
- value: value,
61
- table: tableName
62
- ) ?? localizedString
63
- } else {
64
- return localizedString
65
- }
66
- } else {
67
- return self.fw_localizedString(forKey: key, value: value, table: tableName)
68
- }
69
- } else {
70
- return self.fw_localizedString(forKey: key, value: value, table: tableName)
71
- }
72
- }
73
- }
@@ -1,25 +0,0 @@
1
- //
2
- // NumberFormatter+AppLanguage.swift
3
- //
4
- // Created by linjie jiang on 2023/2/20.
5
- //
6
-
7
- import Foundation
8
-
9
- extension NumberFormatter {
10
- static func swizzleNumberFormatterMethodsForAppLanguage() {
11
- Swizzle.swizzleSelector(
12
- cls: self,
13
- originalSelector: #selector(NumberFormatter.string(from:)),
14
- customSelector: #selector(NumberFormatter.fw_string(from:)))
15
- }
16
-
17
- @objc func fw_string(from number: NSNumber) -> String? {
18
- if let language = AppLanguageManager.shared.appLanguage,
19
- self.numberStyle == .currency {
20
- self.locale = Locale(identifier: language)
21
- }
22
-
23
- return fw_string(from: number)
24
- }
25
- }
@@ -1,52 +0,0 @@
1
- //
2
- // URLSession+AppLanguage.swift
3
- //
4
- // Created by linjie jiang on 2023/2/20.
5
- //
6
-
7
- import Foundation
8
-
9
- extension URLSession {
10
- static func swizzleURLSessionMethodsForAppLanguage() {
11
- // swiftlint:disable:next line_length
12
- let orginalSelector1 = #selector(URLSession.dataTask(with:completionHandler:) as (URLSession) -> (URLRequest, @escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask)
13
- let customSelector1 = #selector(URLSession.fw_dataTask(with:completionHandler:))
14
- Swizzle.swizzleSelector(
15
- cls: self,
16
- originalSelector: orginalSelector1,
17
- customSelector: customSelector1)
18
- // swiftlint:disable:next line_length
19
- let orginalSelector2 = #selector(URLSession.dataTask(with:) as (URLSession) -> (URLRequest) -> URLSessionDataTask)
20
- let customSelector2 = #selector(URLSession.fw_dataTask(with:))
21
- Swizzle.swizzleSelector(
22
- cls: self,
23
- originalSelector: orginalSelector2,
24
- customSelector: customSelector2)
25
- }
26
-
27
- @objc func fw_dataTask(
28
- with request: URLRequest,
29
- completionHandler: @escaping @Sendable (Data?, URLResponse?, Error?) -> Void
30
- ) -> URLSessionDataTask {
31
- return fw_dataTask(with: swizzleRequest(request), completionHandler: completionHandler)
32
- }
33
-
34
- @objc func fw_dataTask(with request: URLRequest) -> URLSessionDataTask {
35
- return fw_dataTask(with: swizzleRequest(request))
36
- }
37
-
38
- private func swizzleRequest(_ request: URLRequest) -> URLRequest {
39
- if let language = AppLanguageManager.shared.appLanguage,
40
- let languageCode = AppLanguageManager.shared.appLanguageCode {
41
- var mutableRequest = request
42
- if language != languageCode {
43
- mutableRequest.setValue("\(language),\(languageCode);q=0.9", forHTTPHeaderField: "Accept-Language")
44
- } else {
45
- mutableRequest.setValue("\(language);q=0.9", forHTTPHeaderField: "Accept-Language")
46
- }
47
- return mutableRequest
48
- }
49
-
50
- return request
51
- }
52
- }