react-native-firework-sdk 1.1.1 → 1.2.0-beta.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 (48) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/gradlew +0 -0
  3. package/android/src/main/AndroidManifest.xml +9 -0
  4. package/android/src/main/java/com/fireworksdk/bridge/FireworkSDKPackage.kt +3 -1
  5. package/android/src/main/java/com/fireworksdk/bridge/reactnative/FWInitializationProvider.kt +99 -0
  6. package/android/src/main/java/com/fireworksdk/bridge/reactnative/models/FWNavigatorInterface.kt +9 -0
  7. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWNavigatorModule.kt +64 -0
  8. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FWVideoShoppingModule.kt +6 -2
  9. package/android/src/main/java/com/fireworksdk/bridge/reactnative/module/FireworkSDKModule.kt +0 -3
  10. package/android/src/main/java/com/fireworksdk/bridge/reactnative/pages/FWContainerActivity.kt +54 -0
  11. package/android/src/main/res/layout/fw_bridge_fragment_container.xml +8 -0
  12. package/ios/FireworkSdk.xcodeproj/project.pbxproj +206 -18
  13. package/ios/Modules/FWNavigatorModule/FWNavigatorContainerViewController.swift +40 -0
  14. package/ios/Modules/FWNavigatorModule/FWNavigatorModule.m +17 -0
  15. package/ios/Modules/FWNavigatorModule/FWNavigatorModule.swift +59 -0
  16. package/ios/Modules/FWNavigatorModule/FWNavigatorProtocol.swift +13 -0
  17. package/ios/Modules/FireworkSDKModule/FireworkSDKModule.swift +1 -1
  18. package/lib/commonjs/FWNavigator.js +60 -0
  19. package/lib/commonjs/FWNavigator.js.map +1 -0
  20. package/lib/commonjs/FireworkSDK.js +10 -0
  21. package/lib/commonjs/FireworkSDK.js.map +1 -1
  22. package/lib/commonjs/components/NavigationContainer.js +36 -0
  23. package/lib/commonjs/components/NavigationContainer.js.map +1 -0
  24. package/lib/commonjs/index.js +14 -2
  25. package/lib/commonjs/index.js.map +1 -1
  26. package/lib/commonjs/modules/FWNavigatorModule.js +22 -0
  27. package/lib/commonjs/modules/FWNavigatorModule.js.map +1 -0
  28. package/lib/module/FWNavigator.js +50 -0
  29. package/lib/module/FWNavigator.js.map +1 -0
  30. package/lib/module/FireworkSDK.js +9 -0
  31. package/lib/module/FireworkSDK.js.map +1 -1
  32. package/lib/module/components/NavigationContainer.js +21 -0
  33. package/lib/module/components/NavigationContainer.js.map +1 -0
  34. package/lib/module/index.js +5 -2
  35. package/lib/module/index.js.map +1 -1
  36. package/lib/module/modules/FWNavigatorModule.js +13 -0
  37. package/lib/module/modules/FWNavigatorModule.js.map +1 -0
  38. package/lib/typescript/FWNavigator.d.ts +22 -0
  39. package/lib/typescript/FireworkSDK.d.ts +5 -0
  40. package/lib/typescript/components/NavigationContainer.d.ts +6 -0
  41. package/lib/typescript/index.d.ts +3 -2
  42. package/lib/typescript/modules/FWNavigatorModule.d.ts +9 -0
  43. package/package.json +1 -1
  44. package/src/FWNavigator.tsx +39 -0
  45. package/src/FireworkSDK.ts +11 -1
  46. package/src/components/NavigationContainer.tsx +22 -0
  47. package/src/index.tsx +9 -2
  48. package/src/modules/FWNavigatorModule.ts +22 -0
