cloudx-react-native 3.4.4 → 3.4.6

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.
@@ -72,5 +72,5 @@ repositories {
72
72
  dependencies {
73
73
  implementation "com.facebook.react:react-native:0.76.2"
74
74
 
75
- implementation "io.cloudx:sdk:4.1.3"
75
+ implementation "io.cloudx:sdk:4.1.5"
76
76
  }
@@ -14,7 +14,7 @@ Pod::Spec.new do |s|
14
14
 
15
15
  s.requires_arc = true
16
16
 
17
- s.dependency "CloudXCore", "~> 3.4.4"
17
+ s.dependency "CloudXCore", "~> 3.4.5"
18
18
 
19
19
  s.source_files = "ios/**/*.{h,mm}"
20
20
 
package/ios/CloudX.mm CHANGED
@@ -1421,22 +1421,54 @@ RCT_EXPORT_METHOD(destroyRewarded:(NSString *)adUnitIdentifier)
1421
1421
  return [self deepestPresentedViewControllerFrom: [self keyWindowRootViewController]];
1422
1422
  }
1423
1423
 
1424
- /// Scene-based key-window lookup (iOS 13+). Returns the root view controller of the
1425
- /// foreground-active scene's key window, resolving the window at call time so callers
1426
- /// never hold a stale reference.
1424
+ /// Scene-based key-window lookup (iOS 13+) with progressive fallbacks. Resolves the
1425
+ /// window at call time so callers never hold a stale reference.
1426
+ ///
1427
+ /// The strict "foreground-active scene + isKeyWindow" path holds on the New
1428
+ /// Architecture (Fabric), but a New-Architecture-style key window is not always
1429
+ /// reported on the Old Architecture (Paper): the host window created by
1430
+ /// RCTAppDelegate may not flag isKeyWindow at the moment a fullscreen ad is shown,
1431
+ /// which previously left interstitial/rewarded ads with no presenter and surfaced
1432
+ /// as a "no visible view controller" display failure. Fall back through
1433
+ /// progressively looser candidates so a valid root is found on both architectures.
1427
1434
  - (nullable UIViewController *)keyWindowRootViewController
1428
1435
  {
1429
- for ( UIScene *scene in UIApplication.sharedApplication.connectedScenes )
1436
+ NSArray<UIScene *> *scenes = UIApplication.sharedApplication.connectedScenes.allObjects;
1437
+
1438
+ // Priority 1: key window of a foreground-active window scene (the common case).
1439
+ // Priority 2: any window with a root in a foreground-active scene (OldArch).
1440
+ UIViewController *foregroundFallback = nil;
1441
+ for ( UIScene *scene in scenes )
1430
1442
  {
1431
1443
  if ( scene.activationState != UISceneActivationStateForegroundActive ) continue;
1432
1444
  if ( ![scene isKindOfClass: [UIWindowScene class]] ) continue;
1433
1445
 
1434
- UIWindowScene *windowScene = (UIWindowScene *)scene;
1435
- for ( UIWindow *window in windowScene.windows )
1446
+ for ( UIWindow *window in ((UIWindowScene *)scene).windows )
1436
1447
  {
1437
- if ( window.isKeyWindow ) return window.rootViewController;
1448
+ if ( window.isKeyWindow && window.rootViewController ) return window.rootViewController;
1449
+ if ( !foregroundFallback && window.rootViewController ) foregroundFallback = window.rootViewController;
1438
1450
  }
1439
1451
  }
1452
+ if ( foregroundFallback ) return foregroundFallback;
1453
+
1454
+ // Priority 3: any window scene regardless of activation state.
1455
+ for ( UIScene *scene in scenes )
1456
+ {
1457
+ if ( ![scene isKindOfClass: [UIWindowScene class]] ) continue;
1458
+ for ( UIWindow *window in ((UIWindowScene *)scene).windows )
1459
+ {
1460
+ if ( window.rootViewController ) return window.rootViewController;
1461
+ }
1462
+ }
1463
+
1464
+ // Priority 4: the app delegate's window (classic non-scene window setup).
1465
+ id<UIApplicationDelegate> appDelegate = UIApplication.sharedApplication.delegate;
1466
+ if ( [appDelegate respondsToSelector: @selector(window)] )
1467
+ {
1468
+ UIWindow *window = appDelegate.window;
1469
+ if ( window.rootViewController ) return window.rootViewController;
1470
+ }
1471
+
1440
1472
  return nil;
1441
1473
  }
1442
1474
 
@@ -5,6 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.PLUGIN_VERSION = void 0;
7
7
  // Keep PLUGIN_VERSION in sync with the `version` field in package.json.
8
- // Phase 1 of RELEASE.md bumps both together.
9
- const PLUGIN_VERSION = exports.PLUGIN_VERSION = '3.4.4';
8
+ // RELEASE.md Phase 1 bumps both together (see the Version Files table).
9
+ // This value is reported to the native SDK in CloudX.initialize() and is used
10
+ // for wrapper-version telemetry/attribution, so a stale value mis-attributes
11
+ // installs to the wrong release.
12
+ const PLUGIN_VERSION = exports.PLUGIN_VERSION = '3.4.6';
10
13
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["PLUGIN_VERSION","exports"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;;;;;AAAA;AACA;AACO,MAAMA,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["PLUGIN_VERSION","exports"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACO,MAAMA,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,OAAO","ignoreList":[]}
@@ -1,4 +1,7 @@
1
1
  // Keep PLUGIN_VERSION in sync with the `version` field in package.json.
2
- // Phase 1 of RELEASE.md bumps both together.
3
- export const PLUGIN_VERSION = '3.4.4';
2
+ // RELEASE.md Phase 1 bumps both together (see the Version Files table).
3
+ // This value is reported to the native SDK in CloudX.initialize() and is used
4
+ // for wrapper-version telemetry/attribution, so a stale value mis-attributes
5
+ // installs to the wrong release.
6
+ export const PLUGIN_VERSION = '3.4.6';
4
7
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["PLUGIN_VERSION"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":"AAAA;AACA;AACA,OAAO,MAAMA,cAAc,GAAG,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["PLUGIN_VERSION"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,cAAc,GAAG,OAAO","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- export declare const PLUGIN_VERSION = "3.4.4";
1
+ export declare const PLUGIN_VERSION = "3.4.6";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,cAAc,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudx-react-native",
3
- "version": "3.4.4",
3
+ "version": "3.4.6",
4
4
  "description": "React Native wrapper for CloudX SDK (iOS & Android)",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
package/src/version.ts CHANGED
@@ -1,3 +1,6 @@
1
1
  // Keep PLUGIN_VERSION in sync with the `version` field in package.json.
2
- // Phase 1 of RELEASE.md bumps both together.
3
- export const PLUGIN_VERSION = '3.4.4';
2
+ // RELEASE.md Phase 1 bumps both together (see the Version Files table).
3
+ // This value is reported to the native SDK in CloudX.initialize() and is used
4
+ // for wrapper-version telemetry/attribution, so a stale value mis-attributes
5
+ // installs to the wrong release.
6
+ export const PLUGIN_VERSION = '3.4.6';