react-native-firework-sdk 2.4.0 → 2.4.1

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 (59) 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_x86_64-simulator/FireworkVideoUI.framework/FireworkVideoUI +0 -0
  5. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/Info.plist +0 -0
  6. package/FireworkVideoUI.xcframework/ios-arm64_x86_64-simulator/FireworkVideoUI.framework/_CodeSignature/CodeResources +1 -1
  7. package/android/src/main/AndroidManifest.xml +4 -0
  8. package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWStoryBlockManager.kt +4 -1
  9. package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWNavigatorInterface.kt +2 -0
  10. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWNavigatorModule.kt +41 -13
  11. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +1 -1
  12. package/android/src/main/java/com/fireworksdk/bridge/reactnative/pages/FWContianerActivity.kt +61 -0
  13. package/android/src/main/java/com/fireworksdk/bridge/utils/FWConfigUtil.kt +1 -0
  14. package/android/src/main/java/com/fireworksdk/bridge/utils/FWGlobalDataUtil.kt +0 -2
  15. package/android/src/main/java/com/fireworksdk/bridge/utils/FWStoryBlockUtil.kt +30 -0
  16. package/android/src/main/res/layout/fw_bridge_fragment_container.xml +8 -0
  17. package/ios/FireworkSdk.xcodeproj/project.pbxproj +12 -0
  18. package/ios/Models/RNToNative/RCTConvert+FWNavigatorModule.swift +21 -0
  19. package/ios/Models/RNToNative/RCTConvert+FireworkSDKModule.swift +3 -30
  20. package/ios/Models/RNToNative/RCTConvert+StoryBlock.swift +2 -2
  21. package/ios/Models/RNToNative/RCTConvert+VideoFeed.swift +5 -5
  22. package/ios/Modules/FWNavigatorModule/FWNavigatorModule.m +2 -2
  23. package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +59 -4
  24. package/ios/Modules/FWNavigatorModule/FWRNContainerViewController.swift +33 -0
  25. package/ios/Modules/FWNavigatorModule/PushRNContainerParams.swift +14 -0
  26. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +1 -1
  27. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +36 -23
  28. package/lib/commonjs/FWNavigator.js +21 -0
  29. package/lib/commonjs/FWNavigator.js.map +1 -1
  30. package/lib/commonjs/FireworkSDK.js +12 -1
  31. package/lib/commonjs/FireworkSDK.js.map +1 -1
  32. package/lib/commonjs/index.js.map +1 -1
  33. package/lib/commonjs/models/PushRNContainerParams.js +2 -0
  34. package/lib/commonjs/models/PushRNContainerParams.js.map +1 -0
  35. package/lib/commonjs/modules/FWNavigatorModule.js.map +1 -1
  36. package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
  37. package/lib/module/FWNavigator.js +21 -0
  38. package/lib/module/FWNavigator.js.map +1 -1
  39. package/lib/module/FireworkSDK.js +12 -1
  40. package/lib/module/FireworkSDK.js.map +1 -1
  41. package/lib/module/index.js.map +1 -1
  42. package/lib/module/models/PushRNContainerParams.js +2 -0
  43. package/lib/module/models/PushRNContainerParams.js.map +1 -0
  44. package/lib/module/modules/FWNavigatorModule.js +1 -2
  45. package/lib/module/modules/FWNavigatorModule.js.map +1 -1
  46. package/lib/module/modules/FireworkSDKModule.js.map +1 -1
  47. package/lib/typescript/FWNavigator.d.ts +14 -0
  48. package/lib/typescript/FireworkSDK.d.ts +3 -1
  49. package/lib/typescript/index.d.ts +3 -1
  50. package/lib/typescript/models/PushRNContainerParams.d.ts +8 -0
  51. package/lib/typescript/modules/FWNavigatorModule.d.ts +3 -0
  52. package/lib/typescript/modules/FireworkSDKModule.d.ts +1 -0
  53. package/package.json +1 -1
  54. package/src/FWNavigator.ts +20 -0
  55. package/src/FireworkSDK.ts +10 -1
  56. package/src/index.ts +4 -0
  57. package/src/models/PushRNContainerParams.ts +9 -0
  58. package/src/modules/FWNavigatorModule.ts +5 -2
  59. package/src/modules/FireworkSDKModule.ts +1 -0
@@ -1,3 +1,4 @@
1
+ import type PushRNContainerParams from './models/PushRNContainerParams';
1
2
  /**
2
3
  * You can use this class for pushing RN page from the native page.
3
4
  */
