react-native-firework-sdk 1.6.2 → 1.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/android/build.gradle +1 -1
  2. package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FireworkSDKInterface.kt +2 -0
  3. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +55 -0
  4. package/android/src/main/java/com/fireworksdk/bridge/utils/FWLanguageUtil.kt +72 -0
  5. package/ios/Components/StoryBlock.swift +5 -4
  6. package/ios/Components/VideoFeed.swift +27 -35
  7. package/ios/Components/VideoPlayerConfiguration.swift +11 -0
  8. package/ios/FireworkSdk.xcodeproj/project.pbxproj +26 -16
  9. package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +2 -11
  10. package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +2 -0
  11. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +1 -1
  12. package/ios/Utils/DispatchQueue+FWOnce.swift +32 -0
  13. package/ios/Utils/FWPiPManager.swift +24 -0
  14. package/ios/Utils/FWSwizzleLoader.h +15 -0
  15. package/ios/Utils/FWSwizzleLoader.m +17 -0
  16. package/ios/Utils/FWSwizzleUtil.swift +29 -0
  17. package/ios/Utils/UIButton+FWSwizzle.swift +33 -0
  18. package/ios/Utils/UINavigationController+FWSwizzle.swift +30 -0
  19. package/ios/react_native_firework_sdk.h +1 -2
  20. package/lib/commonjs/FireworkSDK.js +21 -1
  21. package/lib/commonjs/FireworkSDK.js.map +1 -1
  22. package/lib/commonjs/VideoShopping.js +7 -7
  23. package/lib/commonjs/VideoShopping.js.map +1 -1
  24. package/lib/commonjs/components/VideoFeed.js +3 -1
  25. package/lib/commonjs/components/VideoFeed.js.map +1 -1
  26. package/lib/commonjs/index.js.map +1 -1
  27. package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
  28. package/lib/module/FireworkSDK.js +21 -1
  29. package/lib/module/FireworkSDK.js.map +1 -1
  30. package/lib/module/VideoShopping.js +7 -7
  31. package/lib/module/VideoShopping.js.map +1 -1
  32. package/lib/module/components/VideoFeed.js +3 -1
  33. package/lib/module/components/VideoFeed.js.map +1 -1
  34. package/lib/module/index.js.map +1 -1
  35. package/lib/module/modules/FireworkSDKModule.js.map +1 -1
  36. package/lib/typescript/FireworkSDK.d.ts +7 -3
  37. package/lib/typescript/VideoShopping.d.ts +7 -7
  38. package/lib/typescript/index.d.ts +3 -3
  39. package/lib/typescript/models/VideoPlayerConfiguration.d.ts +19 -0
  40. package/lib/typescript/modules/FireworkSDKModule.d.ts +2 -0
  41. package/package.json +1 -1
  42. package/react-native-firework-sdk.podspec +2 -4
  43. package/src/FireworkSDK.ts +18 -4
  44. package/src/VideoShopping.ts +7 -7
  45. package/src/components/VideoFeed.tsx +2 -0
  46. package/src/index.tsx +4 -2
  47. package/src/models/VideoPlayerConfiguration.ts +20 -0
  48. package/src/modules/FireworkSDKModule.ts +2 -0
  49. package/ios/Utils/AVPlayer+FWSwizzle.h +0 -17
  50. package/ios/Utils/AVPlayer+FWSwizzle.m +0 -50
  51. package/ios/Utils/FWNavigatorUtils.swift +0 -26
  52. package/ios/Utils/UINavigationController+FWSwizzle.h +0 -16
  53. package/ios/Utils/UINavigationController+FWSwizzle.m +0 -49
