react-native-firework-sdk 1.0.6-beta.2 → 1.1.2

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 (185) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +2 -40
  3. package/android/build.gradle +6 -3
  4. package/android/gradle.properties +2 -1
  5. package/android/proguard-rules.pro +22 -0
  6. package/android/publish.gradle +4 -3
  7. package/android/settings.gradle +1 -0
  8. package/android/src/main/AndroidManifest.xml +8 -2
  9. package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/FireworkSDKPackage.kt +10 -5
  10. package/android/src/main/java/com/fireworksdk/bridge/components/videofeed/FWVideoFeed.kt +226 -0
  11. package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/constants/FWCommandConstant.kt +1 -1
  12. package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/constants/FWVideoPlayerConstant.kt +13 -1
  13. package/android/src/main/java/com/fireworksdk/bridge/models/FWAdBadgeConfigModel.kt +9 -0
  14. package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWEventName.kt +10 -1
  15. package/android/src/main/java/com/fireworksdk/bridge/models/FWLiveStreamEventDetailsModel.kt +9 -0
  16. package/android/src/main/java/com/fireworksdk/bridge/models/FWLiveStreamMessageDetailsModel.kt +11 -0
  17. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedConfigModel.kt +28 -0
  18. package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoFeedItemDetailsModel.kt +2 -1
  19. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedModel.kt +7 -0
  20. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoFeedPropsModel.kt +18 -0
  21. package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoFeedSource.kt +2 -1
  22. package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoFeedTitlePosition.kt +1 -1
  23. package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoPlaybackDetails.kt +1 -1
  24. package/android/src/main/java/com/fireworksdk/bridge/models/FWVideoPlayerConfigModel.kt +23 -0
  25. package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/models/FWVideoShoppingProduct.kt +1 -1
  26. package/android/src/main/java/com/fireworksdk/bridge/models/WeakProperty.kt +19 -0
  27. package/android/src/main/java/com/fireworksdk/bridge/reactnative/FWInitializationProvider.kt +99 -0
  28. package/android/src/main/java/com/fireworksdk/bridge/reactnative/manager/FWVideoFeedManager.kt +175 -0
  29. package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWLiveStreamInterface.kt +5 -0
  30. package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/models/FWVideoShoppingInterface.kt +1 -1
  31. package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/models/FireworkSDKInterface.kt +4 -2
  32. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWLiveStreamModule.kt +88 -0
  33. package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/module/FWVideoShoppingModule.kt +20 -14
  34. package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/module/FireworkSDKModule.kt +23 -13
  35. package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/pages/FWVideoShoppingCartActivity.kt +4 -4
  36. package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge/reactnative}/utils/FWEventUtils.kt +46 -5
  37. package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/utils/FWJsonUtils.kt +1 -1
  38. package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/utils/FWLogUtils.kt +2 -2
  39. package/android/src/main/java/com/{reactnativefireworksdk → fireworksdk/bridge}/utils/FWUrlUtils.kt +1 -1
  40. package/android/src/main/java/com/fireworksdk/bridge/utils/FWVideoPlayerUtils.kt +94 -0
  41. package/android/src/main/res/layout/fw_bridge_fragment_playlistfeed.xml +18 -0
  42. package/android/src/main/res/layout/{fwrn_fragment_shoppingcart.xml → fw_bridge_fragment_shoppingcart.xml} +1 -1
  43. package/android/src/main/res/layout/{fwrn_fragment_videofeed.xml → fw_bridge_fragment_videofeed.xml} +2 -1
  44. package/android/src/main/res/values/colors.xml +4 -0
  45. package/ios/{Component → Components}/VideoFeed.swift +29 -0
  46. package/ios/{Component → Components}/VideoFeedConfiguration.swift +1 -0
  47. package/ios/{Component → Components}/VideoFeedManager.m +0 -0
  48. package/ios/{Component → Components}/VideoFeedManager.swift +0 -0
  49. package/ios/{Component → Components}/VideoPlayerConfiguration.swift +0 -0
  50. package/ios/Models/{FireworkJsEvent.swift → NativeToRN/FireworkEventName.swift} +20 -0
  51. package/ios/Models/{FireworkSDK+JsModel.swift → NativeToRN/FireworkSDK+Json.swift} +33 -3
  52. package/ios/Models/{RCTConvert+FireworkSDKModule.swift → RNToNative/RCTConvert+FireworkSDKModule.swift} +20 -0
  53. package/ios/Models/{RCTConvert+Shopping.swift → RNToNative/RCTConvert+Shopping.swift} +0 -0
  54. package/ios/Models/{RCTConvert+VideoFeed.swift → RNToNative/RCTConvert+VideoFeed.swift} +0 -0
  55. package/ios/Modules/FireworkSDKModule/AdBadgeConfiguration.swift +18 -0
  56. package/ios/Modules/FireworkSDKModule/FireworkSDKModule+CTA.swift +1 -1
  57. package/ios/Modules/FireworkSDKModule/FireworkSDKModule+EventTracking.swift +10 -19
  58. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.m +2 -1
  59. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +11 -3
  60. package/ios/Modules/LiveStream/LiveStreamModule.m +14 -0
  61. package/ios/Modules/LiveStream/LiveStreamModule.swift +43 -0
  62. package/lib/commonjs/FireworkSDK.js +61 -38
  63. package/lib/commonjs/FireworkSDK.js.map +1 -1
  64. package/lib/commonjs/LiveStream.js +60 -0
  65. package/lib/commonjs/LiveStream.js.map +1 -0
  66. package/lib/commonjs/VideoShopping.js +16 -15
  67. package/lib/commonjs/VideoShopping.js.map +1 -1
  68. package/lib/commonjs/components/VideoFeed.js +46 -2
  69. package/lib/commonjs/components/VideoFeed.js.map +1 -1
  70. package/lib/commonjs/index.js +24 -0
  71. package/lib/commonjs/index.js.map +1 -1
  72. package/lib/commonjs/models/AdBadgeConfiguration.js +2 -0
  73. package/lib/commonjs/models/{ADConfig.js.map → AdBadgeConfiguration.js.map} +0 -0
  74. package/lib/commonjs/models/AdConfig.js +2 -0
  75. package/lib/{module/models/ADConfig.js.map → commonjs/models/AdConfig.js.map} +0 -0
  76. package/lib/commonjs/models/FWEventName.js +24 -0
  77. package/lib/commonjs/models/FWEventName.js.map +1 -0
  78. package/lib/commonjs/models/FWEvents.js +0 -14
  79. package/lib/commonjs/models/FWEvents.js.map +1 -1
  80. package/lib/commonjs/models/LiveStreamChatEventName.js +15 -0
  81. package/lib/commonjs/models/LiveStreamChatEventName.js.map +1 -0
  82. package/lib/commonjs/models/LiveStreamEventDetails.js +2 -0
  83. package/lib/commonjs/models/LiveStreamEventDetails.js.map +1 -0
  84. package/lib/commonjs/models/LiveStreamEventName.js +17 -0
  85. package/lib/commonjs/models/LiveStreamEventName.js.map +1 -0
  86. package/lib/commonjs/models/LiveStreamMessageDetails.js +2 -0
  87. package/lib/commonjs/models/LiveStreamMessageDetails.js.map +1 -0
  88. package/lib/commonjs/models/VideoFeedSource.js +6 -0
  89. package/lib/commonjs/models/VideoFeedSource.js.map +1 -0
  90. package/lib/commonjs/models/VideoPlaybackEventName.js.map +1 -1
  91. package/lib/commonjs/modules/FireworkSDKModule.js +3 -1
  92. package/lib/commonjs/modules/FireworkSDKModule.js.map +1 -1
  93. package/lib/commonjs/modules/LiveStreamModule.js +22 -0
  94. package/lib/commonjs/modules/LiveStreamModule.js.map +1 -0
  95. package/lib/commonjs/modules/ShoppingModule.js +3 -1
  96. package/lib/commonjs/modules/ShoppingModule.js.map +1 -1
  97. package/lib/module/FireworkSDK.js +50 -34
  98. package/lib/module/FireworkSDK.js.map +1 -1
  99. package/lib/module/LiveStream.js +51 -0
  100. package/lib/module/LiveStream.js.map +1 -0
  101. package/lib/module/VideoShopping.js +10 -10
  102. package/lib/module/VideoShopping.js.map +1 -1
  103. package/lib/module/components/VideoFeed.js +41 -3
  104. package/lib/module/components/VideoFeed.js.map +1 -1
  105. package/lib/module/index.js +4 -1
  106. package/lib/module/index.js.map +1 -1
  107. package/lib/module/models/AdBadgeConfiguration.js +2 -0
  108. package/lib/module/models/AdBadgeConfiguration.js.map +1 -0
  109. package/lib/module/models/AdConfig.js +2 -0
  110. package/lib/module/models/AdConfig.js.map +1 -0
  111. package/lib/module/models/FWEventName.js +17 -0
  112. package/lib/module/models/FWEventName.js.map +1 -0
  113. package/lib/module/models/FWEvents.js +1 -12
  114. package/lib/module/models/FWEvents.js.map +1 -1
  115. package/lib/module/models/LiveStreamChatEventName.js +8 -0
  116. package/lib/module/models/LiveStreamChatEventName.js.map +1 -0
  117. package/lib/module/models/LiveStreamEventDetails.js +2 -0
  118. package/lib/module/models/LiveStreamEventDetails.js.map +1 -0
  119. package/lib/module/models/LiveStreamEventName.js +10 -0
  120. package/lib/module/models/LiveStreamEventName.js.map +1 -0
  121. package/lib/module/models/LiveStreamMessageDetails.js +2 -0
  122. package/lib/module/models/LiveStreamMessageDetails.js.map +1 -0
  123. package/lib/module/models/VideoFeedSource.js +2 -0
  124. package/lib/module/models/VideoFeedSource.js.map +1 -0
  125. package/lib/module/models/VideoPlaybackEventName.js.map +1 -1
  126. package/lib/module/modules/FireworkSDKModule.js +3 -0
  127. package/lib/module/modules/FireworkSDKModule.js.map +1 -1
  128. package/lib/module/modules/LiveStreamModule.js +12 -0
  129. package/lib/module/modules/LiveStreamModule.js.map +1 -0
  130. package/lib/module/modules/ShoppingModule.js +3 -1
  131. package/lib/module/modules/ShoppingModule.js.map +1 -1
  132. package/lib/typescript/FireworkSDK.d.ts +26 -24
  133. package/lib/typescript/LiveStream.d.ts +21 -0
  134. package/lib/typescript/VideoShopping.d.ts +5 -5
  135. package/lib/typescript/components/VideoFeed.d.ts +7 -4
  136. package/lib/typescript/index.d.ts +15 -6
  137. package/lib/typescript/models/AdBadgeConfiguration.d.ts +15 -0
  138. package/lib/typescript/models/{ADConfig.d.ts → AdConfig.d.ts} +1 -1
  139. package/lib/typescript/models/FWEventName.d.ts +14 -0
  140. package/lib/typescript/models/FWEvents.d.ts +14 -11
  141. package/lib/typescript/models/FeedItemDetails.d.ts +11 -4
  142. package/lib/typescript/models/LiveStreamChatEventName.d.ts +7 -0
  143. package/lib/typescript/models/LiveStreamEventDetails.d.ts +3 -0
  144. package/lib/typescript/models/LiveStreamEventName.d.ts +15 -0
  145. package/lib/typescript/models/LiveStreamMessageDetails.d.ts +14 -0
  146. package/lib/typescript/models/VideoFeedConfiguration.d.ts +7 -3
  147. package/lib/typescript/models/VideoFeedSource.d.ts +2 -0
  148. package/lib/typescript/models/VideoPlaybackDetails.d.ts +1 -2
  149. package/lib/typescript/models/VideoPlaybackEventName.d.ts +1 -1
  150. package/lib/typescript/models/VideoPlayerConfiguration.d.ts +5 -0
  151. package/lib/typescript/modules/FireworkSDKModule.d.ts +8 -4
  152. package/lib/typescript/modules/LiveStreamModule.d.ts +8 -0
  153. package/lib/typescript/modules/ShoppingModule.d.ts +3 -1
  154. package/package.json +3 -3
  155. package/react-native-firework-sdk.podspec +3 -1
  156. package/src/FireworkSDK.ts +49 -33
  157. package/src/LiveStream.ts +51 -0
  158. package/src/VideoShopping.ts +10 -9
  159. package/src/components/VideoFeed.tsx +63 -7
  160. package/src/index.tsx +31 -12
  161. package/src/models/AdBadgeConfiguration.ts +16 -0
  162. package/src/models/{ADConfig.ts → AdConfig.ts} +1 -1
  163. package/src/models/FWEventName.ts +14 -0
  164. package/src/models/FWEvents.ts +16 -12
  165. package/src/models/FeedItemDetails.ts +12 -4
  166. package/src/models/LiveStreamChatEventName.ts +8 -0
  167. package/src/models/LiveStreamEventDetails.ts +4 -0
  168. package/src/models/LiveStreamEventName.ts +16 -0
  169. package/src/models/LiveStreamMessageDetails.ts +14 -0
  170. package/src/models/VideoFeedConfiguration.ts +7 -3
  171. package/src/models/VideoFeedSource.ts +2 -0
  172. package/src/models/VideoPlaybackDetails.ts +1 -3
  173. package/src/models/VideoPlaybackEventName.ts +1 -1
  174. package/src/models/VideoPlayerConfiguration.ts +7 -1
  175. package/src/modules/FireworkSDKModule.ts +10 -4
  176. package/src/modules/LiveStreamModule.ts +26 -0
  177. package/src/modules/ShoppingModule.ts +13 -6
  178. package/android/src/main/java/com/reactnativefireworksdk/components/videofeed/FWVideoFeed.kt +0 -143
  179. package/android/src/main/java/com/reactnativefireworksdk/manager/FWVideoFeedManager.kt +0 -88
  180. package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoFeedConfigModel.kt +0 -27
  181. package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoFeedMode.kt +0 -7
  182. package/android/src/main/java/com/reactnativefireworksdk/models/FWVideoPlayerConfigModel.kt +0 -22
  183. package/android/src/main/java/com/reactnativefireworksdk/utils/FWVideoPlayerUtils.kt +0 -20
  184. package/lib/commonjs/models/ADConfig.js +0 -2
  185. package/lib/module/models/ADConfig.js +0 -2
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,41 +1,3 @@
1
- # react-native-firework-sdk
1
+ # Firework React Native SDK
2
2
 