@@ -5,6 +6,19 @@ declare class FWNavigator {
5
6
  private static _instance?;
6
7
  static getInstance(): FWNavigator;
7
8
  private constructor();
9
+ /**
10
+ * Push a new RN container.
11
+ * You could use this method to make a RN page on top of
12
+ * SDK full-screen player.
13
+ * @param params {PushRNContainerParams}
14
+ * @returns {Promise<boolean>} The result of pushing a new Container.
15
+ */
16
+ pushRNContainer(params: PushRNContainerParams): Promise<boolean>;
17
+ /**
18
+ * Pop the RN container you pushed before.
19
+ * @returns {Promise<boolean>} The result of popping a new Container.
20
+ */
21
+ popRNContainer(): Promise<boolean>;
8
22
  /**
9
23
  * Pop the native container. You could use the method to close the fullscreen player.
10
24
  * But if the enablePictureInPicture of the associated video feed is true,
@@ -23,7 +23,9 @@ declare class FireworkSDK {
23
23
  /**
24
24
  * the callback of clicking Video Feed.
25
25
  */
26
- onVideoFeedClick?: VideoFeedClickCallback;
26
+ get onVideoFeedClick(): VideoFeedClickCallback | undefined;
27
+ set onVideoFeedClick(value: VideoFeedClickCallback | undefined);
28
+ private _onVideoFeedClick?;
27
29
  /**
28
30
  * The callback of clicking custom CTA.
29
31
  */
@@ -29,6 +29,8 @@ import type ProductInfoViewConfiguration from './models/ProductInfoViewConfigura
29
29
  import type { LinkButtonConfiguration, ShoppingCTAButtonConfiguration, ShoppingCTAButtonText } from './models/ProductInfoViewConfiguration';
30
30
  import type ProductUnit from './models/ProductUnit';
31
31
  import type { ProductPrice, ProductUnitOption } from './models/ProductUnit';
32
+ import type PushRNContainerParams from './models/PushRNContainerParams';
33
+ import type { RNAppProps } from './models/PushRNContainerParams';
32
34
  import type SDKInitOptions from './models/SDKInitOptions';
33
35
  import type { VideoLaunchBehavior } from './models/SDKInitOptions';
34
36
  import type ShoppingCTAResult from './models/ShoppingCTAResult';
@@ -50,4 +52,4 @@ import type { VideoPlayerStyle } from './models/VideoPlayerStyle';
50
52
  import type { CustomClickCartIconCallback, CustomClickLinkButtonCallback, ShoppingCTACallback, UpdateProductDetailsCallback } from './VideoShopping';
51
53
  import VideoShopping from './VideoShopping';
52
54
  export default FireworkSDK;
53
- export { AdBadgeConfiguration, AdBadgeTextType, AdConfiguration, AndroidFontInfo, CustomClickCartIconCallback, CustomClickLinkButtonCallback, CustomClickLinkButtonEvent, CustomCTAClickCallback, CustomCTAClickEvent, FeedItemDetails, FireworkSDK, FWError, FWNavigator, GradientDrawable, GradientDrawableOrientation, IOSFontInfo, IOSSystemFontStyle, IOSSystemFontWeight, IStoryBlockMethods, IStoryBlockProps, IVideoFeedProps, LinkButtonConfiguration, LiveStream, LiveStreamChatEvent, LiveStreamChatEventName, LiveStreamEvent, LiveStreamEventDetails, LiveStreamEventName, LiveStreamMessageDetails, onLiveStreamChatEventCallback, onLiveStreamEventCallback, OpenVideoPlayerConfiguration, Product, ProductInfoViewConfiguration, ProductPrice, ProductUnit, ProductUnitOption, SDKInitCallback, SDKInitEvent, SDKInitOptions, ShoppingCTAButtonConfiguration, ShoppingCTAButtonText, ShoppingCTACallback, ShoppingCTAEvent, ShoppingCTAResult, StoryBlock, StoryBlockConfiguration, StoryBlockSource, TrackPurchaseParameters, UpdateProductDetailsCallback, UpdateProductDetailsEvent, VastAttribute, VideoFeed, VideoFeedClickCallback, VideoFeedClickEvent, VideoFeedConfiguration, VideoFeedMode, VideoFeedPadding, VideoFeedPlayIconConfiguration, VideoFeedSource, VideoFeedTitleConfiguration, VideoFeedTitlePosition, VideoLaunchBehavior, VideoPlaybackCallback, VideoPlaybackDetails, VideoPlaybackEvent, VideoPlaybackEventName, VideoPlayerCompleteAction, VideoPlayerConfiguration, VideoPlayerCTADelay, VideoPlayerCTADelayType, VideoPlayerCTAStyle, VideoPlayerCTAWidth, VideoPlayerSize, VideoPlayerStyle, VideoShopping, };
55
+ export { AdBadgeConfiguration, AdBadgeTextType, AdConfiguration, AndroidFontInfo, CustomClickCartIconCallback, CustomClickLinkButtonCallback, CustomClickLinkButtonEvent, CustomCTAClickCallback, CustomCTAClickEvent, FeedItemDetails, FireworkSDK, FWError, FWNavigator, GradientDrawable, GradientDrawableOrientation, IOSFontInfo, IOSSystemFontStyle, IOSSystemFontWeight, IStoryBlockMethods, IStoryBlockProps, IVideoFeedProps, LinkButtonConfiguration, LiveStream, LiveStreamChatEvent, LiveStreamChatEventName, LiveStreamEvent, LiveStreamEventDetails, LiveStreamEventName, LiveStreamMessageDetails, onLiveStreamChatEventCallback, onLiveStreamEventCallback, OpenVideoPlayerConfiguration, Product, ProductInfoViewConfiguration, ProductPrice, ProductUnit, ProductUnitOption, PushRNContainerParams, RNAppProps, SDKInitCallback, SDKInitEvent, SDKInitOptions, ShoppingCTAButtonConfiguration, ShoppingCTAButtonText, ShoppingCTACallback, ShoppingCTAEvent, ShoppingCTAResult, StoryBlock, StoryBlockConfiguration, StoryBlockSource, TrackPurchaseParameters, UpdateProductDetailsCallback, UpdateProductDetailsEvent, VastAttribute, VideoFeed, VideoFeedClickCallback, VideoFeedClickEvent, VideoFeedConfiguration, VideoFeedMode, VideoFeedPadding, VideoFeedPlayIconConfiguration, VideoFeedSource, VideoFeedTitleConfiguration, VideoFeedTitlePosition, VideoLaunchBehavior, VideoPlaybackCallback, VideoPlaybackDetails, VideoPlaybackEvent, VideoPlaybackEventName, VideoPlayerCompleteAction, VideoPlayerConfiguration, VideoPlayerCTADelay, VideoPlayerCTADelayType, VideoPlayerCTAStyle, VideoPlayerCTAWidth, VideoPlayerSize, VideoPlayerStyle, VideoShopping, };
@@ -0,0 +1,8 @@
1
+ export interface RNAppProps {
2
+ initialRouteName?: string;
3
+ initialParams?: any;
4
+ }
5
+ export default interface PushRNContainerParams {
6
+ appKey: string;
7
+ appProps?: RNAppProps;
8
+ }
@@ -1,5 +1,8 @@
1
1
  import { NativeEventEmitter, NativeModule } from 'react-native';
2
+ import type PushRNContainerParams from '../models/PushRNContainerParams';
2
3
  interface IFWNavigatorModule extends NativeModule {
4
+ pushRNContainer(params: PushRNContainerParams): Promise<boolean>;
5
+ popRNContainer(): Promise<boolean>;
3
6
  popNativeContainer(): Promise<boolean>;
4
7
  canPopNativeContainer(): Promise<boolean>;
5
8
  startFloatingPlayer(): Promise<boolean>;
@@ -6,6 +6,7 @@ import type VideoPlayerNativeConfiguration from '../models/VideoPlayerNativeConf
6
6
  interface IFireworkSDKModule extends NativeModule {
7
7
  init(options?: SDKInitOptions): Promise<any>;
8
8
  openVideoPlayer(url: string, config?: VideoPlayerNativeConfiguration): void;
9
+ setVideoFeedClickCallbackEnabled(enabled: boolean): void;
9
10
  setCustomCTAClickEnabled(enabled: boolean): void;
10
11
  setShareBaseURL(url?: string): Promise<any>;
11
12
  setVideoPlaybackEventEnabled(enabled: boolean): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-firework-sdk",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "Firework React Native SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -1,4 +1,5 @@
1
1
  import { FWEventName } from './models/FWEventName';
2
+ import type PushRNContainerParams from './models/PushRNContainerParams';
2
3
  import FWNavigatorModule, {
3
4
  FWNavigatorModuleEventEmitter,
4
5
  } from './modules/FWNavigatorModule';
@@ -22,6 +23,25 @@ class FWNavigator {
22
23
  FWNavigatorModuleEventEmitter.addListener(FWEventName.LogMessage, () => {});
23
24
  }
24
25
 
26
+ /**
27
+ * Push a new RN container.
28
+ * You could use this method to make a RN page on top of
29
+ * SDK full-screen player.
30
+ * @param params {PushRNContainerParams}
31
+ * @returns {Promise<boolean>} The result of pushing a new Container.
32
+ */
33
+ public pushRNContainer(params: PushRNContainerParams): Promise<boolean> {
34
+ return FWNavigatorModule.pushRNContainer(params);
35
+ }
36
+
37
+ /**
38
+ * Pop the RN container you pushed before.
39
+ * @returns {Promise<boolean>} The result of popping a new Container.
40
+ */
41
+ public popRNContainer(): Promise<boolean> {
42
+ return FWNavigatorModule.popRNContainer();
43
+ }
44
+
25
45
  /**
26
46
  * Pop the native container. You could use the method to close the fullscreen player.
27
47
  * But if the enablePictureInPicture of the associated video feed is true,
@@ -48,7 +48,16 @@ class FireworkSDK {
48
48
  /**
49
49
  * the callback of clicking Video Feed.
50
50
  */
51
- public onVideoFeedClick?: VideoFeedClickCallback;
51
+ public get onVideoFeedClick(): VideoFeedClickCallback | undefined {
52
+ return this._onVideoFeedClick;
53
+ }
54
+ public set onVideoFeedClick(value: VideoFeedClickCallback | undefined) {
55
+ this._onVideoFeedClick = value;
56
+ if (Platform.OS === 'ios') {
57
+ FireworkSDKModule.setVideoFeedClickCallbackEnabled(!!value);
58
+ }
59
+ }
60
+ private _onVideoFeedClick?: VideoFeedClickCallback | undefined;
52
61
 
53
62
  /**
54
63
  * The callback of clicking custom CTA.
package/src/index.ts CHANGED
@@ -57,6 +57,8 @@ import type {
57
57
  } from './models/ProductInfoViewConfiguration';
58
58
  import type ProductUnit from './models/ProductUnit';
59
59
  import type { ProductPrice, ProductUnitOption } from './models/ProductUnit';
60
+ import type PushRNContainerParams from './models/PushRNContainerParams';
61
+ import type { RNAppProps } from './models/PushRNContainerParams';
60
62
  import type SDKInitOptions from './models/SDKInitOptions';
61
63
  import type { VideoLaunchBehavior } from './models/SDKInitOptions';
62
64
  import type ShoppingCTAResult from './models/ShoppingCTAResult';
@@ -131,6 +133,8 @@ export {
131
133
  ProductPrice,
132
134
  ProductUnit,
133
135
  ProductUnitOption,
136
+ PushRNContainerParams,
137
+ RNAppProps,
134
138
  SDKInitCallback,
135
139
  SDKInitEvent,
136
140
  SDKInitOptions,
@@ -0,0 +1,9 @@
1
+ export interface RNAppProps {
2
+ initialRouteName?: string;
3
+ initialParams?: any;
4
+ }
5
+
6
+ export default interface PushRNContainerParams {
7
+ appKey: string;
8
+ appProps?: RNAppProps;
9
+ }
@@ -1,6 +1,7 @@
1
- import { NativeEventEmitter, NativeModule } from 'react-native';
2
- import { NativeModules } from 'react-native';
1
+ import { NativeEventEmitter, NativeModule, NativeModules } from 'react-native';
2
+
3
3
  import { LINKING_ERROR } from '../constants/FWErrorMessage';
4
+ import type PushRNContainerParams from '../models/PushRNContainerParams';
4
5
 
5
6
  const FWNavigatorModule = NativeModules.FWNavigatorModule
6
7
  ? NativeModules.FWNavigatorModule
@@ -13,6 +14,8 @@ const FWNavigatorModule = NativeModules.FWNavigatorModule
13
14
  }
14
15
  );
15
16
  interface IFWNavigatorModule extends NativeModule {
17
+ pushRNContainer(params: PushRNContainerParams): Promise<boolean>;
18
+ popRNContainer(): Promise<boolean>;
16
19
  popNativeContainer(): Promise<boolean>;
17
20
  canPopNativeContainer(): Promise<boolean>;
18
21
  startFloatingPlayer(): Promise<boolean>;
@@ -20,6 +20,7 @@ const FireworkSDKModule = NativeModules.FireworkSDK
20
20
  interface IFireworkSDKModule extends NativeModule {
21
21
  init(options?: SDKInitOptions): Promise<any>;
22
22
  openVideoPlayer(url: string, config?: VideoPlayerNativeConfiguration): void;
23
+ setVideoFeedClickCallbackEnabled(enabled: boolean): void; // Only supported on iOS
23
24
  setCustomCTAClickEnabled(enabled: boolean): void;
24
25
  setShareBaseURL(url?: string): Promise<any>;
25
26
  setVideoPlaybackEventEnabled(enabled: boolean): void;