Skip to content

Commit

Permalink
fix ios
Browse files Browse the repository at this point in the history
  • Loading branch information
ElenaDiachenko committed Dec 18, 2024
1 parent 8000d13 commit bb3a616
Show file tree
Hide file tree
Showing 10 changed files with 175 additions and 203 deletions.
3 changes: 2 additions & 1 deletion packages/app-harness/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ ruby ">= 2.6.10"
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'xcodeproj', '< 1.26.0'
gem 'cocoapods-user-defined-build-types'
5 changes: 3 additions & 2 deletions packages/app-harness/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ PLATFORMS
ruby

DEPENDENCIES
activesupport (~> 7.0, <= 7.0.8)
cocoapods (~> 1.13, < 1.15)
activesupport (>= 6.1.7.5, != 7.1.0)
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
cocoapods-user-defined-build-types
xcodeproj (< 1.26.0)

RUBY VERSION
ruby 3.0.2p107
Expand Down
4 changes: 2 additions & 2 deletions packages/app-harness/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
"react-native-carplay": "2.3.0",
"react-native-fs": "2.20.0",
"react-native-gesture-handler": "2.21.2",
"react-native-google-cast": "4.8.0",
"react-native-google-cast": "4.8.3",
"react-native-orientation-locker": "1.7.0",
"react-native-permissions": "4.1.5",
"react-native-permissions": "5.2.1",
"react-native-photo-editor": "github:AppGyver/react-native-photo-editor#0.1.2",
"react-native-safe-area-context": "5.0.0",
"react-native-splash-screen": "3.3.0",
Expand Down
12 changes: 6 additions & 6 deletions packages/config-templates/renative.templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -455,11 +455,11 @@
},
"@react-native-community/cli": {
"disableNpm": true,
"version": "^12.3.6",
"version": "^15.0.1",
"supportedPlatforms": ["tvos", "ios"]
},
"@react-native-community/cli-platform-android": {
"version": "^12.3.6"
"version": "^15.0.1"
},
"@react-native-community/cli-platform-ios": {
"version": "12.3.6",
Expand Down Expand Up @@ -2463,7 +2463,7 @@
"DISABLE_DISCOVERY_AUTOSTART": "false",
"START_DISCOVERY_AFTER_FIRST_TAP_ON_CAST_BUTTON": "false"
},
"version": "4.8.0"
"version": "4.8.3"
},
"react-native-home-indicator": {
"ios": {
Expand Down Expand Up @@ -2900,7 +2900,7 @@
"tvos": {
"podName": "RNPermissions"
},
"version": "4.1.5"
"version": "5.2.1"
},
"react-native-permissions-pods": {
"ios": {
Expand Down Expand Up @@ -3579,7 +3579,7 @@
"version": "0.40.1"
},
"react-native-windows": {
"version": "0.67.3"
"version": "0.76.2"
},
"react-native-zip-archive": {
"android": {
Expand Down Expand Up @@ -3681,7 +3681,7 @@
"Sentry": {
"ios": {
"podName": "Sentry",
"version": "5.2.0"
"version": "6.4.0"
},
"disableNpm": true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
7C717EEC7024EA4A970A8C0B /* libPods-RNVApp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNVApp.a"; sourceTree = BUILT_PRODUCTS_DIR; };
9408A3872A97997800B2E736 /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppDelegate.mm; sourceTree = "<group>"; };
9408A3882A97997800B2E736 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = RNVApp/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
9408A3892A97997800B2E736 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
96722C6F859B298386E53EEC /* libPods-RNVApp-RNVAppTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNVApp-RNVAppTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
AF8EFAC6D34EF718C410C11B /* Pods_RNVAppUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RNVAppUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -137,7 +136,6 @@
200133021F6BF9CF00450340 /* Info.plist */,
200132FA1F6BF9CF00450340 /* RNVApp.xcdatamodeld */,
207BDA3F24AB543F00F32013 /* LaunchScreen.storyboard */,
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */,
);
path = RNVApp;
sourceTree = "<group>";
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions packages/sdk-android/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"typescript": "5.2.2"
},
"peerDependencies": {
"@react-native-community/cli": "^12.3.6",
"@react-native-community/cli-platform-android": "^12.3.6",
"@react-native-community/cli": "^15.0.1",
"@react-native-community/cli-platform-android": "^15.0.1",
"@rnv/core": "^1.8.0-rc.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-apple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"xcode": "3.0.1"
},
"peerDependencies": {
"@react-native-community/cli": "^12.3.6",
"@react-native-community/cli": "^15.0.1",
"@react-native-community/cli-platform-ios": "^12.3.6",
"@rnv/core": "^1.8.0-rc.0"
},
Expand Down
43 changes: 26 additions & 17 deletions packages/sdk-apple/src/privacyManifestParser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path';
import { getConfigProp, fsWriteFileSync, getAppFolder, doResolve, logError } from '@rnv/core';
import { getConfigProp, fsWriteFileSync, getAppFolder, doResolve, logError, fsExistsSync } from '@rnv/core';
import { getAppFolderName } from './common';

export const parsePrivacyManifest = () => {
Expand Down Expand Up @@ -27,7 +27,7 @@ export const parsePrivacyManifest = () => {
return `<string>${reason}</string>`;
}).join('\n')}
</array>
<dict>
</dict>
`;
})
.join('')}
Expand All @@ -39,25 +39,34 @@ export const parsePrivacyManifest = () => {
const appFolder = getAppFolder();
const appFolderName = getAppFolderName();

const filePath = path.join(appFolder, `${appFolderName}/PrivacyInfo.xcprivacy`);
fsWriteFileSync(filePath, output);
const primaryPath = path.join(appFolder, 'PrivacyInfo.xcprivacy');
const secondaryPath = path.join(appFolder, `${appFolderName}/PrivacyInfo.xcprivacy`);

const xcodePath = doResolve('xcode');
if (!xcodePath) {
logError(`Cannot resolve xcode path`);
if (fsExistsSync(primaryPath) || fsExistsSync(secondaryPath)) {
const existingFilePath = fsExistsSync(primaryPath) ? primaryPath : secondaryPath;
fsWriteFileSync(existingFilePath, output);
resolve();
return;
}
} else {
const filePath = secondaryPath;
fsWriteFileSync(filePath, output);

const xcode = require(xcodePath);
const projectPath = path.join(appFolder, `${appFolderName}.xcodeproj/project.pbxproj`);
const xcodeProj = xcode.project(projectPath);
const xcodePath = doResolve('xcode');
if (!xcodePath) {
logError(`Cannot resolve xcode path`);
resolve();
return;
}

xcodeProj.parse(() => {
xcodeProj.addResourceFile(filePath);
fsWriteFileSync(projectPath, xcodeProj.writeSync());
resolve();
});
const xcode = require(xcodePath);
const projectPath = path.join(appFolder, `${appFolderName}.xcodeproj/project.pbxproj`);
const xcodeProj = xcode.project(projectPath);

xcodeProj.parse(() => {
xcodeProj.addResourceFile(filePath);
fsWriteFileSync(projectPath, xcodeProj.writeSync());
resolve();
});
}
} else {
resolve();
}
Expand Down
Loading

0 comments on commit bb3a616

Please sign in to comment.