@@ -168,7 +168,7 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
168
168
  dependencies {
169
169
 
170
170
  // optional 1: firework sdk release verison
171
- def firework_sdk_version = 'v5.11.2'
171
+ def firework_sdk_version = 'v5.11.4'
172
172
  implementation "com.github.loopsocial:firework_sdk:$firework_sdk_version"
173
173
 
174
174
  // optional 2: firework sdk local version,
package/android/gradlew CHANGED
File without changes
@@ -11,6 +11,15 @@
11
11
  android:name="com.fireworksdk.bridge.reactnative.pages.FWVideoShoppingCartActivity"
12
12
  android:theme="@style/Theme.AppCompat.Light.NoActionBar"
13
13
  />
14
+ <activity
15
+ android:name="com.fireworksdk.bridge.reactnative.pages.FWContainerActivity"
16
+ android:theme="@style/Theme.AppCompat.Light.NoActionBar"
17
+ />
18
+ <provider
19
+ android:authorities="com.fireworksdk.bridge.reactnative"
20
+ android:name=".reactnative.FWInitializationProvider"
21
+ android:exported="false"
22
+ />
14
23
  <meta-data
15
24
  android:name="com.google.android.gms.ads.AD_MANAGER_APP"
16
25
  android:value="true" />
@@ -6,6 +6,7 @@ import com.facebook.react.bridge.ReactApplicationContext
6
6
  import com.facebook.react.uimanager.ViewManager
7
7
  import com.fireworksdk.bridge.reactnative.manager.FWVideoFeedManager
8
8
  import com.fireworksdk.bridge.reactnative.module.FWLiveStreamModule
9
+ import com.fireworksdk.bridge.reactnative.module.FWNavigatorModule
9
10
  import com.fireworksdk.bridge.reactnative.module.FWVideoShoppingModule
10
11
  import com.fireworksdk.bridge.reactnative.module.FireworkSDKModule
11
12
 
@@ -15,7 +16,8 @@ class FireworkSDKPackage : ReactPackage {
15
16
  return listOf(
16
17
  FireworkSDKModule(reactContext),
17
18
  FWVideoShoppingModule(reactContext),
18
- FWLiveStreamModule(reactContext)
19
+ FWLiveStreamModule(reactContext),
20
+ FWNavigatorModule(reactContext)
19
21
  )
20
22
  }
21
23
 
@@ -0,0 +1,99 @@
1
+ package com.fireworksdk.bridge.reactnative
2
+
3
+ import android.app.Activity
4
+ import android.app.Application
5
+ import android.content.ContentProvider
6
+ import android.content.ContentValues
7
+ import android.database.Cursor
8
+ import android.net.Uri
9
+ import android.os.Bundle
10
+ import com.fireworksdk.bridge.models.weakProperty
11
+ import com.fireworksdk.bridge.utils.FWLogUtils
12
+
13
+ class FWInitializationProvider: ContentProvider() {
14
+
15
+ var application: Application? = null
16
+ var resumedActivity by weakProperty<Activity?>()
17
+
18
+ override fun onCreate(): Boolean {
19
+ sInstance = this
20
+ val context = context
21
+ if (context != null) {
22
+ // Many Initializer's expect the `applicationContext` to be non-null. This
23
+ // typically happens when `android:sharedUid` is used. In such cases, we postpone
24
+ // initialization altogether, and rely on lazy init.
25
+ // More context: b/196959015
26
+ val applicationContext = context.applicationContext as Application?
27
+ application = applicationContext
28
+
29
+ if (applicationContext != null) {
30
+ applicationContext.registerActivityLifecycleCallbacks(object : Application.ActivityLifecycleCallbacks {
31
+ override fun onActivityCreated(activity: Activity, bundle: Bundle?) {
32
+ }
33
+
34
+ override fun onActivityStarted(activity: Activity) {
35
+ }
36
+
37
+ override fun onActivityResumed(activity: Activity) {
38
+ resumedActivity = activity
39
+ }
40
+
41
+ override fun onActivityPaused(activity: Activity) {
42
+ if (resumedActivity == activity) {
43
+ resumedActivity = null
44
+ }
45
+ }
46
+
47
+ override fun onActivityStopped(activity: Activity) {
48
+ }
49
+
50
+ override fun onActivitySaveInstanceState(activity: Activity, bundle: Bundle) {
51
+ }
52
+
53
+ override fun onActivityDestroyed(activity: Activity) {
54
+ }
55
+
56
+ })
57
+
58
+ } else {
59
+ FWLogUtils.w {"Deferring initialization because `applicationContext` is null."}
60
+ }
61
+ } else {
62
+ throw Exception("Context cannot be null")
63
+ }
64
+ return true
65
+ }
66
+
67
+ override fun query(
68
+ p0: Uri,
69
+ p1: Array<out String>?,
70
+ p2: String?,
71
+ p3: Array<out String>?,
72
+ p4: String?
73
+ ): Cursor? {
74
+ throw IllegalStateException("Not allowed.")
75
+ }
76
+
77
+ override fun getType(p0: Uri): String? {
78
+ throw IllegalStateException("Not allowed.")
79
+ }
80
+
81
+ override fun insert(p0: Uri, p1: ContentValues?): Uri? {
82
+ throw IllegalStateException("Not allowed.")
83
+ }
84
+
85
+ override fun delete(p0: Uri, p1: String?, p2: Array<out String>?): Int {
86
+ throw IllegalStateException("Not allowed.")
87
+ }
88
+
89
+ override fun update(p0: Uri, p1: ContentValues?, p2: String?, p3: Array<out String>?): Int {
90
+ throw IllegalStateException("Not allowed.")
91
+ }
92
+
93
+ companion object {
94
+ private lateinit var sInstance: FWInitializationProvider
95
+
96
+ val INSTANCE: FWInitializationProvider
97
+ get() = sInstance
98
+ }
99
+ }
@@ -0,0 +1,9 @@
1
+ package com.fireworksdk.bridge.reactnative.models
2
+
3
+ import com.facebook.react.bridge.Promise
4
+
5
+ interface FWNavigatorInterface {
6
+
7
+ fun pushNativeContainer(callbackId: String?, promise: Promise)
8
+ fun popNativeContainer(promise: Promise)
9
+ }
@@ -0,0 +1,64 @@
1
+ package com.fireworksdk.bridge.reactnative.module
2
+
3
+ import com.facebook.react.bridge.*
4
+ import com.fireworksdk.bridge.reactnative.FWInitializationProvider
5
+ import com.fireworksdk.bridge.reactnative.models.FWNavigatorInterface
6
+ import com.fireworksdk.bridge.reactnative.pages.FWContainerActivity
7
+ import com.fireworksdk.bridge.utils.FWLogUtils
8
+
9
+
10
+ class FWNavigatorModule(
11
+ reactContext: ReactApplicationContext
12
+ ) : ReactContextBaseJavaModule(reactContext), FWNavigatorInterface {
13
+
14
+ @ReactMethod
15
+ override fun pushNativeContainer(callbackId: String?, promise: Promise) {
16
+ FWLogUtils.d { "FWNavigatorModule pushNativeContainer: $callbackId" }
17
+ val activity = FWInitializationProvider.INSTANCE.resumedActivity
18
+
19
+ if (activity == null) {
20
+ promise.resolve(false)
21
+ return
22
+ }
23
+
24
+ UiThreadUtil.runOnUiThread {
25
+ activity.startActivity(FWContainerActivity.createIntent(activity, callbackId))
26
+ }
27
+ promise.resolve(true)
28
+ }
29
+
30
+ @ReactMethod
31
+ override fun popNativeContainer(promise: Promise) {
32
+ FWLogUtils.d { "FWNavigatorModule popNativeContainer" }
33
+
34
+ val activity = FWInitializationProvider.INSTANCE.resumedActivity
35
+ if (activity == null) {
36
+ promise.resolve(false)
37
+ return
38
+ }
39
+
40
+ UiThreadUtil.runOnUiThread {
41
+ activity.finish()
42
+ }
43
+ promise.resolve(true)
44
+ }
45
+
46
+ @ReactMethod
47
+ fun addListener(eventName: String?, promise: Promise) {
48
+ // Set up any upstream listeners or background tasks as necessary
49
+ FWLogUtils.d { "addListener: $eventName" }
50
+ promise.resolve(Arguments.createMap())
51
+ }
52
+
53
+ @ReactMethod
54
+ fun removeListeners(count: Int?, promise: Promise) {
55
+ // Remove upstream listeners, stop unnecessary background tasks
56
+ FWLogUtils.d { "removeListeners: $count" }
57
+ promise.resolve(Arguments.createMap())
58
+ }
59
+
60
+ override fun getName(): String {
61
+ return "FWNavigatorModule"
62
+ }
63
+
64
+ }
@@ -3,6 +3,7 @@ package com.fireworksdk.bridge.reactnative.module
3
3
  import android.app.Activity
4
4
  import com.facebook.react.bridge.*
5
5
  import com.fasterxml.jackson.core.type.TypeReference
6
+ import com.fireworksdk.bridge.reactnative.FWInitializationProvider
6
7
  import com.loopnow.fireworklibrary.baya.Baya
7
8
  import com.loopnow.fireworklibrary.baya.UpdateCartStatus
8
9
  import com.fireworksdk.bridge.reactnative.models.FWVideoShoppingInterface
@@ -116,7 +117,7 @@ class FWVideoShoppingModule(
116
117
  if (callbackId == null || cartClickHandler?.first != callbackId) {
117
118
  return
118
119
  }
119
- val activity = cartClickHandler?.second ?: return
120
+ val activity = FWInitializationProvider.INSTANCE.resumedActivity ?: return
120
121
 
121
122
  UiThreadUtil.runOnUiThread {
122
123
  activity.startActivity(FWVideoShoppingCartActivity.createIntent(activity))
@@ -125,8 +126,11 @@ class FWVideoShoppingModule(
125
126
 
126
127
  @ReactMethod
127
128
  override fun exitCartPage() {
129
+
130
+ val activity = FWInitializationProvider.INSTANCE.resumedActivity ?: return
131
+
128
132
  UiThreadUtil.runOnUiThread {
129
- currentActivity?.finish()
133
+ activity.finish()
130
134
  }
131
135
  }
132
136
 
@@ -163,9 +163,6 @@ class FireworkSDKModule(
163
163
  }
164
164
 
165
165
  private fun handleCustomCTAClick() {
166
- if (!FWVideoPlayerUtils.customCTAClickEnabled) {
167
- return
168
- }
169
166
  FwSDK.ctaClickHandler = object: FwSDK.CtaClickHandler {
170
167
  override fun ctaClicked(label: String, actionUrl: String?): Boolean {
171
168
  FWLogUtils.d { "ctaClicked" }
@@ -0,0 +1,54 @@
1
+ package com.fireworksdk.bridge.reactnative.pages
2
+
3
+ import android.app.Activity
4
+ import android.content.Intent
5
+ import android.os.Bundle
6
+ import androidx.appcompat.app.AppCompatActivity
7
+ import androidx.fragment.app.Fragment
8
+ import com.facebook.react.ReactFragment
9
+ import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler
10
+ import com.fireworksdk.bridge.R
11
+
12
+ class FWContainerActivity : AppCompatActivity(), DefaultHardwareBackBtnHandler {
13
+
14
+ override fun onCreate(savedInstanceState: Bundle?) {
15
+ super.onCreate(savedInstanceState)
16
+ setContentView(R.layout.fw_bridge_fragment_container)
17
+
18
+ val callbackId = intent.getStringExtra(KEY_CALLBACK_ID)
19
+
20
+ val reactNativeFragment: Fragment = ReactFragment.Builder()
21
+ .setComponentName(COMPONENT_NAME)
22
+ .setLaunchOptions(getLaunchOptions(callbackId))
23
+ .build()
24
+
25
+ supportFragmentManager
26
+ .beginTransaction()
27
+ .add(R.id.fw_bridge_container, reactNativeFragment)
28
+ .commit()
29
+ }
30
+
31
+ private fun getLaunchOptions(callbackId: String?) = Bundle().apply {
32
+ if (!callbackId.isNullOrEmpty()) {
33
+ putString(KEY_CALLBACK_ID, callbackId)
34
+ }
35
+ }
36
+
37
+ companion object {
38
+
39
+ private const val KEY_CALLBACK_ID = "callbackId"
40
+ private const val COMPONENT_NAME = "FWNavigationContainer"
41
+
42
+ fun createIntent(activity: Activity, callbackId: String?): Intent {
43
+ val intent = Intent(activity, FWContainerActivity::class.java)
44
+ intent.putExtra(KEY_CALLBACK_ID, callbackId)
45
+ intent.flags = Intent.FLAG_ACTIVITY_NO_ANIMATION
46
+ activity.overridePendingTransition(0, 0)
47
+ return intent
48
+ }
49
+ }
50
+
51
+ override fun invokeDefaultOnBackPressed() {
52
+ super.onBackPressed();
53
+ }
54
+ }
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <androidx.constraintlayout.widget.ConstraintLayout
3
+ xmlns:android="http://schemas.android.com/apk/res/android"
4
+ android:id="@+id/fw_bridge_container"
5
+ android:layout_width="match_parent"
6
+ android:layout_height="match_parent">
7
+
8
+ </androidx.constraintlayout.widget.ConstraintLayout>
@@ -7,10 +7,37 @@
7
7
  objects = {
8
8
 
9
9
  /* Begin PBXBuildFile section */
10
- 1F6F718C2771B48200224AF3 /* FireworkSdk+EventTracking.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F6F71862771B48100224AF3 /* FireworkSdk+EventTracking.swift */; };
11
- 1F6F718D2771B48200224AF3 /* FireworkSdk.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F6F71882771B48100224AF3 /* FireworkSdk.swift */; };
12
- 1F6F718E2771B48200224AF3 /* FireworkSdk+CTA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F6F71892771B48100224AF3 /* FireworkSdk+CTA.swift */; };
13
- 1F6F718F2771B48200224AF3 /* FireworkSdk.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F6F718B2771B48200224AF3 /* FireworkSdk.m */; };
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
+ 897523992817DEF80070EBB6 /* MobileADConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8975237E2817DEF80070EBB6 /* MobileADConfiguration.swift */; };
34
+ 8975239A2817DEF80070EBB6 /* FireworkSDKModule+EventTracking.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8975237F2817DEF80070EBB6 /* FireworkSDKModule+EventTracking.swift */; };
35
+ 8975239B2817DEF80070EBB6 /* FireworkSDKModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523802817DEF80070EBB6 /* FireworkSDKModule.swift */; };
36
+ 8975239C2817DEF80070EBB6 /* AdBadgeConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523812817DEF80070EBB6 /* AdBadgeConfiguration.swift */; };
37
+ 8975239D2817DEF80070EBB6 /* FireworkSDKModule+CTA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523822817DEF80070EBB6 /* FireworkSDKModule+CTA.swift */; };
38
+ 8975239E2817DEF80070EBB6 /* FireworkSDKModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 897523832817DEF80070EBB6 /* FireworkSDKModule.m */; };
39
+ 8975239F2817DEF80070EBB6 /* LiveStreamModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523852817DEF80070EBB6 /* LiveStreamModule.swift */; };
40
+ 897523A02817DEF80070EBB6 /* LiveStreamModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 897523862817DEF80070EBB6 /* LiveStreamModule.m */; };
14
41
  /* End PBXBuildFile section */
