vxrn 2.0.0-beta.97.1 → 2.0.0-beta.99.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.
@@ -1136,14 +1136,12 @@ async function generateSplashScreen(args) {
1136
1136
  FSExtra.writeFileSync(stylesPath, styles);
1137
1137
  var stylesV31 = path.join(mainRes, "values-v31");
1138
1138
  FSExtra.mkdirSync(stylesV31, { recursive: true });
1139
- FSExtra.writeFileSync(path.join(stylesV31, "styles.xml"), `<?xml version="1.0" encoding="utf-8"?>
1140
- <resources>
1141
- <style name="AppTheme">
1142
- <item name="android:windowSplashScreenBackground">@color/splash_background</item>
1139
+ if (!styles.includes("</style>")) {
1140
+ throw new Error("[vxrn] prebuild template styles.xml lost its AppTheme </style> anchor");
1141
+ }
1142
+ FSExtra.writeFileSync(path.join(stylesV31, "styles.xml"), styles.replace("</style>", ` <item name="android:windowSplashScreenBackground">@color/splash_background</item>
1143
1143
  <item name="android:windowSplashScreenAnimatedIcon">@drawable/splash</item>
1144
- </style>
1145
- </resources>
1146
- `);
1144
+ </style>`));
1147
1145
  }
1148
1146
  function renderPrebuildFile(args) {
1149
1147
  var { relativePath, content, platform, app, nitroWebImage } = args;
@@ -1187,7 +1185,7 @@ function renderPrebuildFile(args) {
1187
1185
  }
1188
1186
  }
1189
1187
  if (platform === "ios" && relativePath.endsWith("/Info.plist")) {
1190
- var _app_ios1, _app_ios2, _app_ios3;
1188
+ var _app_ios1, _app_ios2, _app_notifications2, _app_ios3;
1191
1189
  var stamps = [];
1192
1190
  if (schemes.length) {
1193
1191
  stamps.push(` <key>CFBundleURLTypes</key>
@@ -1216,11 +1214,18 @@ ${schemes.map(function(scheme) {
1216
1214
  }
1217
1215
  if (app.notifications !== void 0) {
1218
1216
  stamps.push(` <key>OneNativeNotificationsEnabled</key>
1217
+ <true/>`);
1218
+ }
1219
+ if (((_app_notifications2 = app.notifications) === null || _app_notifications2 === void 0 ? void 0 : _app_notifications2.push) === true) {
1220
+ stamps.push(` <key>OneNativeNotificationsPush</key>
1219
1221
  <true/>`);
1220
1222
  }
1221
1223
  if ((_app_ios3 = app.ios) === null || _app_ios3 === void 0 ? void 0 : _app_ios3.widgets) {
1222
1224
  stamps.push(" <key>NSSupportsLiveActivities</key>\n <true/>");
1223
1225
  }
1226
+ if (app.pictureInPicture) {
1227
+ stamps.push(" <key>UIBackgroundModes</key>\n <array>\n <string>audio</string>\n </array>");
1228
+ }
1224
1229
  if (stamps.length) {
1225
1230
  var anchor = " <key>LSRequiresIPhoneOS</key>";
1226
1231
  if (!rendered.includes(anchor)) throw new Error(`[vxrn] prebuild template ${relativePath} lost its LSRequiresIPhoneOS anchor`);
@@ -1292,6 +1297,14 @@ ${line1}
1292
1297
  `;
1293
1298
  }
1294
1299
  }
1300
+ if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && app.pictureInPicture) {
1301
+ var anchor5 = "android:name=\".MainActivity\"";
1302
+ if (!rendered.includes(anchor5)) {
1303
+ throw new Error("[vxrn] cannot stamp picture in picture: expected .MainActivity in app/src/main/AndroidManifest.xml");
1304
+ }
1305
+ rendered = rendered.replace(anchor5, `${anchor5}
1306
+ android:supportsPictureInPicture="true"`);
1307
+ }
1295
1308
  if (platform === "android" && relativePath === "app/src/main/AndroidManifest.xml" && schemes.length) {
1296
1309
  rendered = rendered.replace(" </activity>", ` <intent-filter>
1297
1310
  <action android:name="android.intent.action.VIEW" />
@@ -1319,13 +1332,13 @@ ${schemes.map(function(scheme) {
1319
1332
  if (platform === "ios" && relativePath.endsWith("/Info.plist")) {
1320
1333
  var _app_imagePicker1;
1321
1334
  if (((_app_imagePicker1 = app.imagePicker) === null || _app_imagePicker1 === void 0 ? void 0 : _app_imagePicker1.camera) !== void 0) {
1322
- var anchor5 = " <key>LSRequiresIPhoneOS</key>";
1323
- if (!rendered.includes(anchor5)) {
1335
+ var anchor6 = " <key>LSRequiresIPhoneOS</key>";
1336
+ if (!rendered.includes(anchor6)) {
1324
1337
  throw new Error("[vxrn] cannot stamp NSCameraUsageDescription: expected LSRequiresIPhoneOS in Info.plist");
1325
1338
  }
1326
- rendered = rendered.replace(anchor5, ` <key>NSCameraUsageDescription</key>
1339
+ rendered = rendered.replace(anchor6, ` <key>NSCameraUsageDescription</key>
1327
1340
  <string>${escapeXml(app.imagePicker.camera)}</string>
1328
- ${anchor5}`);
1341
+ ${anchor6}`);
1329
1342
  }
1330
1343
  rendered = patchIosInfoPlistSceneManifest(rendered);
1331
1344
  }
@@ -1347,10 +1360,10 @@ end`);
1347
1360
  }