3
- Firework React Native SDK
4
-
5
- ## Installation
6
-
7
- ```sh
8
- npm install react-native-firework-sdk
9
- # or
10
- yarn add react-native-firework-sdk
11
- ```
12
-
13
- ## Usage
14
-
15
- ### SDK Initialization
16
- ```ts
17
- /*
18
- Optional: set listener for SDK init
19
- */
20
- FireworkSDK.getInstance().onSDKInit = (event) => {
21
- console.log('onSDKInit', event);
22
- };
23
-
24
- /*
25
- It is recommended to call the init method when the application starts,
26
- for example, in the index.tsx.
27
- */
28
- FireworkSDK.getInstance().init();
29
- ```
30
-
31
- ### Video Feed Integration
32
- ```ts
33
- import {
34
- VideoFeed,
35
- } from 'react-native-firework-sdk';
36
-
37
- <VideoFeed
38
- style={{ height: 200 }}
39
- source="discover"
40
- />
41
- ```
3
+ Please refer to the integration guide here: https://docs.firework.tv/react-native-sdk/integration-guide
@@ -6,6 +6,7 @@ buildscript {
6
6
  google()
7
7
  mavenCentral()
8
8
  jcenter()
9
+ maven { url "https://jitpack.io" }
9
10
  }
10
11
 