15
42
 
16
43
  /* Begin PBXCopyFilesBuildPhase section */
@@ -27,12 +54,39 @@
27
54
 
28
55
  /* Begin PBXFileReference section */
29
56
  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
57
  1F6F718A2771B48100224AF3 /* FireworkSdk-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "FireworkSdk-Bridging-Header.h"; sourceTree = "<group>"; };
35
- 1F6F718B2771B48200224AF3 /* FireworkSdk.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FireworkSdk.m; sourceTree = "<group>"; };
58
+ 897523592817DEEE0070EBB6 /* VideoFeedManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoFeedManager.swift; sourceTree = "<group>"; };
59
+ 8975235A2817DEEE0070EBB6 /* VideoFeedConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoFeedConfiguration.swift; sourceTree = "<group>"; };
60
+ 8975235B2817DEEE0070EBB6 /* VideoFeed.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoFeed.swift; sourceTree = "<group>"; };
61
+ 8975235C2817DEEE0070EBB6 /* VideoPlayerConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoPlayerConfiguration.swift; sourceTree = "<group>"; };
62
+ 8975235D2817DEEE0070EBB6 /* VideoFeedManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideoFeedManager.m; sourceTree = "<group>"; };
63
+ 897523632817DEF80070EBB6 /* react_native_firework_sdk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = react_native_firework_sdk.h; sourceTree = "<group>"; };
64
+ 897523652817DEF80070EBB6 /* UIViewController+AttachChild.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+AttachChild.swift"; sourceTree = "<group>"; };
65
+ 897523662817DEF80070EBB6 /* UIView+Constraints.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Constraints.swift"; sourceTree = "<group>"; };
66
+ 897523672817DEF80070EBB6 /* String+Color.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Color.swift"; sourceTree = "<group>"; };
67
+ 897523682817DEF80070EBB6 /* UIView+ParentViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+ParentViewController.swift"; sourceTree = "<group>"; };
68
+ 8975236B2817DEF80070EBB6 /* RCTConvert+FireworkSDKModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "RCTConvert+FireworkSDKModule.swift"; sourceTree = "<group>"; };
69
+ 8975236C2817DEF80070EBB6 /* RCTConvert+Shopping.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "RCTConvert+Shopping.swift"; sourceTree = "<group>"; };
70
+ 8975236D2817DEF80070EBB6 /* RCTConvert+VideoFeed.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "RCTConvert+VideoFeed.swift"; sourceTree = "<group>"; };
71
+ 8975236F2817DEF80070EBB6 /* FireworkSDK+Json.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FireworkSDK+Json.swift"; sourceTree = "<group>"; };
72
+ 897523702817DEF80070EBB6 /* FireworkEventName.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FireworkEventName.swift; sourceTree = "<group>"; };
73
+ 897523732817DEF80070EBB6 /* FWNavigatorProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FWNavigatorProtocol.swift; sourceTree = "<group>"; };
74
+ 897523742817DEF80070EBB6 /* FWNavigatorContainerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FWNavigatorContainerViewController.swift; sourceTree = "<group>"; };
75
+ 897523752817DEF80070EBB6 /* FWNavigatorModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FWNavigatorModule.swift; sourceTree = "<group>"; };
76
+ 897523762817DEF80070EBB6 /* FWNavigatorModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FWNavigatorModule.m; sourceTree = "<group>"; };
77
+ 897523782817DEF80070EBB6 /* CartViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CartViewController.swift; sourceTree = "<group>"; };
78
+ 897523792817DEF80070EBB6 /* ShoppingModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShoppingModule.m; sourceTree = "<group>"; };
79
+ 8975237A2817DEF80070EBB6 /* ProductInfoViewConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductInfoViewConfiguration.swift; sourceTree = "<group>"; };
80
+ 8975237B2817DEF80070EBB6 /* Product.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Product.swift; sourceTree = "<group>"; };
81
+ 8975237C2817DEF80070EBB6 /* ShoppingModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShoppingModule.swift; sourceTree = "<group>"; };
82
+ 8975237E2817DEF80070EBB6 /* MobileADConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MobileADConfiguration.swift; sourceTree = "<group>"; };
83
+ 8975237F2817DEF80070EBB6 /* FireworkSDKModule+EventTracking.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FireworkSDKModule+EventTracking.swift"; sourceTree = "<group>"; };
84
+ 897523802817DEF80070EBB6 /* FireworkSDKModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FireworkSDKModule.swift; sourceTree = "<group>"; };
85
+ 897523812817DEF80070EBB6 /* AdBadgeConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AdBadgeConfiguration.swift; sourceTree = "<group>"; };
86
+ 897523822817DEF80070EBB6 /* FireworkSDKModule+CTA.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FireworkSDKModule+CTA.swift"; sourceTree = "<group>"; };
87
+ 897523832817DEF80070EBB6 /* FireworkSDKModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FireworkSDKModule.m; sourceTree = "<group>"; };
88
+ 897523852817DEF80070EBB6 /* LiveStreamModule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LiveStreamModule.swift; sourceTree = "<group>"; };
89
+ 897523862817DEF80070EBB6 /* LiveStreamModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LiveStreamModule.m; sourceTree = "<group>"; };
36
90
  /* End PBXFileReference section */
