pulse-updates 1.3.2 → 1.3.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.
@@ -15,6 +15,16 @@ buildscript {
15
15
  apply plugin: 'com.android.library'
16
16
  apply plugin: 'kotlin-android'
17
17
 
18
+ def isNewArchitectureEnabled() {
19
+ return project.hasProperty('newArchEnabled') && project.newArchEnabled == 'true'
20
+ }
21
+
22
+ // The host autolinker adds this library's codegen target to Android-autolinking.cmake.
23
+ // Apply the React plugin in New Architecture builds so that target is actually generated.
24
+ if (isNewArchitectureEnabled()) {
25
+ apply plugin: 'com.facebook.react'
26
+ }
27
+
18
28
  android {
19
29
  namespace "app.pulse.updates"
20
30
  compileSdkVersion safeExtGet('compileSdkVersion', 34)
@@ -28,6 +38,9 @@ android {
28
38
  sourceSets {
29
39
  main {
30
40
  java.srcDirs = ['src/main/java']
41
+ if (isNewArchitectureEnabled()) {
42
+ java.srcDirs += ["${project.buildDir}/generated/source/codegen/java"]
43
+ }
31
44
  }
32
45
  }
33
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pulse-updates",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "Pulse app-experience SDK for React Native: updates, config, experiments, events, decisions and first-party links",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -495,11 +495,18 @@ function parseArgs() {
495
495
  /**
496
496
  * Find Info.plist and return its path and content
497
497
  */
498
+ export function selectIOSInfoPlist(candidates) {
499
+ return candidates.find(({ content }) => /<key>PulseUpdatesURL<\/key>/.test(content)) ||
500
+ candidates[0] ||
501
+ null;
502
+ }
503
+
498
504
  function findInfoPlist() {
499
505
  const possiblePaths = [
500
506
  'ios/App/Info.plist',
501
507
  'ios/*/Info.plist',
502
508
  ];
509
+ const candidates = [];
503
510
 
504
511
  for (const pattern of possiblePaths) {
505
512
  if (pattern.includes('*')) {
@@ -512,25 +519,25 @@ function findInfoPlist() {
512
519
  const plistPath = path.join(baseDir, dir, 'Info.plist');
513
520
  if (fs.existsSync(plistPath)) {
514
521
  try {
515
- return {
522
+ candidates.push({
516
523
  path: plistPath,
517
524
  content: fs.readFileSync(plistPath, 'utf8'),
518
- };
525
+ });
519
526
  } catch {}
520
527
  }
521
528
  }
522
529
  }
523
530
  } else if (fs.existsSync(pattern)) {
524
531
  try {
525
- return {
532
+ candidates.push({
526
533
  path: pattern,
527
534
  content: fs.readFileSync(pattern, 'utf8'),
528
- };
535
+ });
529
536
  } catch {}
530
537
  }
531
538
  }
532
539
 
533
- return null;
540
+ return selectIOSInfoPlist(candidates);
534
541
  }
535
542
 
536
543
  /**