setupad-prebid-react-native 0.2.2 → 0.2.4
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.
|
@@ -452,6 +452,7 @@ class VeonPrebidReactNativeView(private val reactContext: ReactContext) : FrameL
|
|
|
452
452
|
override fun onDetachedFromWindow() {
|
|
453
453
|
super.onDetachedFromWindow()
|
|
454
454
|
Log.d(TAG, "View detached from window")
|
|
455
|
-
destroy
|
|
455
|
+
// Do not destroy here — navigation causes detach/reattach.
|
|
456
|
+
// Cleanup is handled by ViewManager.onDropViewInstance() when the view is truly removed.
|
|
456
457
|
}
|
|
457
458
|
}
|
package/android/src/main/java/com/setupadprebidreactnative/VeonPrebidReactNativeViewManager.kt
CHANGED
|
@@ -7,6 +7,7 @@ import com.facebook.react.bridge.ReactApplicationContext
|
|
|
7
7
|
import com.facebook.react.bridge.ReadableArray
|
|
8
8
|
import com.facebook.react.bridge.WritableMap
|
|
9
9
|
import com.facebook.react.module.annotations.ReactModule
|
|
10
|
+
import com.facebook.react.bridge.UiThreadUtil
|
|
10
11
|
import com.facebook.react.uimanager.SimpleViewManager
|
|
11
12
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
12
13
|
import com.facebook.react.uimanager.annotations.ReactProp
|
|
@@ -109,17 +110,19 @@ class VeonPrebidReactNativeViewManager(
|
|
|
109
110
|
) {
|
|
110
111
|
Log.d(TAG, "Received command (String): $commandId")
|
|
111
112
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
113
|
+
UiThreadUtil.runOnUiThread {
|
|
114
|
+
when (commandId) {
|
|
115
|
+
"loadBanner", COMMAND_LOAD_BANNER.toString() -> view.loadBanner()
|
|
116
|
+
"showBanner", COMMAND_SHOW_BANNER.toString() -> view.showBanner()
|
|
117
|
+
"hideBanner", COMMAND_HIDE_BANNER.toString() -> view.hideBanner()
|
|
118
|
+
"loadInterstitial", COMMAND_LOAD_INTERSTITIAL.toString() -> view.loadInterstitial()
|
|
119
|
+
"showInterstitial", COMMAND_SHOW_INTERSTITIAL.toString() -> view.showInterstitial()
|
|
120
|
+
"hideInterstitial", COMMAND_HIDE_INTERSTITIAL.toString() -> view.hideInterstitial()
|
|
121
|
+
"pauseAuction", COMMAND_PAUSE_AUCTION.toString() -> view.pauseAuction()
|
|
122
|
+
"resumeAuction", COMMAND_RESUME_AUCTION.toString() -> view.resumeAuction()
|
|
123
|
+
"destroyAuction", COMMAND_DESTROY_AUCTION.toString() -> view.destroyAuction()
|
|
124
|
+
else -> Log.w(TAG, "Unknown command: $commandId")
|
|
125
|
+
}
|
|
123
126
|
}
|
|
124
127
|
}
|
|
125
128
|
|
|
@@ -133,17 +136,19 @@ class VeonPrebidReactNativeViewManager(
|
|
|
133
136
|
) {
|
|
134
137
|
Log.d(TAG, "Received command (Int): $commandId")
|
|
135
138
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
139
|
+
UiThreadUtil.runOnUiThread {
|
|
140
|
+
when (commandId) {
|
|
141
|
+
COMMAND_LOAD_BANNER -> view.loadBanner()
|
|
142
|
+
COMMAND_SHOW_BANNER -> view.showBanner()
|
|
143
|
+
COMMAND_HIDE_BANNER -> view.hideBanner()
|
|
144
|
+
COMMAND_LOAD_INTERSTITIAL -> view.loadInterstitial()
|
|
145
|
+
COMMAND_SHOW_INTERSTITIAL -> view.showInterstitial()
|
|
146
|
+
COMMAND_HIDE_INTERSTITIAL -> view.hideInterstitial()
|
|
147
|
+
COMMAND_PAUSE_AUCTION -> view.pauseAuction()
|
|
148
|
+
COMMAND_RESUME_AUCTION -> view.resumeAuction()
|
|
149
|
+
COMMAND_DESTROY_AUCTION -> view.destroyAuction()
|
|
150
|
+
else -> Log.w(TAG, "Unknown command: $commandId")
|
|
151
|
+
}
|
|
147
152
|
}
|
|
148
153
|
}
|
|
149
154
|
|