37
91
 
38
92
  /* Begin PBXFrameworksBuildPhase section */
@@ -58,15 +112,122 @@
58
112
  isa = PBXGroup;
59
113
  children = (
60
114
  1F6F718A2771B48100224AF3 /* FireworkSdk-Bridging-Header.h */,
61
- 1F6F718B2771B48200224AF3 /* FireworkSdk.m */,
62
- 1F6F71882771B48100224AF3 /* FireworkSdk.swift */,
63
- 1F6F71892771B48100224AF3 /* FireworkSdk+CTA.swift */,
64
- 1F6F71862771B48100224AF3 /* FireworkSdk+EventTracking.swift */,
65
- 1F6F71872771B48100224AF3 /* Models */,
115
+ 897523632817DEF80070EBB6 /* react_native_firework_sdk.h */,
116
+ 897523582817DEEE0070EBB6 /* Components */,
117
+ 897523692817DEF80070EBB6 /* Models */,
118
+ 897523712817DEF80070EBB6 /* Modules */,
66
119
  134814211AA4EA7D00B7C361 /* Products */,
120
+ 897523642817DEF80070EBB6 /* Utils */,
67
121
  );
68
122
  sourceTree = "<group>";
69
123
  };
124
+ 897523582817DEEE0070EBB6 /* Components */ = {
125
+ isa = PBXGroup;
126
+ children = (
127
+ 897523592817DEEE0070EBB6 /* VideoFeedManager.swift */,
128
+ 8975235A2817DEEE0070EBB6 /* VideoFeedConfiguration.swift */,
129
+ 8975235B2817DEEE0070EBB6 /* VideoFeed.swift */,
130
+ 8975235C2817DEEE0070EBB6 /* VideoPlayerConfiguration.swift */,
131
+ 8975235D2817DEEE0070EBB6 /* VideoFeedManager.m */,
132
+ );
133
+ path = Components;
134
+ sourceTree = "<group>";
135
+ };
136
+ 897523642817DEF80070EBB6 /* Utils */ = {
137
+ isa = PBXGroup;
138
+ children = (
139
+ 897523652817DEF80070EBB6 /* UIViewController+AttachChild.swift */,
140
+ 897523662817DEF80070EBB6 /* UIView+Constraints.swift */,
141
+ 897523672817DEF80070EBB6 /* String+Color.swift */,
142
+ 897523682817DEF80070EBB6 /* UIView+ParentViewController.swift */,
143
+ );
144
+ path = Utils;
145
+ sourceTree = "<group>";
146
+ };
147
+ 897523692817DEF80070EBB6 /* Models */ = {
148
+ isa = PBXGroup;
149
+ children = (
150
+ 8975236A2817DEF80070EBB6 /* RNToNative */,
151
+ 8975236E2817DEF80070EBB6 /* NativeToRN */,
152
+ );
153
+ path = Models;
154
+ sourceTree = "<group>";
155
+ };
156
+ 8975236A2817DEF80070EBB6 /* RNToNative */ = {
157
+ isa = PBXGroup;
158
+ children = (
159
+ 8975236B2817DEF80070EBB6 /* RCTConvert+FireworkSDKModule.swift */,
160
+ 8975236C2817DEF80070EBB6 /* RCTConvert+Shopping.swift */,
161
+ 8975236D2817DEF80070EBB6 /* RCTConvert+VideoFeed.swift */,
162
+ );
163
+ path = RNToNative;
164
+ sourceTree = "<group>";
165
+ };
166
+ 8975236E2817DEF80070EBB6 /* NativeToRN */ = {
167
+ isa = PBXGroup;
168
+ children = (
169
+ 8975236F2817DEF80070EBB6 /* FireworkSDK+Json.swift */,
170
+ 897523702817DEF80070EBB6 /* FireworkEventName.swift */,
171
+ );
172
+ path = NativeToRN;
173
+ sourceTree = "<group>";
174
+ };
175
+ 897523712817DEF80070EBB6 /* Modules */ = {
176
+ isa = PBXGroup;
177
+ children = (
178
+ 897523722817DEF80070EBB6 /* FWNavigatorModule */,
179
+ 897523772817DEF80070EBB6 /* Shopping */,
180
+ 8975237D2817DEF80070EBB6 /* FireworkSDKModule */,
181
+ 897523842817DEF80070EBB6 /* LiveStream */,
182
+ );
183
+ path = Modules;
184
+ sourceTree = "<group>";
185
+ };
186
+ 897523722817DEF80070EBB6 /* FWNavigatorModule */ = {
187
+ isa = PBXGroup;
188
+ children = (
189
+ 897523732817DEF80070EBB6 /* FWNavigatorProtocol.swift */,
190
+ 897523742817DEF80070EBB6 /* FWNavigatorContainerViewController.swift */,
191
+ 897523752817DEF80070EBB6 /* FWNavigatorModule.swift */,
192
+ 897523762817DEF80070EBB6 /* FWNavigatorModule.m */,
193
+ );
194
+ path = FWNavigatorModule;
195
+ sourceTree = "<group>";
196
+ };
197
+ 897523772817DEF80070EBB6 /* Shopping */ = {
198
+ isa = PBXGroup;
199
+ children = (
200
+ 897523782817DEF80070EBB6 /* CartViewController.swift */,
201
+ 897523792817DEF80070EBB6 /* ShoppingModule.m */,
202
+ 8975237A2817DEF80070EBB6 /* ProductInfoViewConfiguration.swift */,
203
+ 8975237B2817DEF80070EBB6 /* Product.swift */,
204
+ 8975237C2817DEF80070EBB6 /* ShoppingModule.swift */,
205
+ );
206
+ path = Shopping;
207
+ sourceTree = "<group>";
208
+ };
209
+ 8975237D2817DEF80070EBB6 /* FireworkSDKModule */ = {
210
+ isa = PBXGroup;
211
+ children = (
212
+ 8975237E2817DEF80070EBB6 /* MobileADConfiguration.swift */,
213
+ 8975237F2817DEF80070EBB6 /* FireworkSDKModule+EventTracking.swift */,
214
+ 897523802817DEF80070EBB6 /* FireworkSDKModule.swift */,
215
+ 897523812817DEF80070EBB6 /* AdBadgeConfiguration.swift */,
216
+ 897523822817DEF80070EBB6 /* FireworkSDKModule+CTA.swift */,
217
+ 897523832817DEF80070EBB6 /* FireworkSDKModule.m */,
218
+ );
219
+ path = FireworkSDKModule;
220
+ sourceTree = "<group>";
221
+ };
222
+ 897523842817DEF80070EBB6 /* LiveStream */ = {
223
+ isa = PBXGroup;
224
+ children = (
225
+ 897523852817DEF80070EBB6 /* LiveStreamModule.swift */,
226
+ 897523862817DEF80070EBB6 /* LiveStreamModule.m */,
227
+ );
228
+ path = LiveStream;
229
+ sourceTree = "<group>";
230
+ };
70
231
  /* End PBXGroup section */