1348
1361
  }
1349
1362
  if (platform === "ios" && relativePath.endsWith(".xcodeproj/project.pbxproj")) {
1350
- var _app_notifications2, _app_ios6, _app_ios7;
1363
+ var _app_notifications3, _app_ios6, _app_ios7;
1351
1364
  rendered = patchIosBundlePhase(rendered);
1352
1365
  rendered = patchIosPbxprojSceneDelegate(rendered, appName);
1353
- if (((_app_notifications2 = app.notifications) === null || _app_notifications2 === void 0 ? void 0 : _app_notifications2.push) === true && !((_app_ios6 = app.ios) === null || _app_ios6 === void 0 ? void 0 : _app_ios6.widgets)) {
1366
+ if (((_app_notifications3 = app.notifications) === null || _app_notifications3 === void 0 ? void 0 : _app_notifications3.push) === true && !((_app_ios6 = app.ios) === null || _app_ios6 === void 0 ? void 0 : _app_ios6.widgets)) {
1354
1367
  rendered = patchIosPbxprojPushEntitlements(rendered, appName);
1355
1368
  }
1356
1369
  if ((_app_ios7 = app.ios) === null || _app_ios7 === void 0 ? void 0 : _app_ios7.widgets) rendered = patchIosPbxprojWidgets(rendered, app);
@@ -1599,7 +1612,7 @@ function generateSwiftPackages(param) {
1599
1612
  s.source_files = 'Sources/**/*.swift', 'Register.m'
1600
1613
  s.dependency 'VxrnNative'
1601
1614
  s.pod_target_xcconfig = {
1602
- 'OTHER_SWIFT_FLAGS' => '$(inherited) -Xfrontend -import-module -Xfrontend VxrnNative -Xfrontend -entry-point-function-name -Xfrontend ${id}_main',
1615
+ 'OTHER_SWIFT_FLAGS' => '$(inherited) -cxx-interoperability-mode=default -Xcc -std=c++20 -Xfrontend -import-module -Xfrontend VxrnNative -Xfrontend -entry-point-function-name -Xfrontend ${id}_main',
1603
1616
  }
1604
1617
  end
1605
1618
  `);