react-native-firework-sdk 1.1.0 → 1.2.0-beta.10
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.
- package/android/build.gradle +1 -1
- package/android/gradlew +0 -0
- package/android/src/main/AndroidManifest.xml +6 -1
- package/android/src/main/java/com/fireworksdk/bridge/{reactnative/FireworkSDKPackage.kt → FireworkSDKPackage.kt} +4 -2
- package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +19 -6
- package/android/src/main/java/com/fireworksdk/bridge/models/FWEventName.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModel.kt +2 -1
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedSource.kt +1 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/FWInitializationProvider.kt +99 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +6 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWNavigatorInterface.kt +10 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWVideoShoppingInterface.kt +2 -2
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FireworkSDKInterface.kt +3 -1
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWNavigatorModule.kt +53 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +4 -15
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +41 -7
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/pages/FWContainerActivity.kt +66 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWDataUtils.kt +119 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/utils/FWEventUtils.kt +50 -3
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWBundleUtils.kt +86 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWDateUtils.kt +15 -0
- package/android/src/main/java/com/fireworksdk/bridge/utils/FWVideoPlayerUtils.kt +12 -2
- package/android/src/main/res/layout/fw_bridge_fragment_container.xml +8 -0
- package/ios/Components/VideoFeed.swift +6 -25
- package/ios/Components/VideoFeedManager.m +1 -0
- package/ios/FireworkSdk.xcodeproj/project.pbxproj +202 -18
- package/ios/Models/NativeToRN/FireworkEventName.swift +1 -0
- package/ios/Models/RNToNative/RCTConvert+FireworkSDKModule.swift +0 -20
- package/ios/Models/RNToNative/RCTConvert+VideoFeed.swift +2 -1
- package/ios/Modules/FWNavigatorModule/FWNavigatorContainerViewController.swift +32 -0
- package/ios/Modules/FWNavigatorModule/FWNavigatorModule.m +17 -0
- package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +89 -0
- package/ios/Modules/FWNavigatorModule/FWNavigatorProtocol.swift +13 -0
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule+CTA.swift +24 -1
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +3 -1
- package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +51 -31
- package/ios/Modules/Shopping/CartViewController.swift +6 -1
- package/ios/Modules/Shopping/ShoppingModule.m +1 -2
- package/ios/Modules/Shopping/ShoppingModule.swift +10 -12
- package/lib/commonjs/FWNavigator.js +66 -0
- package/lib/commonjs/FWNavigator.js.map +1 -0
- package/lib/commonjs/FireworkSDK.js +59 -5
- package/lib/commonjs/FireworkSDK.js.map +1 -1
- package/lib/commonjs/LiveStream.js +2 -2
- package/lib/commonjs/LiveStream.js.map +1 -1
- package/lib/commonjs/VideoShopping.js +4 -18
- package/lib/commonjs/VideoShopping.js.map +1 -1
- package/lib/commonjs/components/FWVideoFeed.js.map +1 -1
- package/lib/commonjs/components/VideoFeed.js +33 -1
- package/lib/commonjs/components/VideoFeed.js.map +1 -1
- package/lib/commonjs/constants/FWErrorMessage.js.map +1 -1
- package/lib/commonjs/index.js +10 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/FWEventName.js +3 -2
- package/lib/commonjs/models/FWEventName.js.map +1 -1
- package/lib/commonjs/models/NewNativeContainerProps.js +2 -0
- package/lib/commonjs/models/{AdConfig.js.map → NewNativeContainerProps.js.map} +0 -0
- package/lib/commonjs/models/VideoFeedSource.js +0 -4
- package/lib/commonjs/modules/FWNavigatorModule.js +22 -0
- package/lib/commonjs/modules/FWNavigatorModule.js.map +1 -0
- package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
- package/lib/commonjs/modules/LiveStreamModule.js.map +1 -1
- package/lib/commonjs/modules/ShoppingModule.js.map +1 -1
- package/lib/commonjs/utils/FWLoggerUtil.js +45 -0
- package/lib/commonjs/utils/FWLoggerUtil.js.map +1 -0
- package/lib/module/FWNavigator.js +49 -0
- package/lib/module/FWNavigator.js.map +1 -0
- package/lib/module/FireworkSDK.js +54 -5
- package/lib/module/FireworkSDK.js.map +1 -1
- package/lib/module/LiveStream.js +4 -4
- package/lib/module/LiveStream.js.map +1 -1
- package/lib/module/VideoShopping.js +4 -18
- package/lib/module/VideoShopping.js.map +1 -1
- package/lib/module/components/FWVideoFeed.js +1 -1
- package/lib/module/components/FWVideoFeed.js.map +1 -1
- package/lib/module/components/VideoFeed.js +33 -1
- package/lib/module/components/VideoFeed.js.map +1 -1
- package/lib/module/constants/FWErrorMessage.js.map +1 -1
- package/lib/module/index.js +3 -5
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/FWEventName.js +3 -2
- package/lib/module/models/FWEventName.js.map +1 -1
- package/lib/module/models/NewNativeContainerProps.js +2 -0
- package/lib/module/models/{AdConfig.js.map → NewNativeContainerProps.js.map} +0 -0
- package/lib/module/models/VideoFeedSource.js +1 -1
- package/lib/module/modules/FWNavigatorModule.js +13 -0
- package/lib/module/modules/FWNavigatorModule.js.map +1 -0
- package/lib/module/modules/FireworkSDKModule.js.map +1 -1
- package/lib/module/modules/LiveStreamModule.js.map +1 -1
- package/lib/module/modules/ShoppingModule.js.map +1 -1
- package/lib/module/utils/FWLoggerUtil.js +36 -0
- package/lib/module/utils/FWLoggerUtil.js.map +1 -0
- package/lib/typescript/FWNavigator.d.ts +24 -0
- package/lib/typescript/FireworkSDK.d.ts +21 -4
- package/lib/typescript/LiveStream.d.ts +1 -1
- package/lib/typescript/VideoShopping.d.ts +2 -9
- package/lib/typescript/components/VideoFeed.d.ts +8 -1
- package/lib/typescript/constants/FWErrorMessage.d.ts +1 -1
- package/lib/typescript/index.d.ts +6 -5
- package/lib/typescript/models/FWEventName.d.ts +4 -3
- package/lib/typescript/models/FeedItemDetails.d.ts +1 -1
- package/lib/typescript/models/NewNativeContainerProps.d.ts +6 -0
- package/lib/typescript/models/VideoFeedConfiguration.d.ts +4 -0
- package/lib/typescript/models/VideoFeedSource.d.ts +1 -2
- package/lib/typescript/modules/FWNavigatorModule.d.ts +11 -0
- package/lib/typescript/modules/FireworkSDKModule.d.ts +5 -4
- package/lib/typescript/modules/ShoppingModule.d.ts +2 -2
- package/lib/typescript/utils/FWLoggerUtil.d.ts +6 -0
- package/package.json +3 -1
- package/react-native-firework-sdk.podspec +1 -1
- package/src/FWNavigator.tsx +49 -0
- package/src/FireworkSDK.ts +57 -8
- package/src/LiveStream.ts +9 -7
- package/src/VideoShopping.ts +10 -21
- package/src/components/FWVideoFeed.tsx +5 -5
- package/src/components/VideoFeed.tsx +48 -14
- package/src/constants/FWErrorMessage.ts +1 -3
- package/src/index.tsx +9 -10
- package/src/models/AdBadgeConfiguration.ts +1 -1
- package/src/models/FWError.ts +1 -1
- package/src/models/FWEventName.ts +3 -2
- package/src/models/FWEvents.ts +1 -1
- package/src/models/FeedItemDetails.ts +2 -2
- package/src/models/LiveStreamEventDetails.ts +1 -1
- package/src/models/LiveStreamMessageDetails.ts +1 -1
- package/src/models/NewNativeContainerProps.ts +4 -0
- package/src/models/VideoFeedConfiguration.ts +6 -2
- package/src/models/VideoFeedSource.ts +6 -2
- package/src/models/VideoPlayerConfiguration.ts +2 -2
- package/src/modules/FWNavigatorModule.ts +22 -0
- package/src/modules/FireworkSDKModule.ts +5 -6
- package/src/modules/LiveStreamModule.ts +1 -5
- package/src/modules/ShoppingModule.ts +5 -2
- package/src/utils/FWLoggerUtil.ts +40 -0
- package/android/src/main/java/com/fireworksdk/bridge/reactnative/pages/FWVideoShoppingCartActivity.kt +0 -43
- package/ios/Modules/FireworkSDKModule/MobileADConfiguration.swift +0 -17
- package/lib/commonjs/components/CartContainer.js +0 -35
- package/lib/commonjs/components/CartContainer.js.map +0 -1
- package/lib/commonjs/models/AdConfig.js +0 -2
- package/lib/module/components/CartContainer.js +0 -18
- package/lib/module/components/CartContainer.js.map +0 -1
- package/lib/module/models/AdConfig.js +0 -2
- package/lib/typescript/components/CartContainer.d.ts +0 -3
- package/lib/typescript/models/AdConfig.d.ts +0 -10
- package/src/components/CartContainer.tsx +0 -20
- package/src/models/AdConfig.ts +0 -10
|
@@ -7,10 +7,36 @@
|
|
|
7
7
|
objects = {
|
|
8
8
|
|
|
9
9
|
/* Begin PBXBuildFile section */
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
8975235E2817DEEE0070EBB6 /* VideoFeedManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523592817DEEE0070EBB6 /* VideoFeedManager.swift */; };
|
|
11
|
+
8975235F2817DEEE0070EBB6 /* VideoFeedConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8975235A2817DEEE0070EBB6 /* VideoFeedConfiguration.swift */; };
|
|
12
|
+
897523602817DEEE0070EBB6 /* VideoFeed.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8975235B2817DEEE0070EBB6 /* VideoFeed.swift */; };
|
|
13
|
+
897523612817DEEE0070EBB6 /* VideoPlayerConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8975235C2817DEEE0070EBB6 /* VideoPlayerConfiguration.swift */; };
|
|
14
|
+
897523622817DEEE0070EBB6 /* VideoFeedManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 8975235D2817DEEE0070EBB6 /* VideoFeedManager.m */; };
|
|
15
|
+
897523872817DEF80070EBB6 /* UIViewController+AttachChild.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523652817DEF80070EBB6 /* UIViewController+AttachChild.swift */; };
|
|
16
|
+
897523882817DEF80070EBB6 /* UIView+Constraints.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523662817DEF80070EBB6 /* UIView+Constraints.swift */; };
|
|
17
|
+
897523892817DEF80070EBB6 /* String+Color.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523672817DEF80070EBB6 /* String+Color.swift */; };
|
|
18
|
+
8975238A2817DEF80070EBB6 /* UIView+ParentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523682817DEF80070EBB6 /* UIView+ParentViewController.swift */; };
|
|
19
|
+
8975238B2817DEF80070EBB6 /* RCTConvert+FireworkSDKModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8975236B2817DEF80070EBB6 /* RCTConvert+FireworkSDKModule.swift */; };
|
|
20
|
+
8975238C2817DEF80070EBB6 /* RCTConvert+Shopping.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8975236C2817DEF80070EBB6 /* RCTConvert+Shopping.swift */; };
|
|
21
|
+
8975238D2817DEF80070EBB6 /* RCTConvert+VideoFeed.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8975236D2817DEF80070EBB6 /* RCTConvert+VideoFeed.swift */; };
|
|
22
|
+
8975238E2817DEF80070EBB6 /* FireworkSDK+Json.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8975236F2817DEF80070EBB6 /* FireworkSDK+Json.swift */; };
|
|
23
|
+
8975238F2817DEF80070EBB6 /* FireworkEventName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523702817DEF80070EBB6 /* FireworkEventName.swift */; };
|
|
24
|
+
897523902817DEF80070EBB6 /* FWNavigatorProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523732817DEF80070EBB6 /* FWNavigatorProtocol.swift */; };
|
|
25
|
+
897523912817DEF80070EBB6 /* FWNavigatorContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523742817DEF80070EBB6 /* FWNavigatorContainerViewController.swift */; };
|
|
26
|
+
897523922817DEF80070EBB6 /* FWNavigatorModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523752817DEF80070EBB6 /* FWNavigatorModule.swift */; };
|
|
27
|
+
897523932817DEF80070EBB6 /* FWNavigatorModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 897523762817DEF80070EBB6 /* FWNavigatorModule.m */; };
|
|
28
|
+
897523942817DEF80070EBB6 /* CartViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523782817DEF80070EBB6 /* CartViewController.swift */; };
|
|
29
|
+
897523952817DEF80070EBB6 /* ShoppingModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 897523792817DEF80070EBB6 /* ShoppingModule.m */; };
|
|
30
|
+
897523962817DEF80070EBB6 /* ProductInfoViewConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8975237A2817DEF80070EBB6 /* ProductInfoViewConfiguration.swift */; };
|
|
31
|
+
897523972817DEF80070EBB6 /* Product.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8975237B2817DEF80070EBB6 /* Product.swift */; };
|
|
32
|
+
897523982817DEF80070EBB6 /* ShoppingModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8975237C2817DEF80070EBB6 /* ShoppingModule.swift */; };
|
|
33
|
+
8975239A2817DEF80070EBB6 /* FireworkSDKModule+EventTracking.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8975237F2817DEF80070EBB6 /* FireworkSDKModule+EventTracking.swift */; };
|
|
34
|
+
8975239B2817DEF80070EBB6 /* FireworkSDKModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523802817DEF80070EBB6 /* FireworkSDKModule.swift */; };
|
|
35
|
+
8975239C2817DEF80070EBB6 /* AdBadgeConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523812817DEF80070EBB6 /* AdBadgeConfiguration.swift */; };
|
|
36
|
+
8975239D2817DEF80070EBB6 /* FireworkSDKModule+CTA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523822817DEF80070EBB6 /* FireworkSDKModule+CTA.swift */; };
|
|
37
|
+
8975239E2817DEF80070EBB6 /* FireworkSDKModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 897523832817DEF80070EBB6 /* FireworkSDKModule.m */; };
|
|
38
|
+
8975239F2817DEF80070EBB6 /* LiveStreamModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523852817DEF80070EBB6 /* LiveStreamModule.swift */; };
|
|
39
|
+
897523A02817DEF80070EBB6 /* LiveStreamModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 897523862817DEF80070EBB6 /* LiveStreamModule.m */; };
|
|
14
40
|
/* End PBXBuildFile section */
|
|
15
41
|
|
|
16
42
|
/* Begin PBXCopyFilesBuildPhase section */
|
|
@@ -27,12 +53,38 @@
|
|
|
27
53
|
|
|
28
54
|
/* Begin PBXFileReference section */
|
|
29
55
|
134814201AA4EA6300B7C361 /* libFireworkSdk.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFireworkSdk.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
30
|
-
1F6F71862771B48100224AF3 /* FireworkSdk+EventTracking.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FireworkSdk+EventTracking.swift"; sourceTree = "<group>"; };
|
|
31
|
-
1F6F71872771B48100224AF3 /* Models */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Models; sourceTree = "<group>"; };
|
|
32
|
-
1F6F71882771B48100224AF3 /* FireworkSdk.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FireworkSdk.swift; sourceTree = "<group>"; };
|
|
33
|
-
1F6F71892771B48100224AF3 /* FireworkSdk+CTA.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FireworkSdk+CTA.swift"; sourceTree = "<group>"; };
|
|
34
56
|
1F6F718A2771B48100224AF3 /* FireworkSdk-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "FireworkSdk-Bridging-Header.h"; sourceTree = "<group>"; };
|
|
35
|
-
|
|
57
|
+
897523592817DEEE0070EBB6 /* VideoFeedManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoFeedManager.swift; sourceTree = "<group>"; };
|
|
58
|
+
8975235A2817DEEE0070EBB6 /* VideoFeedConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoFeedConfiguration.swift; sourceTree = "<group>"; };
|
|
59
|
+
8975235B2817DEEE0070EBB6 /* VideoFeed.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoFeed.swift; sourceTree = "<group>"; };
|
|
60
|
+
8975235C2817DEEE0070EBB6 /* VideoPlayerConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoPlayerConfiguration.swift; sourceTree = "<group>"; };
|
|
61
|
+
8975235D2817DEEE0070EBB6 /* VideoFeedManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideoFeedManager.m; sourceTree = "<group>"; };
|
|
62
|
+
897523632817DEF80070EBB6 /* react_native_firework_sdk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = react_native_firework_sdk.h; sourceTree = "<group>"; };
|
|
63
|
+
897523652817DEF80070EBB6 /* UIViewController+AttachChild.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+AttachChild.swift"; sourceTree = "<group>"; };
|
|
64
|
+
897523662817DEF80070EBB6 /* UIView+Constraints.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Constraints.swift"; sourceTree = "<group>"; };
|
|
65
|
+
897523672817DEF80070EBB6 /* String+Color.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Color.swift"; sourceTree = "<group>"; };
|
|
66
|
+
897523682817DEF80070EBB6 /* UIView+ParentViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+ParentViewController.swift"; sourceTree = "<group>"; };
|
|
67
|
+
8975236B2817DEF80070EBB6 /* RCTConvert+FireworkSDKModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "RCTConvert+FireworkSDKModule.swift"; sourceTree = "<group>"; };
|
|
68
|
+
8975236C2817DEF80070EBB6 /* RCTConvert+Shopping.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "RCTConvert+Shopping.swift"; sourceTree = "<group>"; };
|
|
69
|
+
8975236D2817DEF80070EBB6 /* RCTConvert+VideoFeed.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "RCTConvert+VideoFeed.swift"; sourceTree = "<group>"; };
|
|
70
|
+
8975236F2817DEF80070EBB6 /* FireworkSDK+Json.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FireworkSDK+Json.swift"; sourceTree = "<group>"; };
|
|
71
|
+
897523702817DEF80070EBB6 /* FireworkEventName.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FireworkEventName.swift; sourceTree = "<group>"; };
|
|
72
|
+
897523732817DEF80070EBB6 /* FWNavigatorProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FWNavigatorProtocol.swift; sourceTree = "<group>"; };
|
|
73
|
+
897523742817DEF80070EBB6 /* FWNavigatorContainerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FWNavigatorContainerViewController.swift; sourceTree = "<group>"; };
|
|
74
|
+
897523752817DEF80070EBB6 /* FWNavigatorModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FWNavigatorModule.swift; sourceTree = "<group>"; };
|
|
75
|
+
897523762817DEF80070EBB6 /* FWNavigatorModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FWNavigatorModule.m; sourceTree = "<group>"; };
|
|
76
|
+
897523782817DEF80070EBB6 /* CartViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CartViewController.swift; sourceTree = "<group>"; };
|
|
77
|
+
897523792817DEF80070EBB6 /* ShoppingModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShoppingModule.m; sourceTree = "<group>"; };
|
|
78
|
+
8975237A2817DEF80070EBB6 /* ProductInfoViewConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductInfoViewConfiguration.swift; sourceTree = "<group>"; };
|
|
79
|
+
8975237B2817DEF80070EBB6 /* Product.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Product.swift; sourceTree = "<group>"; };
|
|
80
|
+
8975237C2817DEF80070EBB6 /* ShoppingModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShoppingModule.swift; sourceTree = "<group>"; };
|
|
81
|
+
8975237F2817DEF80070EBB6 /* FireworkSDKModule+EventTracking.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FireworkSDKModule+EventTracking.swift"; sourceTree = "<group>"; };
|
|
82
|
+
897523802817DEF80070EBB6 /* FireworkSDKModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FireworkSDKModule.swift; sourceTree = "<group>"; };
|
|
83
|
+
897523812817DEF80070EBB6 /* AdBadgeConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AdBadgeConfiguration.swift; sourceTree = "<group>"; };
|
|
84
|
+
897523822817DEF80070EBB6 /* FireworkSDKModule+CTA.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FireworkSDKModule+CTA.swift"; sourceTree = "<group>"; };
|
|
85
|
+
897523832817DEF80070EBB6 /* FireworkSDKModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FireworkSDKModule.m; sourceTree = "<group>"; };
|
|
86
|
+
897523852817DEF80070EBB6 /* LiveStreamModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiveStreamModule.swift; sourceTree = "<group>"; };
|
|
87
|
+
897523862817DEF80070EBB6 /* LiveStreamModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LiveStreamModule.m; sourceTree = "<group>"; };
|
|
36
88
|
/* End PBXFileReference section */
|
|
37
89
|
|
|
38
90
|
/* Begin PBXFrameworksBuildPhase section */
|
|
@@ -58,15 +110,121 @@
|
|
|
58
110
|
isa = PBXGroup;
|
|
59
111
|
children = (
|
|
60
112
|
1F6F718A2771B48100224AF3 /* FireworkSdk-Bridging-Header.h */,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
1F6F71872771B48100224AF3 /* Models */,
|
|
113
|
+
897523632817DEF80070EBB6 /* react_native_firework_sdk.h */,
|
|
114
|
+
897523582817DEEE0070EBB6 /* Components */,
|
|
115
|
+
897523692817DEF80070EBB6 /* Models */,
|
|
116
|
+
897523712817DEF80070EBB6 /* Modules */,
|
|
66
117
|
134814211AA4EA7D00B7C361 /* Products */,
|
|
118
|
+
897523642817DEF80070EBB6 /* Utils */,
|
|
67
119
|
);
|
|
68
120
|
sourceTree = "<group>";
|
|
69
121
|
};
|
|
122
|
+
897523582817DEEE0070EBB6 /* Components */ = {
|
|
123
|
+
isa = PBXGroup;
|
|
124
|
+
children = (
|
|
125
|
+
897523592817DEEE0070EBB6 /* VideoFeedManager.swift */,
|
|
126
|
+
8975235A2817DEEE0070EBB6 /* VideoFeedConfiguration.swift */,
|
|
127
|
+
8975235B2817DEEE0070EBB6 /* VideoFeed.swift */,
|
|
128
|
+
8975235C2817DEEE0070EBB6 /* VideoPlayerConfiguration.swift */,
|
|
129
|
+
8975235D2817DEEE0070EBB6 /* VideoFeedManager.m */,
|
|
130
|
+
);
|
|
131
|
+
path = Components;
|
|
132
|
+
sourceTree = "<group>";
|
|
133
|
+
};
|
|
134
|
+
897523642817DEF80070EBB6 /* Utils */ = {
|
|
135
|
+
isa = PBXGroup;
|
|
136
|
+
children = (
|
|
137
|
+
897523652817DEF80070EBB6 /* UIViewController+AttachChild.swift */,
|
|
138
|
+
897523662817DEF80070EBB6 /* UIView+Constraints.swift */,
|
|
139
|
+
897523672817DEF80070EBB6 /* String+Color.swift */,
|
|
140
|
+
897523682817DEF80070EBB6 /* UIView+ParentViewController.swift */,
|
|
141
|
+
);
|
|
142
|
+
path = Utils;
|
|
143
|
+
sourceTree = "<group>";
|
|
144
|
+
};
|
|
145
|
+
897523692817DEF80070EBB6 /* Models */ = {
|
|
146
|
+
isa = PBXGroup;
|
|
147
|
+
children = (
|
|
148
|
+
8975236A2817DEF80070EBB6 /* RNToNative */,
|
|
149
|
+
8975236E2817DEF80070EBB6 /* NativeToRN */,
|
|
150
|
+
);
|
|
151
|
+
path = Models;
|
|
152
|
+
sourceTree = "<group>";
|
|
153
|
+
};
|
|
154
|
+
8975236A2817DEF80070EBB6 /* RNToNative */ = {
|
|
155
|
+
isa = PBXGroup;
|
|
156
|
+
children = (
|
|
157
|
+
8975236B2817DEF80070EBB6 /* RCTConvert+FireworkSDKModule.swift */,
|
|
158
|
+
8975236C2817DEF80070EBB6 /* RCTConvert+Shopping.swift */,
|
|
159
|
+
8975236D2817DEF80070EBB6 /* RCTConvert+VideoFeed.swift */,
|
|
160
|
+
);
|
|
161
|
+
path = RNToNative;
|
|
162
|
+
sourceTree = "<group>";
|
|
163
|
+
};
|
|
164
|
+
8975236E2817DEF80070EBB6 /* NativeToRN */ = {
|
|
165
|
+
isa = PBXGroup;
|
|
166
|
+
children = (
|
|
167
|
+
8975236F2817DEF80070EBB6 /* FireworkSDK+Json.swift */,
|
|
168
|
+
897523702817DEF80070EBB6 /* FireworkEventName.swift */,
|
|
169
|
+
);
|
|
170
|
+
path = NativeToRN;
|
|
171
|
+
sourceTree = "<group>";
|
|
172
|
+
};
|
|
173
|
+
897523712817DEF80070EBB6 /* Modules */ = {
|
|
174
|
+
isa = PBXGroup;
|
|
175
|
+
children = (
|
|
176
|
+
897523722817DEF80070EBB6 /* FWNavigatorModule */,
|
|
177
|
+
897523772817DEF80070EBB6 /* Shopping */,
|
|
178
|
+
8975237D2817DEF80070EBB6 /* FireworkSDKModule */,
|
|
179
|
+
897523842817DEF80070EBB6 /* LiveStream */,
|
|
180
|
+
);
|
|
181
|
+
path = Modules;
|
|
182
|
+
sourceTree = "<group>";
|
|
183
|
+
};
|
|
184
|
+
897523722817DEF80070EBB6 /* FWNavigatorModule */ = {
|
|
185
|
+
isa = PBXGroup;
|
|
186
|
+
children = (
|
|
187
|
+
897523732817DEF80070EBB6 /* FWNavigatorProtocol.swift */,
|
|
188
|
+
897523742817DEF80070EBB6 /* FWNavigatorContainerViewController.swift */,
|
|
189
|
+
897523752817DEF80070EBB6 /* FWNavigatorModule.swift */,
|
|
190
|
+
897523762817DEF80070EBB6 /* FWNavigatorModule.m */,
|
|
191
|
+
);
|
|
192
|
+
path = FWNavigatorModule;
|
|
193
|
+
sourceTree = "<group>";
|
|
194
|
+
};
|
|
195
|
+
897523772817DEF80070EBB6 /* Shopping */ = {
|
|
196
|
+
isa = PBXGroup;
|
|
197
|
+
children = (
|
|
198
|
+
897523782817DEF80070EBB6 /* CartViewController.swift */,
|
|
199
|
+
897523792817DEF80070EBB6 /* ShoppingModule.m */,
|
|
200
|
+
8975237A2817DEF80070EBB6 /* ProductInfoViewConfiguration.swift */,
|
|
201
|
+
8975237B2817DEF80070EBB6 /* Product.swift */,
|
|
202
|
+
8975237C2817DEF80070EBB6 /* ShoppingModule.swift */,
|
|
203
|
+
);
|
|
204
|
+
path = Shopping;
|
|
205
|
+
sourceTree = "<group>";
|
|
206
|
+
};
|
|
207
|
+
8975237D2817DEF80070EBB6 /* FireworkSDKModule */ = {
|
|
208
|
+
isa = PBXGroup;
|
|
209
|
+
children = (
|
|
210
|
+
8975237F2817DEF80070EBB6 /* FireworkSDKModule+EventTracking.swift */,
|
|
211
|
+
897523802817DEF80070EBB6 /* FireworkSDKModule.swift */,
|
|
212
|
+
897523812817DEF80070EBB6 /* AdBadgeConfiguration.swift */,
|
|
213
|
+
897523822817DEF80070EBB6 /* FireworkSDKModule+CTA.swift */,
|
|
214
|
+
897523832817DEF80070EBB6 /* FireworkSDKModule.m */,
|
|
215
|
+
);
|
|
216
|
+
path = FireworkSDKModule;
|
|
217
|
+
sourceTree = "<group>";
|
|
218
|
+
};
|
|
219
|
+
897523842817DEF80070EBB6 /* LiveStream */ = {
|
|
220
|
+
isa = PBXGroup;
|
|
221
|
+
children = (
|
|
222
|
+
897523852817DEF80070EBB6 /* LiveStreamModule.swift */,
|
|
223
|
+
897523862817DEF80070EBB6 /* LiveStreamModule.m */,
|
|
224
|
+
);
|
|
225
|
+
path = LiveStream;
|
|
226
|
+
sourceTree = "<group>";
|
|
227
|
+
};
|
|
70
228
|
/* End PBXGroup section */
|
|
71
229
|
|
|
72
230
|
/* Begin PBXNativeTarget section */
|
|
@@ -124,10 +282,36 @@
|
|
|
124
282
|
isa = PBXSourcesBuildPhase;
|
|
125
283
|
buildActionMask = 2147483647;
|
|
126
284
|
files = (
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
285
|
+
8975238A2817DEF80070EBB6 /* UIView+ParentViewController.swift in Sources */,
|
|
286
|
+
8975239B2817DEF80070EBB6 /* FireworkSDKModule.swift in Sources */,
|
|
287
|
+
897523952817DEF80070EBB6 /* ShoppingModule.m in Sources */,
|
|
288
|
+
897523A02817DEF80070EBB6 /* LiveStreamModule.m in Sources */,
|
|
289
|
+
8975238E2817DEF80070EBB6 /* FireworkSDK+Json.swift in Sources */,
|
|
290
|
+
8975235F2817DEEE0070EBB6 /* VideoFeedConfiguration.swift in Sources */,
|
|
291
|
+
897523612817DEEE0070EBB6 /* VideoPlayerConfiguration.swift in Sources */,
|
|
292
|
+
897523972817DEF80070EBB6 /* Product.swift in Sources */,
|
|
293
|
+
897523932817DEF80070EBB6 /* FWNavigatorModule.m in Sources */,
|
|
294
|
+
897523922817DEF80070EBB6 /* FWNavigatorModule.swift in Sources */,
|
|
295
|
+
897523872817DEF80070EBB6 /* UIViewController+AttachChild.swift in Sources */,
|
|
296
|
+
897523902817DEF80070EBB6 /* FWNavigatorProtocol.swift in Sources */,
|
|
297
|
+
897523882817DEF80070EBB6 /* UIView+Constraints.swift in Sources */,
|
|
298
|
+
897523982817DEF80070EBB6 /* ShoppingModule.swift in Sources */,
|
|
299
|
+
8975239C2817DEF80070EBB6 /* AdBadgeConfiguration.swift in Sources */,
|
|
300
|
+
897523942817DEF80070EBB6 /* CartViewController.swift in Sources */,
|
|
301
|
+
8975239A2817DEF80070EBB6 /* FireworkSDKModule+EventTracking.swift in Sources */,
|
|
302
|
+
8975239E2817DEF80070EBB6 /* FireworkSDKModule.m in Sources */,
|
|
303
|
+
897523962817DEF80070EBB6 /* ProductInfoViewConfiguration.swift in Sources */,
|
|
304
|
+
8975238D2817DEF80070EBB6 /* RCTConvert+VideoFeed.swift in Sources */,
|
|
305
|
+
8975238C2817DEF80070EBB6 /* RCTConvert+Shopping.swift in Sources */,
|
|
306
|
+
897523602817DEEE0070EBB6 /* VideoFeed.swift in Sources */,
|
|
307
|
+
8975235E2817DEEE0070EBB6 /* VideoFeedManager.swift in Sources */,
|
|
308
|
+
8975239D2817DEF80070EBB6 /* FireworkSDKModule+CTA.swift in Sources */,
|
|
309
|
+
897523892817DEF80070EBB6 /* String+Color.swift in Sources */,
|
|
310
|
+
897523622817DEEE0070EBB6 /* VideoFeedManager.m in Sources */,
|
|
311
|
+
897523912817DEF80070EBB6 /* FWNavigatorContainerViewController.swift in Sources */,
|
|
312
|
+
8975238F2817DEF80070EBB6 /* FireworkEventName.swift in Sources */,
|
|
313
|
+
8975238B2817DEF80070EBB6 /* RCTConvert+FireworkSDKModule.swift in Sources */,
|
|
314
|
+
8975239F2817DEF80070EBB6 /* LiveStreamModule.swift in Sources */,
|
|
131
315
|
);
|
|
132
316
|
runOnlyForDeploymentPostprocessing = 0;
|
|
133
317
|
};
|
|
@@ -15,6 +15,7 @@ enum FWEventName: String, CaseIterable {
|
|
|
15
15
|
case VideoFeedClick = "fw:video-feed-click"
|
|
16
16
|
case ShareBaseURLUpdated = "fw:share-base-url-updated" //emitted in JS side
|
|
17
17
|
case AdBadgeConfigurationUpdated = "fw:ad-badge-configuration-updated" //emitted in JS side
|
|
18
|
+
case LogMessage = "fw:log-message"
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
enum VideoPlaybackSubEventName: String {
|
|
@@ -69,26 +69,6 @@ extension RCTConvert {
|
|
|
69
69
|
return btnContentConfig
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
static func mobileADConfiguration(_ config: [String: AnyObject]?) -> MobileADConfiguration? {
|
|
73
|
-
guard let rConfig = config else {
|
|
74
|
-
return nil
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
let jsonData = try? JSONSerialization.data(withJSONObject: rConfig, options: .prettyPrinted)
|
|
78
|
-
guard let rJsonData = jsonData else {
|
|
79
|
-
return nil
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
var result: MobileADConfiguration?
|
|
83
|
-
do {
|
|
84
|
-
result = try JSONDecoder().decode(MobileADConfiguration.self, from: rJsonData)
|
|
85
|
-
} catch let error {
|
|
86
|
-
print(error.localizedDescription)
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return result
|
|
90
|
-
}
|
|
91
|
-
|
|
92
72
|
static func adBadgeConfiguration(_ config: [String: AnyObject]?) -> AdBadgeConfiguration? {
|
|
93
73
|
guard let rConfig = config else {
|
|
94
74
|
return nil
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//
|
|
2
|
+
// FWNavigatorContainerViewController.swift
|
|
3
|
+
// react-native-firework-sdk
|
|
4
|
+
//
|
|
5
|
+
// Created by Big Bear Xiong on 2022/4/22.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import UIKit
|
|
9
|
+
|
|
10
|
+
class FWNavigatorContainerViewController: UIViewController {
|
|
11
|
+
var moduleName: String = ""
|
|
12
|
+
var properties: [String: Any] = [:]
|
|
13
|
+
|
|
14
|
+
override func viewDidLoad() {
|
|
15
|
+
super.viewDidLoad()
|
|
16
|
+
loadContent()
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
private func loadContent() {
|
|
20
|
+
let rctRootView = RCTRootView.init(bridge: RCTBridge.current(), moduleName: moduleName, initialProperties: properties)
|
|
21
|
+
view.addSubview(rctRootView)
|
|
22
|
+
rctRootView.translatesAutoresizingMaskIntoConstraints = false
|
|
23
|
+
|
|
24
|
+
NSLayoutConstraint.activate([
|
|
25
|
+
rctRootView.leftAnchor.constraint(equalTo: view.leftAnchor),
|
|
26
|
+
rctRootView.topAnchor.constraint(equalTo: view.topAnchor),
|
|
27
|
+
rctRootView.rightAnchor.constraint(equalTo: view.rightAnchor),
|
|
28
|
+
rctRootView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
|
|
29
|
+
])
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// FWNavigatorModule.m
|
|
3
|
+
// react-native-firework-sdk
|
|
4
|
+
//
|
|
5
|
+
// Created by Big Bear Xiong on 2022/4/22.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// The FireworkNavigatorModule exposes instances of Objective-C (native) classes to JavaScript (JS) as JS objects
|
|
9
|
+
|
|
10
|
+
#import <React/RCTBridgeModule.h>
|
|
11
|
+
|
|
12
|
+
@interface RCT_EXTERN_REMAP_MODULE(FWNavigatorModule, FWNavigatorModule, NSObject)
|
|
13
|
+
|
|
14
|
+
RCT_EXTERN_METHOD(pushNativeContainer:(NSDictionary *)props resolver:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
15
|
+
RCT_EXTERN_METHOD(popNativeContainer:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
16
|
+
|
|
17
|
+
@end
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
//
|
|
2
|
+
// File.swift
|
|
3
|
+
// react-native-firework-sdk
|
|
4
|
+
//
|
|
5
|
+
// Created by Big Bear Xiong on 2022/4/21.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import FireworkVideo
|
|
9
|
+
|
|
10
|
+
@objc(FWNavigatorModule)
|
|
11
|
+
class FWNavigatorModule: RCTEventEmitter, FWNavigator {
|
|
12
|
+
override func supportedEvents() -> [String]! {
|
|
13
|
+
return [FWEventName.LogMessage.rawValue]
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
override class func requiresMainQueueSetup() -> Bool {
|
|
17
|
+
return true
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@objc(pushNativeContainer:resolver:rejecter:)
|
|
21
|
+
func pushNativeContainer(_ props: NSDictionary?, resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock) {
|
|
22
|
+
#if DEBUG
|
|
23
|
+
let formatter = DateFormatter()
|
|
24
|
+
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
|
|
25
|
+
sendEvent(withName: FWEventName.LogMessage.rawValue, body: ["message": "[iOS] Enter pushNativeContainer \(formatter.string(from: Date()))"])
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
DispatchQueue.main.async {
|
|
29
|
+
guard let props = props as? [String: Any] else {
|
|
30
|
+
resolver(false)
|
|
31
|
+
return
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
guard let appComponentName = gAppComponentName else {
|
|
35
|
+
resolver(false)
|
|
36
|
+
return
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
guard let presentedVC = RCTPresentedViewController() else {
|
|
40
|
+
resolver(false)
|
|
41
|
+
return
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
#if DEBUG
|
|
45
|
+
self.sendEvent(withName: FWEventName.LogMessage.rawValue, body: ["message": "[iOS] Before creating containerViewController \(formatter.string(from: Date()))"])
|
|
46
|
+
#endif
|
|
47
|
+
|
|
48
|
+
let containerViewController = FWNavigatorContainerViewController()
|
|
49
|
+
|
|
50
|
+
#if DEBUG
|
|
51
|
+
self.sendEvent(withName: FWEventName.LogMessage.rawValue, body: ["message": "[iOS] After creating containerViewController \(formatter.string(from: Date()))"])
|
|
52
|
+
#endif
|
|
53
|
+
|
|
54
|
+
containerViewController.moduleName = appComponentName
|
|
55
|
+
containerViewController.properties = props
|
|
56
|
+
containerViewController.modalPresentationStyle = .fullScreen
|
|
57
|
+
|
|
58
|
+
#if DEBUG
|
|
59
|
+
self.sendEvent(withName: FWEventName.LogMessage.rawValue, body: ["message": "[iOS] Present containerViewController \(formatter.string(from: Date()))"])
|
|
60
|
+
#endif
|
|
61
|
+
|
|
62
|
+
presentedVC.present(containerViewController, animated: true) {
|
|
63
|
+
#if DEBUG
|
|
64
|
+
self.sendEvent(withName: FWEventName.LogMessage.rawValue, body: ["message": "[iOS] Finish presenting containerViewController \(formatter.string(from: Date()))"])
|
|
65
|
+
#endif
|
|
66
|
+
|
|
67
|
+
resolver(true)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@objc(popNativeContainer:rejecter:)
|
|
73
|
+
func popNativeContainer(resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock) {
|
|
74
|
+
DispatchQueue.main.async {
|
|
75
|
+
if let presentedVC = RCTPresentedViewController() as? FWNavigatorContainerViewController {
|
|
76
|
+
presentedVC.dismiss(animated: true) {
|
|
77
|
+
resolver(true)
|
|
78
|
+
}
|
|
79
|
+
} else if let cartViewController = gCartViewController {
|
|
80
|
+
cartViewController.navigationController?.popViewController(animated: true)
|
|
81
|
+
gCartViewController = nil
|
|
82
|
+
resolver(true)
|
|
83
|
+
} else {
|
|
84
|
+
resolver(false)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//
|
|
2
|
+
// FWNavigatorProtocol.swift
|
|
3
|
+
// react-native-firework-sdk
|
|
4
|
+
//
|
|
5
|
+
// Created by Big Bear Xiong on 2022/4/21.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
|
|
10
|
+
protocol FWNavigator {
|
|
11
|
+
func pushNativeContainer(_ props: NSDictionary?, resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock)
|
|
12
|
+
func popNativeContainer(resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock)
|
|
13
|
+
}
|
|
@@ -10,8 +10,31 @@ import FireworkVideo
|
|
|
10
10
|
|
|
11
11
|
extension FireworkSDKModule: FireworkVideoCTADelegate {
|
|
12
12
|
func handleCustomCTAClick(_ viewController: PlayerViewController, url: URL) -> Bool {
|
|
13
|
+
#if DEBUG
|
|
14
|
+
let formatter = DateFormatter()
|
|
15
|
+
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
|
|
16
|
+
sendEvent(withName: FWEventName.LogMessage.rawValue, body: ["message": "[iOS] Receive CustomCTAClick event \(formatter.string(from: Date()))"])
|
|
17
|
+
#endif
|
|
18
|
+
|
|
13
19
|
sendEvent(withName: FWEventName.CustomCTAClick.rawValue, body: ["url": url.absoluteString])
|
|
20
|
+
|
|
21
|
+
var customCTALinkContentPageEnabled = false
|
|
22
|
+
if let moduleName = gAppComponentName,
|
|
23
|
+
let initialRouteName = customCTALinkContentPageRouteName,
|
|
24
|
+
let presentedVC = RCTPresentedViewController() {
|
|
25
|
+
customCTALinkContentPageEnabled = true
|
|
26
|
+
let containerViewController = FWNavigatorContainerViewController()
|
|
27
|
+
containerViewController.moduleName = moduleName
|
|
28
|
+
containerViewController.properties = [
|
|
29
|
+
"initialRouteName": initialRouteName,
|
|
30
|
+
"initialParams": ["url": url.absoluteString]
|
|
31
|
+
]
|
|
32
|
+
containerViewController.modalPresentationStyle = .fullScreen
|
|
33
|
+
presentedVC.present(containerViewController, animated: true) {
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
}
|
|
14
37
|
|
|
15
|
-
return customCTAClickEnabled
|
|
38
|
+
return customCTAClickEnabled || customCTALinkContentPageEnabled
|
|
16
39
|
}
|
|
17
40
|
}
|
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
@interface RCT_EXTERN_REMAP_MODULE(FireworkSDK, FireworkSDKModule, NSObject)
|
|
12
12
|
|
|
13
|
-
_RCT_EXTERN_REMAP_METHOD(init, initializeSDK:(NSString * __nullable)userId
|
|
13
|
+
_RCT_EXTERN_REMAP_METHOD(init, initializeSDK:(NSString * __nullable)userId, NO)
|
|
14
14
|
RCT_EXTERN_METHOD(openVideoPlayer:(NSString *)url config:(NSDictionary *)config)
|
|
15
15
|
RCT_EXTERN_METHOD(setCustomCTAClickEnabled:(BOOL)enabled)
|
|
16
|
+
RCT_EXTERN_METHOD(setCustomCTALinkContentPageRouteName:(NSString *)name resolver: (RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
16
17
|
RCT_EXTERN_METHOD(setShareBaseURL:(NSString *)url resolver: (RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
17
18
|
RCT_EXTERN_METHOD(setVideoPlaybackEventEnabled:(BOOL)enabled)
|
|
18
19
|
RCT_EXTERN_METHOD(setAdBadgeConfiguration:(NSDictionary *)config resolver: (RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
20
|
+
RCT_EXTERN_METHOD(setAppComponentName:(NSString *)name resolver: (RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
|
|
19
21
|
|
|
20
22
|
@end
|
|
@@ -9,21 +9,17 @@
|
|
|
9
9
|
|
|
10
10
|
import FireworkVideo
|
|
11
11
|
|
|
12
|
-
#if canImport(FireworkVideoGAMSupport)
|
|
13
|
-
import FireworkVideoGAMSupportSDK
|
|
14
|
-
#endif
|
|
15
|
-
#if canImport(FireworkVideoGIMASupport)
|
|
16
|
-
import FireworkVideoGIMASupport
|
|
17
|
-
#endif
|
|
18
|
-
|
|
19
12
|
var gShareBaseURL: String?
|
|
20
13
|
var gAdBadgeConfiguration: AdBadgeConfiguration?
|
|
14
|
+
var gAppComponentName: String?
|
|
21
15
|
|
|
22
16
|
@objc(FireworkSDKModule)
|
|
23
17
|
class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
|
|
24
18
|
// var shareBaseURL: String?
|
|
25
19
|
var customCTAClickEnabled: Bool = false
|
|
26
|
-
|
|
20
|
+
|
|
21
|
+
var customCTALinkContentPageRouteName: String?
|
|
22
|
+
|
|
27
23
|
/// Decide whether to send video playback event to RN.
|
|
28
24
|
var enableVideoPlayBackEvent: Bool = false
|
|
29
25
|
|
|
@@ -35,32 +31,13 @@ class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
|
|
|
35
31
|
return true
|
|
36
32
|
}
|
|
37
33
|
|
|
38
|
-
@objc(initializeSDK:
|
|
39
|
-
func initializeSDK(_ userId: String? = nil
|
|
34
|
+
@objc(initializeSDK:)
|
|
35
|
+
func initializeSDK(_ userId: String? = nil) {
|
|
40
36
|
DispatchQueue.main.async {
|
|
41
37
|
FireworkVideoSDK.initializeSDK(delegate: self, userID: userId)
|
|
42
38
|
FireworkVideoSDK.ctaDelegate = self
|
|
43
39
|
FireworkVideoSDK.eventTracking.videoPlaybackDelegate = self
|
|
44
40
|
FireworkVideoSDK.eventTracking.feedDelegate = self
|
|
45
|
-
|
|
46
|
-
if let config = RCTConvert.mobileADConfiguration(config) {
|
|
47
|
-
switch config.type {
|
|
48
|
-
case .admob:
|
|
49
|
-
#if canImport(FireworkVideoGAMSupport)
|
|
50
|
-
if let startMobileAds = config.startMobileAds {
|
|
51
|
-
FireworkVideoGAMSupportSDK.initializeSDK()
|
|
52
|
-
} else {
|
|
53
|
-
FireworkVideoGAMSupportSDK.initializeSDK(startGADMobileAds: false)
|
|
54
|
-
}
|
|
55
|
-
#endif
|
|
56
|
-
case .ima:
|
|
57
|
-
#if canImport(FireworkVideoGIMASupport)
|
|
58
|
-
FireworkVideoGIMASupportSDK.enableIMAAds()
|
|
59
|
-
#endif
|
|
60
|
-
default:
|
|
61
|
-
break
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
41
|
}
|
|
65
42
|
}
|
|
66
43
|
|
|
@@ -74,13 +51,20 @@ class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
|
|
|
74
51
|
if let baseUrl = gShareBaseURL {
|
|
75
52
|
finalConfig.shareButton.behavior.baseURL = URL(string: baseUrl)
|
|
76
53
|
}
|
|
54
|
+
|
|
55
|
+
var feedContentConfig = VideoFeedContentConfiguration()
|
|
56
|
+
feedContentConfig.playerView = finalConfig
|
|
57
|
+
if let adBadge = FireworkSDKModule.convertToFWAdBadgeConfiguration(gAdBadgeConfiguration) {
|
|
58
|
+
feedContentConfig.adBadge = adBadge;
|
|
59
|
+
}
|
|
77
60
|
|
|
78
61
|
DispatchQueue.main.async {
|
|
79
62
|
guard let presentedVC = RCTPresentedViewController() else {
|
|
80
63
|
return
|
|
81
64
|
}
|
|
82
|
-
|
|
83
|
-
|
|
65
|
+
|
|
66
|
+
VideoFeedViewController.openVideoPlayer(with: urlString, feedContentConfig, presentedVC) { _ in
|
|
67
|
+
|
|
84
68
|
}
|
|
85
69
|
}
|
|
86
70
|
}
|
|
@@ -89,6 +73,12 @@ class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
|
|
|
89
73
|
func setCustomCTAClickEnabled(_ enabled: Bool) {
|
|
90
74
|
customCTAClickEnabled = enabled
|
|
91
75
|
}
|
|
76
|
+
|
|
77
|
+
@objc(setCustomCTALinkContentPageRouteName:resolver:rejecter:)
|
|
78
|
+
func setCustomCTALinkContentPageRouteName(_ name: String, resolver: RCTPromiseResolveBlock, rejecter: RCTPromiseRejectBlock) {
|
|
79
|
+
customCTALinkContentPageRouteName = name
|
|
80
|
+
resolver([:])
|
|
81
|
+
}
|
|
92
82
|
|
|
93
83
|
@objc(setShareBaseURL:resolver:rejecter:)
|
|
94
84
|
func setShareBaseURL(_ url: String, resolver: RCTPromiseResolveBlock, rejecter: RCTPromiseRejectBlock) {
|
|
@@ -106,6 +96,12 @@ class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
|
|
|
106
96
|
gAdBadgeConfiguration = RCTConvert.adBadgeConfiguration(config)
|
|
107
97
|
resolver([:])
|
|
108
98
|
}
|
|
99
|
+
|
|
100
|
+
@objc(setAppComponentName:resolver:rejecter:)
|
|
101
|
+
func setAppComponentName(_ name: String, resolver: RCTPromiseResolveBlock, rejecter: RCTPromiseRejectBlock) {
|
|
102
|
+
gAppComponentName = name
|
|
103
|
+
resolver([:])
|
|
104
|
+
}
|
|
109
105
|
|
|
110
106
|
// MARK: - FireworkVideoSDKDelegate
|
|
111
107
|
func fireworkVideoDidLoadSuccessfully() {
|
|
@@ -116,3 +112,27 @@ class FireworkSDKModule: RCTEventEmitter, FireworkVideoSDKDelegate {
|
|
|
116
112
|
sendEvent(withName: FWEventName.SDKInit.rawValue, body: ["error": ["name": error.jsErrorName, "reason": error.recoverySuggestion ?? "default"]])
|
|
117
113
|
}
|
|
118
114
|
}
|
|
115
|
+
|
|
116
|
+
extension FireworkSDKModule {
|
|
117
|
+
static func convertToFWAdBadgeConfiguration(_ adBadgeConfiguration: AdBadgeConfiguration?) -> FireworkVideo.AdBadgeConfiguration? {
|
|
118
|
+
guard let adBadgeConfiguration = adBadgeConfiguration else {
|
|
119
|
+
return nil
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
var fwAdBadgeConfiguration = FireworkVideo.AdBadgeConfiguration()
|
|
123
|
+
if let textColor = adBadgeConfiguration.textColor {
|
|
124
|
+
fwAdBadgeConfiguration.textColor = textColor.uicolor()
|
|
125
|
+
}
|
|
126
|
+
if let backgroundColor = adBadgeConfiguration.backgroundColor {
|
|
127
|
+
fwAdBadgeConfiguration.backgroundColor = backgroundColor.uicolor()
|
|
128
|
+
}
|
|
129
|
+
switch adBadgeConfiguration.badgeTextType {
|
|
130
|
+
case .sponsored:
|
|
131
|
+
fwAdBadgeConfiguration.badgeText = FireworkVideo.AdBadgeConfiguration.BadgeText.sponsored
|
|
132
|
+
default:
|
|
133
|
+
fwAdBadgeConfiguration.badgeText = FireworkVideo.AdBadgeConfiguration.BadgeText.ad
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return fwAdBadgeConfiguration
|
|
137
|
+
}
|
|
138
|
+
}
|