71
232
 
72
233
  /* Begin PBXNativeTarget section */
@@ -124,10 +285,37 @@
124
285
  isa = PBXSourcesBuildPhase;
125
286
  buildActionMask = 2147483647;
126
287
  files = (
127
- 1F6F718E2771B48200224AF3 /* FireworkSdk+CTA.swift in Sources */,
128
- 1F6F718C2771B48200224AF3 /* FireworkSdk+EventTracking.swift in Sources */,
129
- 1F6F718D2771B48200224AF3 /* FireworkSdk.swift in Sources */,
130
- 1F6F718F2771B48200224AF3 /* FireworkSdk.m in Sources */,
288
+ 8975238A2817DEF80070EBB6 /* UIView+ParentViewController.swift in Sources */,
289
+ 8975239B2817DEF80070EBB6 /* FireworkSDKModule.swift in Sources */,
290
+ 897523952817DEF80070EBB6 /* ShoppingModule.m in Sources */,
291
+ 897523A02817DEF80070EBB6 /* LiveStreamModule.m in Sources */,
292
+ 8975238E2817DEF80070EBB6 /* FireworkSDK+Json.swift in Sources */,
293
+ 897523992817DEF80070EBB6 /* MobileADConfiguration.swift in Sources */,
294
+ 8975235F2817DEEE0070EBB6 /* VideoFeedConfiguration.swift in Sources */,
295
+ 897523612817DEEE0070EBB6 /* VideoPlayerConfiguration.swift in Sources */,
296
+ 897523972817DEF80070EBB6 /* Product.swift in Sources */,
297
+ 897523932817DEF80070EBB6 /* FWNavigatorModule.m in Sources */,
298
+ 897523922817DEF80070EBB6 /* FWNavigatorModule.swift in Sources */,
299
+ 897523872817DEF80070EBB6 /* UIViewController+AttachChild.swift in Sources */,
300
+ 897523902817DEF80070EBB6 /* FWNavigatorProtocol.swift in Sources */,
301
+ 897523882817DEF80070EBB6 /* UIView+Constraints.swift in Sources */,
302
+ 897523982817DEF80070EBB6 /* ShoppingModule.swift in Sources */,
303
+ 8975239C2817DEF80070EBB6 /* AdBadgeConfiguration.swift in Sources */,
304
+ 897523942817DEF80070EBB6 /* CartViewController.swift in Sources */,
305
+ 8975239A2817DEF80070EBB6 /* FireworkSDKModule+EventTracking.swift in Sources */,
306
+ 8975239E2817DEF80070EBB6 /* FireworkSDKModule.m in Sources */,
307
+ 897523962817DEF80070EBB6 /* ProductInfoViewConfiguration.swift in Sources */,
308
+ 8975238D2817DEF80070EBB6 /* RCTConvert+VideoFeed.swift in Sources */,
309
+ 8975238C2817DEF80070EBB6 /* RCTConvert+Shopping.swift in Sources */,
310
+ 897523602817DEEE0070EBB6 /* VideoFeed.swift in Sources */,
311
+ 8975235E2817DEEE0070EBB6 /* VideoFeedManager.swift in Sources */,
312
+ 8975239D2817DEF80070EBB6 /* FireworkSDKModule+CTA.swift in Sources */,
313
+ 897523892817DEF80070EBB6 /* String+Color.swift in Sources */,
314
+ 897523622817DEEE0070EBB6 /* VideoFeedManager.m in Sources */,
315
+ 897523912817DEF80070EBB6 /* FWNavigatorContainerViewController.swift in Sources */,
316
+ 8975238F2817DEF80070EBB6 /* FireworkEventName.swift in Sources */,
317
+ 8975238B2817DEF80070EBB6 /* RCTConvert+FireworkSDKModule.swift in Sources */,
318
+ 8975239F2817DEF80070EBB6 /* LiveStreamModule.swift in Sources */,
131
319
  );