11
12
  dependencies {
@@ -49,6 +50,7 @@ android {
49
50
  release {
50
51
  buildConfigField 'int', 'LOG_LEVEL', '7'
51
52
  minifyEnabled false
53
+ consumerProguardFiles 'proguard-rules.pro'
52
54
  }
53
55
  }
54
56
 
@@ -59,6 +61,7 @@ android {
59
61
  lintOptions {
60
62
  disable 'GradleCompatible'
61
63
  }
64
+
62
65
  compileOptions {
63
66
  sourceCompatibility JavaVersion.VERSION_1_8
64
67
  targetCompatibility JavaVersion.VERSION_1_8
@@ -77,10 +80,10 @@ android {
77
80
  // // buildType.name -> debug
78
81
  // // apkData.outputFileName -> ${project.name}-${buildType.name}.aar
79
82
  // if (variant.name == 'debug') {
80
- // apkData.outputFileName = "firework-react-native-sdk" + "-" + variant.name + ".aar"
83
+ // apkData.outputFileName = "fireworksdk_bridge" + "-" + variant.name + ".aar"
81
84
  // // apkData.outputFileName = apkData.outputFileName.replace(".aar","-" + name + ".aar" )
82
85
  // } else if (variant.name == 'release') {
83
- // apkData.outputFileName = "firework-react-native-sdk" + "-" + variant.name + ".aar"
86
+ // apkData.outputFileName = "fireworksdk_bridge" + "-" + variant.name + ".aar"
84
87
  // // apkData.outputFileName = apkData.outputFileName.replace(".aar","-" + name + ".aar" )
85
88
  // }
86
89
  // }
@@ -165,7 +168,7 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
165
168
  dependencies {
166
169
 
167
170
  // optional 1: firework sdk release verison
168
- def firework_sdk_version = 'v5.9.0'
171
+ def firework_sdk_version = 'v5.11.2'
169
172
  implementation "com.github.loopsocial:firework_sdk:$firework_sdk_version"
170
173
 
171
174
  // optional 2: firework sdk local version,
@@ -1,5 +1,6 @@
1
+ org.gradle.jvmargs=-Xmx1536M
2
+ android.enableJetifier=true
1
3
  FireworkSDK_kotlinVersion=1.5.10
2
4
  FireworkSDK_compileSdkVersion=28
3
5
  FireworkSDK_targetSdkVersion=28
4
6
  android.useAndroidX=true
5
- android.enableJetifier=true
@@ -0,0 +1,22 @@
1
+ # Add project specific ProGuard rules here.
2
+ # You can control the set of applied configuration files using the
3
+ # proguardFiles setting in build.gradle.
4
+ #
5
+ # For more details, see
6
+ # http://developer.android.com/guide/developing/tools/proguard.html
7
+
8
+ # If your project uses WebView with JS, uncomment the following
9
+ # and specify the fully qualified class name to the JavaScript interface
10
+ # class:
11
+ #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12
+ # public *;
13
+ #}
14
+
15
+ # Uncomment this to preserve the line number information for
16
+ # debugging stack traces.
17
+ #-keepattributes SourceFile,LineNumberTable
18
+
19
+ # If you keep the line number information, uncomment this to
20
+ # hide the original source file name.
21
+ #-renamesourcefileattribute SourceFile
22
+
@@ -12,6 +12,7 @@
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
14
 
15
+ //./gradlew publish
15
16
  apply plugin: 'maven-publish'
16
17
 
17
18
  afterEvaluate {
@@ -30,11 +31,11 @@ afterEvaluate {
30
31
  from components.release
31
32
  artifact androidSourcesJar
32
33
  groupId = 'com.github.loopsocial'
33
- artifactId = 'firework-react-native-sdk'
34
+ artifactId = 'fireworksdk_bridge_rn'
34
35
  version android.defaultConfig.versionName
35
36
  pom {
36
- name = 'firework-react-native-sdk'
37
- description = 'The react-native firework library (all modules).'
37
+ name = 'fireworksdk_bridge_rn'
38
+ description = 'The firework bridge library (all modules).'
38
39
  licenses {
39
40
  license {
40
41
  name = 'The Apache Software License, Version 2.0'
@@ -0,0 +1 @@
1
+ rootProject.name = 'fireworksdk_bridge'
@@ -1,5 +1,5 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="com.reactnativefireworksdk">
2
+ package="com.fireworksdk.bridge">
3
3
 
4
4
  <uses-permission android:name="android.permission.INTERNET" />
5
5
 
@@ -8,9 +8,14 @@
8
8
  android:name="com.loopnow.fireworklibrary.PlaybackActivity"
9
9
  />
10
10
  <activity
11
- android:name="com.reactnativefireworksdk.pages.FWVideoShoppingCartActivity"
11
+ android:name="com.fireworksdk.bridge.reactnative.pages.FWVideoShoppingCartActivity"
12
12
  android:theme="@style/Theme.AppCompat.Light.NoActionBar"
13
13
  />
14
+ <provider
15
+ android:authorities="com.fireworksdk.bridge.reactnative"
16
+ android:name=".reactnative.FWInitializationProvider"
17
+ android:exported="false"
18
+ />
14
19
  <meta-data
15
20
  android:name="com.google.android.gms.ads.AD_MANAGER_APP"
16
21
  android:value="true" />
@@ -19,4 +24,5 @@
19
24
  android:value="true" />
20
25
  </application>
21
26
 
27
+
22
28
  </manifest>
@@ -1,17 +1,22 @@
1
- package com.reactnativefireworksdk
1
+ package com.fireworksdk.bridge
2
2
 
3
3
  import com.facebook.react.ReactPackage
4
4
  import com.facebook.react.bridge.NativeModule
5
5
  import com.facebook.react.bridge.ReactApplicationContext
6
6
  import com.facebook.react.uimanager.ViewManager
7
- import com.reactnativefireworksdk.manager.FWVideoFeedManager
8
- import com.reactnativefireworksdk.module.FWVideoShoppingModule
9
- import com.reactnativefireworksdk.module.FireworkSDKModule
7
+ import com.fireworksdk.bridge.reactnative.manager.FWVideoFeedManager
8
+ import com.fireworksdk.bridge.reactnative.module.FWLiveStreamModule
9
+ import com.fireworksdk.bridge.reactnative.module.FWVideoShoppingModule
10
+ import com.fireworksdk.bridge.reactnative.module.FireworkSDKModule
10
11
 
11
12
 
12
13
  class FireworkSDKPackage : ReactPackage {
13
14
  override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
14
- return listOf(FireworkSDKModule(reactContext), FWVideoShoppingModule(reactContext))
15
+ return listOf(
16
+ FireworkSDKModule(reactContext),
17
+ FWVideoShoppingModule(reactContext),
18
+ FWLiveStreamModule(reactContext)
19
+ )
15
20
  }
16
21
 
17
22
  override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
@@ -0,0 +1,226 @@
1
+ package com.fireworksdk.bridge.components.videofeed
2
+
3
+ import android.content.Context
4
+ import android.util.AttributeSet
5
+ import android.view.LayoutInflater
6
+ import android.widget.RelativeLayout
7
+ import androidx.constraintlayout.widget.ConstraintLayout
8
+ import com.loopnow.fireworklibrary.FeedType
9
+ import com.loopnow.fireworklibrary.models.FeedLayout
10
+ import com.loopnow.fireworklibrary.views.VideoFeedView
11
+ import com.fireworksdk.bridge.R
12
+ import com.fireworksdk.bridge.models.*
13
+ import com.fireworksdk.bridge.utils.FWVideoPlayerUtils
14
+ import com.loopnow.fireworklibrary.views.PlaylistGroupFeedView
15
+
16
+
17
+ class FWVideoFeed(
18
+ context: Context,
19
+ attrs: AttributeSet?
20
+ ) : RelativeLayout(context, attrs) {
21
+
22
+ private var videoFeedViewContainer: ConstraintLayout? = null
23
+ var videoFeedView: VideoFeedView? = null
24
+
25
+ private var playlistGroupFeedViewContainer: ConstraintLayout? = null
26
+ var playlistGroupFeedView: PlaylistGroupFeedView? = null
27
+
28
+ val videoFeedPropsModel: FWVideoFeedPropsModel by lazy { FWVideoFeedPropsModel() }
29
+ private var currentMode: String? = null
30
+ private var currentPlaylistGroupId: String? = null
31
+
32
+ constructor(context: Context) : this(context, null)
33
+
34
+ fun setProps(props: FWVideoFeedPropsModel?) {
35
+ if (props != null) {
36
+ videoFeedPropsModel.source = props.source
37
+ videoFeedPropsModel.channel = props.channel
38
+ videoFeedPropsModel.playlist = props.playlist
39
+ videoFeedPropsModel.playlistGroup = props.playlistGroup
40
+ videoFeedPropsModel.mode = props.mode
41
+ videoFeedPropsModel.videoFeedConfiguration = props.videoFeedConfiguration
42
+ videoFeedPropsModel.videoPlayerConfiguration = props.videoPlayerConfiguration
43
+ }
44
+ setData()
45
+ }
46
+
47
+ fun setSourceProps(source: String?) {
48
+ videoFeedPropsModel.source = source
49
+ setData()
50
+ }
51
+
52
+ fun setChannelProps(channel: String?) {
53
+ videoFeedPropsModel.channel = channel
54
+ setData()
55
+ }
56
+
57
+ fun setPlaylistProps(playlist: String?) {
58
+ videoFeedPropsModel.playlist = playlist
59
+ setData()
60
+ }
61
+
62
+ fun setPlaylistGroupProps(playlistGroup: String?) {
63
+ videoFeedPropsModel.playlistGroup = playlistGroup
64
+ setData()
65
+ }
66
+
67
+ fun setModeProps(mode: String?) {
68
+ videoFeedPropsModel.mode = mode
69
+ setData()
70
+ }
71
+
72
+ fun setVideoFeedConfigProps(config: FWVideoFeedConfigModel?) {
73
+ videoFeedPropsModel.videoFeedConfiguration = config
74
+ setData()
75
+ }
76
+
77
+ fun setVideoPlayerConfigProps(config: FWVideoPlayerConfigModel?) {
78
+ videoFeedPropsModel.videoPlayerConfiguration = config
79
+ setData()
80
+ }
81
+
82
+ fun refresh() {
83
+ videoFeedView?.refreshFeed()
84
+ playlistGroupFeedView?.refresh()
85
+ }
86
+
87
+ private fun setData() {
88
+ val source = videoFeedPropsModel.source
89
+ val mode = videoFeedPropsModel.mode
90
+ val channel = videoFeedPropsModel.channel
91
+ val playlist = videoFeedPropsModel.playlist
92
+ val playlistGroup = videoFeedPropsModel.playlistGroup
93
+ val videoFeedConfiguration = videoFeedPropsModel.videoFeedConfiguration
94
+ val videoPlayerConfiguration = videoFeedPropsModel.videoPlayerConfiguration
95
+
96
+ if (source.isNullOrBlank()) {
97
+ return
98
+ }
99
+ when (source) {
100
+ FWVideoFeedSource.PlaylistGroup.rawValue -> {
101
+ setPlaylistGroupFeed(mode, playlistGroup, videoFeedConfiguration, videoPlayerConfiguration)
102
+ }
103
+ FWVideoFeedSource.Playlist.rawValue -> {
104
+ setFeed(mode, channel, playlist, FeedType.PLAYLIST, videoFeedConfiguration, videoPlayerConfiguration)
105
+ }
106
+ FWVideoFeedSource.Channel.rawValue -> {
107
+ setFeed(mode, channel, null, FeedType.CHANNEL, videoFeedConfiguration, videoPlayerConfiguration)
108
+ }
109
+ else -> {
110
+ setFeed(mode, null, null, FeedType.DISCOVER, videoFeedConfiguration, videoPlayerConfiguration)
111
+ }
112
+ }
113
+ }
114
+
115
+ private fun setFeed(
116
+ mode: String?,
117
+ channelId: String?, playlistId: String?, feedType: FeedType?,
118
+ videoFeedConfiguration: FWVideoFeedConfigModel?,
119
+ videoPlayerConfiguration: FWVideoPlayerConfigModel?,
120
+ ) {
121
+ // add view
122
+ addVideoFeedView()
123
+
124
+ // set layout
125
+ val feedLayout = when {
126
+ mode.equals(FWVideoFeedModel.Column.rawValue) -> FeedLayout.VERTICAL
127
+ mode.equals(FWVideoFeedModel.Grid.rawValue) -> FeedLayout.GRID
128
+ else -> FeedLayout.HORIZONTAL
129
+ }
130
+ if (mode.isNullOrBlank() || mode != currentMode) {
131
+ videoFeedView?.setLayout(feedLayout)
132
+ currentMode = mode
133
+ }
134
+
135
+ // set channel playlistId feedType
136
+ if (feedType == FeedType.CHANNEL && !channelId.isNullOrBlank()) {
137
+ videoFeedView?.setFeed(channelId, null, FeedType.CHANNEL)
138
+ } else if (feedType == FeedType.PLAYLIST && !channelId.isNullOrBlank() && !playlistId.isNullOrBlank()) {
139
+ videoFeedView?.setFeed(channelId, playlistId, FeedType.PLAYLIST)
140
+ } else {
141
+ videoFeedView?.setFeed(null, null, FeedType.DISCOVER)
142
+ }
143
+
144
+ // set Feed Configuration
145
+ FWVideoPlayerUtils.setVideoFeedConfig(videoFeedView, videoFeedConfiguration)
146
+ // set Player Configuration
147
+ FWVideoPlayerUtils.setVideoPlayerConfig(videoPlayerConfiguration)
148
+ }
149
+
150
+ private fun setPlaylistGroupFeed(
151
+ mode: String?,
152
+ playlistGroupId: String?,
153
+ videoFeedConfiguration: FWVideoFeedConfigModel?,
154
+ videoPlayerConfiguration: FWVideoPlayerConfigModel?,
155
+ ) {
156
+ // add view
157
+ addPlaylistGroupFeedView()
158
+
159
+ // set layout
160
+ val feedLayout = when {
161
+ mode.equals(FWVideoFeedModel.Column.rawValue) -> FeedLayout.VERTICAL
162
+ mode.equals(FWVideoFeedModel.Grid.rawValue) -> FeedLayout.GRID
163
+ else -> FeedLayout.HORIZONTAL
164
+ }
165
+
166
+ if (mode.isNullOrBlank() || mode != currentMode) {
167
+ playlistGroupFeedView?.setLayout(feedLayout)
168
+ currentMode = mode
169
+ }
170
+
171
+ // set playlistGroupId
172
+ if (playlistGroupId != currentPlaylistGroupId) {
173
+ playlistGroupFeedView?.setPlaylistGroupId(playlistGroupId)
174
+ currentPlaylistGroupId = playlistGroupId
175
+ }
176
+
177
+ // set Feed Configuration
178
+ FWVideoPlayerUtils.setPlaylistGroupFeedConfig(playlistGroupFeedView, videoFeedConfiguration)
179
+ // set Player Configuration
180
+ FWVideoPlayerUtils.setVideoPlayerConfig(videoPlayerConfiguration)
181
+ }
182
+
183
+ private fun addVideoFeedView() {
184
+ removePlaylistGroupFeedView()
185
+ if (videoFeedView != null) {
186
+ return
187
+ }
188
+ videoFeedViewContainer =
189
+ LayoutInflater.from(context).inflate(R.layout.fw_bridge_fragment_videofeed, this, false) as ConstraintLayout?
190
+ videoFeedView = videoFeedViewContainer?.findViewById(R.id.fw_bridge_videofeed)
191
+ if (videoFeedView != null) {
192
+ addView(videoFeedViewContainer)
193
+ }
194
+ }
195
+
196
+ private fun removeVideoFeedView() {
197
+ if (videoFeedViewContainer == null) {
198
+ return
199
+ }
200
+ removeView(videoFeedViewContainer)
201
+ videoFeedViewContainer = null
202
+ videoFeedView = null
203
+ }
204
+
205
+ private fun addPlaylistGroupFeedView() {
206
+ removeVideoFeedView()
207
+ if (playlistGroupFeedView != null) {
208
+ return
209
+ }
210
+ playlistGroupFeedViewContainer =
211
+ LayoutInflater.from(context).inflate(R.layout.fw_bridge_fragment_playlistfeed, this, false) as ConstraintLayout?
212
+ playlistGroupFeedView = playlistGroupFeedViewContainer?.findViewById(R.id.fw_bridge_playlistfeed)
213
+ if (playlistGroupFeedView != null) {
214
+ addView(playlistGroupFeedViewContainer)
215
+ }
216
+ }
217
+
218
+ private fun removePlaylistGroupFeedView() {
219
+ if (playlistGroupFeedViewContainer == null) {
220
+ return
221
+ }
222
+ removeView(playlistGroupFeedViewContainer)
223
+ playlistGroupFeedViewContainer = null
224
+ playlistGroupFeedView = null
225
+ }
226
+ }
@@ -1,4 +1,4 @@
1
- package com.reactnativefireworksdk.constants
1
+ package com.fireworksdk.bridge.constants
2
2
 
3
3
  object FWCommandConstant {
4
4
 
@@ -1,4 +1,4 @@
1
- package com.reactnativefireworksdk.constants
1
+ package com.fireworksdk.bridge.constants
2
2
 
3
3
  object FWVideoPlayerConstant {
4
4
 
@@ -17,4 +17,16 @@ object FWVideoPlayerConstant {
17
17
  */
18
18
  const val FW_PLAYER_STYLE_FULL = "full"
19
19
  const val FW_PLAYER_STYLE_FIT = "fit"
20
+
21
+ /**
22
+ * Ad label
23
+ */
24
+ const val FW_AD_BADGE_LABEL_AD = "ad"
25
+ const val FW_AD_BADGE_LABEL_SPONSORED = "sponsored"
26
+
27
+ /**
28
+ * mute or default when open player
29
+ */
30
+ const val FW_PLAYER_LAUNCH_BEHAVIOR_DEFAULT = "default"
31
+ const val FW_PLAYER_LAUNCH_BEHAVIOR_MUTE_ON_FIRST_LAUNCH = "muteOnFirstLaunch"
20
32
  }
@@ -0,0 +1,9 @@
1
+ package com.fireworksdk.bridge.models
2
+
3
+ import android.os.Parcelable
4
+ import kotlinx.android.parcel.Parcelize
5
+
6
+ @Parcelize
7
+ data class FWAdBadgeConfigModel(
8
+ var badgeTextType: String? = null,
9
+ ) : Parcelable