@@ -1,50 +0,0 @@
1
- //
2
- // AVPlayer+FWSwizzle.m
3
- // FireworkSdk
4
- //
5
- // Created by linjie jiang on 2023/1/10.
6
- //
7
-
8
- #import "AVPlayer+FWSwizzle.h"
9
- #import <objc/runtime.h>
10
- #import <React/RCTConvert.h>
11
- #import "react_native_firework_sdk-Swift.h"
12
-
13
- @implementation AVPlayer (FWSwizzle)
14
-
15
- + (void)load {
16
- static dispatch_once_t once_token;
17
- dispatch_once(&once_token, ^{
18
- [self swizzleSelector:@selector(play) targetSelector:@selector(_fw_play)];
19
- });
20
- }
21
-
22
- + (void)swizzleSelector:(SEL)sourceSelector
23
- targetSelector:(SEL)targetSelector {
24
- Class class = [self class];
25
- Method sourceMethod =
26
- class_getInstanceMethod(class, sourceSelector);
27
- Method targetMethod =
28
- class_getInstanceMethod(class, targetSelector);
29
- BOOL isMethodExists =
30
- !class_addMethod(class, sourceSelector,
31
- method_getImplementation(targetMethod),
32
- method_getTypeEncoding(targetMethod));
33
- if (isMethodExists) {
34
- method_exchangeImplementations(sourceMethod, targetMethod);
35
- } else {
36
- class_replaceMethod(class, targetSelector,
37
- method_getImplementation(sourceMethod),
38
- method_getTypeEncoding(sourceMethod));
39
- }
40
- }
41
-
42
- - (void)_fw_play {
43
- if (FWNavigatorUtils.shared.shouldDisablePlay) {
44
- return;
45
- }
46
-
47
- [self _fw_play];
48
- }
49
-
50
- @end
@@ -1,26 +0,0 @@
1
- //
2
- // FWNavigatorUtils.swift
3
- // FireworkSdk
4
- //
5
- // Created by linjie jiang on 2023/1/10.
6
- //
7
-
8
- import UIKit
9
- import FireworkVideo
10
-
11
- @objc(FWNavigatorUtils)
12
- public class FWNavigatorUtils: NSObject {
13
- @objc public static let shared = FWNavigatorUtils()
14
-
15
- @objc public var shouldDisablePlay = false
16
-
17
- private override init() {}
18
-
19
- public override func copy() -> Any {
20
- return self
21
- }
22
-
23
- public override func mutableCopy() -> Any {
24
- return self
25
- }
26
- }
@@ -1,16 +0,0 @@
1
- //
2
- // UIViewController+FWSwizzle.h
3
- // FireworkSdk
4
- //
5
- // Created by linjie jiang on 2022/9/8.
6
- //
7
-
8
- #import <UIKit/UIKit.h>
9
-
10
- NS_ASSUME_NONNULL_BEGIN
11
-
12
- @interface UINavigationController (FWSwizzle)
13
-
14
- @end
15
-
16
- NS_ASSUME_NONNULL_END
@@ -1,49 +0,0 @@
1
- //
2
- // UIViewController+FWSwizzle.m
3
- // FireworkSdk
4
- //
5
- // Created by linjie jiang on 2022/9/8.
6
- //
7
-
8
- #import "UINavigationController+FWSwizzle.h"
9
- #import <objc/runtime.h>
10
- #import <React/RCTConvert.h>
11
- #import "react_native_firework_sdk-Swift.h"
12
-
13
- @implementation UINavigationController (FWSwizzle)
14
-
15
- + (void)load {
16
- static dispatch_once_t once_token;
17
- dispatch_once(&once_token, ^{
18
- Class class = [self class];
19
- SEL defaultSelector = @selector(pushViewController:animated:);
20
- SEL swizzledSelector = @selector(_fw_pushViewController:animated:);
21
- Method defaultMethod =
22
- class_getInstanceMethod(class, defaultSelector);
23
- Method swizzledMethod =
24
- class_getInstanceMethod(class, swizzledSelector);
25
- BOOL isMethodExists =
26
- !class_addMethod(class, defaultSelector,
27
- method_getImplementation(swizzledMethod),
28
- method_getTypeEncoding(swizzledMethod));
29
- if (isMethodExists) {
30
- method_exchangeImplementations(defaultMethod, swizzledMethod);
31
- } else {
32
- class_replaceMethod(class, swizzledSelector,
33
- method_getImplementation(defaultMethod),
34
- method_getTypeEncoding(defaultMethod));
35
- }
36
- });
37
- }
38
-
39
- - (void)_fw_pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
40
- if ([viewController isKindOfClass:[FWCartViewController class]]) {
41
- FWCartViewController *cartVC = (FWCartViewController *)viewController;
42
- if (!cartVC.enableShowCustomCartView) {
43
- return;
44
- }
45
- }
46
- [self _fw_pushViewController:viewController animated:animated];
47
- }
48
-
49
- @end