132
320
  runOnlyForDeploymentPostprocessing = 0;
133
321
  };
@@ -0,0 +1,40 @@
1
+ //
2
+ // FWNavigatorContainerViewController.swift
3
+ // react-native-firework-sdk
4
+ //
5
+ // Created by 熊韦华 on 2022/4/22.
6
+ //
7
+
8
+ import UIKit
9
+
10
+ class FWNavigatorContainerViewController: UIViewController {
11
+ var callbackId: String!
12
+
13
+ init(callbackId: String) {
14
+ self.callbackId = callbackId
15
+ super.init(nibName: nil, bundle: nil)
16
+ }
17
+
18
+ required init?(coder: NSCoder) {
19
+ super.init(coder: coder)
20
+ }
21
+
22
+ override func viewDidLoad() {
23
+ super.viewDidLoad()
24
+ loadContent()
25
+ }
26
+
27
+ private func loadContent() {
28
+ let rctRootView = RCTRootView.init(bridge: RCTBridge.current(), moduleName: "FWNavigationContainer", initialProperties: ["callbackId": callbackId ?? ""])
29
+ view.addSubview(rctRootView)
30
+ rctRootView.translatesAutoresizingMaskIntoConstraints = false
31
+
32
+ NSLayoutConstraint.activate([
33
+ rctRootView.leftAnchor.constraint(equalTo: view.leftAnchor),
34
+ rctRootView.topAnchor.constraint(equalTo: view.topAnchor),
35
+ rctRootView.rightAnchor.constraint(equalTo: view.rightAnchor),
36
+ rctRootView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
37
+ ])
38
+ }
39
+
40
+ }
@@ -0,0 +1,17 @@
1
+ //
2
+ // FWNavigatorModule.m
3
+ // react-native-firework-sdk
4
+ //
5
+ // Created by 熊韦华 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:(NSString *)callbackId resolver:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
15
+ RCT_EXTERN_METHOD(popNativeContainer:(RCTPromiseResolveBlock)resolver rejecter:(RCTPromiseRejectBlock)rejecter)
16
+
17
+ @end