@sellwild/react-native-sdk 1.7.0 → 1.7.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.
@@ -152,6 +152,10 @@ class SellwildBannerViewManager : SimpleViewManager<SellwildAdView>() {
152
152
  }
153
153
 
154
154
  override fun onDropViewInstance(view: SellwildAdView) {
155
+ // Tear down the native ad view on unmount so its GMA / Prebid banners are
156
+ // released deterministically. Without this the views leak until GC (iOS
157
+ // RN gets this for free via ARC deinit). Mirrors SellwildFeedView cleanup.
158
+ view.destroy()
155
159
  pending.remove(view)
156
160
  super.onDropViewInstance(view)
157
161
  }
@@ -11,6 +11,7 @@ import com.facebook.react.uimanager.annotations.ReactProp
11
11
  import com.facebook.react.uimanager.events.RCTEventEmitter
12
12
  import com.sellwild.sdk.SellwildConfig
13
13
  import com.sellwild.sdk.SellwildFeedView
14
+ import com.sellwild.sdk.SellwildGrowthCodeConfig
14
15
  import com.sellwild.sdk.SellwildListing
15
16
  import com.sellwild.sdk.SellwildLocalizedListingsConfig
16
17
  import com.sellwild.sdk.SellwildSDK
@@ -185,11 +186,52 @@ class SellwildFeedViewManager : SimpleViewManager<SellwildFeedView>() {
185
186
  if (map.hasKey("adRefreshMax")) config = config.copy(adRefreshMax = map.getInt("adRefreshMax"))
186
187
  if (map.hasKey("adRefreshMaxMobile")) config = config.copy(adRefreshMaxMobile = map.getInt("adRefreshMaxMobile"))
187
188
  if (map.hasKey("adRefreshIntervalMs")) config = config.copy(adRefreshIntervalMs = map.getDouble("adRefreshIntervalMs").toLong())
189
+
190
+ // Flat identity/display/zone fields — mirror the iOS feed bridge so
191
+ // static buildConfig() and overrides land identically. SellwildSDK.apply
192
+ // (above) resolves these from `remote` when present; these overlay on top.
193
+ if (map.hasKey("slug")) config = config.copy(slug = map.getString("slug") ?: config.slug)
194
+ if (map.hasKey("listingsUrl")) config = config.copy(listingsUrl = map.getString("listingsUrl"))
195
+ if (map.hasKey("priceColor")) config = config.copy(priceColor = map.getString("priceColor") ?: config.priceColor)
196
+ if (map.hasKey("bannerZid")) config = config.copy(bannerZid = map.getString("bannerZid"))
197
+ if (map.hasKey("bottomBannerZid")) config = config.copy(bottomBannerZid = map.getString("bottomBannerZid"))
198
+ // mobileZids / mobileBannerZid are OS-suffix-resolved by SellwildSDK.apply
199
+ // when `remote` is present; only fall back to the flat (OS-agnostic) JS
200
+ // values when there was no remote payload to resolve from (parity w/ iOS).
201
+ if (!map.hasKey("remote") || map.isNull("remote")) {
202
+ if (map.hasKey("mobileBannerZid")) config = config.copy(mobileBannerZid = map.getString("mobileBannerZid"))
203
+ if (map.hasKey("mobileZids") && !map.isNull("mobileZids")) {
204
+ val arr = map.getArray("mobileZids")
205
+ if (arr != null) config = config.copy(mobileZids = (0 until arr.size()).mapNotNull { arr.getString(it) })
206
+ }
207
+ }
208
+
188
209
  // Custom Prebid Server (S2S) config — mirror the iOS feed bridge.
189
210
  if (map.hasKey("prebidServer") && !map.isNull("prebidServer")) {
190
211
  config = config.copy(prebidServer = RnPrebidServer.fromMap(map.getMap("prebidServer")))
191
212
  }
192
213
 
214
+ // Local GrowthCode override — parity with the banner bridge and the
215
+ // iOS feed bridge. Without it the feed's ad rows only see remote
216
+ // GROWTHCODE_* keys; a code-supplied partnerId never reaches the
217
+ // auction, so the identity sync never fires for feed ad rows.
218
+ if (map.hasKey("growthCode") && !map.isNull("growthCode")) {
219
+ val gc = map.getMap("growthCode")!!
220
+ fun bool(k: String): Boolean? = if (gc.hasKey(k) && !gc.isNull(k)) gc.getBoolean(k) else null
221
+ fun str(k: String): String? = if (gc.hasKey(k) && !gc.isNull(k)) gc.getString(k) else null
222
+ fun int(k: String): Int? = if (gc.hasKey(k) && !gc.isNull(k)) gc.getInt(k) else null
223
+ config = config.copy(
224
+ growthCode = SellwildGrowthCodeConfig(
225
+ enabled = bool("enabled"),
226
+ partnerId = str("partnerId"),
227
+ endpoint = str("endpoint"),
228
+ syncUrl = str("syncUrl"),
229
+ sendMaid = bool("sendMaid"),
230
+ ttlHours = int("ttlHours"),
231
+ ),
232
+ )
233
+ }
234
+
193
235
  // Local override for the localized (geo-based) secondary-listings
194
236
  // integration; the remote LOCALIZED_LISTINGS object rides `remote`.
195
237
  if (map.hasKey("localizedListings") && !map.isNull("localizedListings")) {
@@ -207,6 +207,21 @@ final class SellwildFeedHostView: UIView, SellwildFeedViewDelegate {
207
207
  )
208
208
  }
209
209
 
210
+ // Local GrowthCode override — parity with the banner bridge. Without
211
+ // this the feed's ad rows only see remote GROWTHCODE_* keys (via
212
+ // remoteJSON); a code-supplied partnerId never reaches the auction, so
213
+ // the identity sync never fires and feed ad rows lose eids enrichment.
214
+ if let gc = map["growthCode"] as? NSDictionary {
215
+ cfg.growthCode = SellwildGrowthCodeConfig(
216
+ enabled: gc["enabled"] as? Bool,
217
+ partnerId: gc["partnerId"] as? String,
218
+ endpoint: gc["endpoint"] as? String,
219
+ syncUrl: gc["syncUrl"] as? String,
220
+ sendMaid: gc["sendMaid"] as? Bool,
221
+ ttlHours: gc["ttlHours"] as? Int
222
+ )
223
+ }
224
+
210
225
  // Local override for the localized (geo-based) secondary-listings
211
226
  // integration; remote LOCALIZED_LISTINGS rides `remote` verbatim.
212
227
  if let ll = map["localizedListings"] as? NSDictionary {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellwild/react-native-sdk",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "Sellwild mobile advertising SDK for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -166,6 +166,9 @@ export function SellwildFeed({
166
166
  prebidServer: config.prebidServer,
167
167
  // Local localized-listings overrides (remote LOCALIZED_LISTINGS rides `remote`).
168
168
  localizedListings: config.localizedListings,
169
+ // Local GrowthCode overrides (remote GROWTHCODE_* rides `remote`) — parity
170
+ // with SellwildBanner so the feed's native auctions honor local overrides too.
171
+ growthCode: config.growthCode,
169
172
  remote: config.remote,
170
173
  listingsUrl: config.listingsUrl,
171
174
  priceColor: config.priceColor,