Skip to content

Commit

Permalink
fix: ios privacy manifest (#1206)
Browse files Browse the repository at this point in the history
  • Loading branch information
sakul-budhathoki authored Apr 15, 2024
1 parent 6b2c92b commit 5f51d8e
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/mobile-build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ jobs:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}

- name: Expo prebuild
run: npx expo prebuild

- name: Fix privacy
run: npx tsx ./packages/scripts/app-build/createPrivacyInfo.ts

- name: Build ios
run: eas build --local --non-interactive --platform=ios

Expand Down
8 changes: 0 additions & 8 deletions app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ const config = {
NSPhotoLibraryUsageDescription:
"Access to your photo library is required for image upload functionality.",
ITSAppUsesNonExemptEncryption: false,
NSPrivacyAccessedAPICategoryDiskSpace:
"To efficiently manage local storage and cache files for improved app performance.",
NSPrivacyAccessedAPICategoryFileTimestamp:
"To track file modification dates for app data synchronization and integrity checks.",
NSPrivacyAccessedAPICategoryUserDefaults:
"To store user preferences and settings locally for a customized user experience.",
NSPrivacyAccessedAPICategorySystemBootTime:
"To optimize app launch times and resource utilization based on system boot information.",
UIBackgroundModes: ["audio"],
},
},
Expand Down
56 changes: 56 additions & 0 deletions packages/scripts/app-build/createPrivacyInfo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import fs from "fs";

const FILE_PATH = "./ios/PrivacyInfo.xcprivacy";

const FILE_CONTENT = `
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>35F9.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>E174.1</string>
</array>
</dict>
</array>
</dict>
</plist>
`;

fs.writeFile(FILE_PATH, FILE_CONTENT, "utf8", (err) => {
if (err) {
console.error("Error writing to PrivacyInfo.xcprivacy:", err);
process.exit(1);
} else {
console.log("PrivacyInfo.xcprivacy file created successfully!");
}
});
6 changes: 5 additions & 1 deletion packages/scripts/app-build/fixGitignore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import fs from "fs";

const FILE_PATH = "./.gitignore";

const TO_REMOVE_ITEMS = ["/weshd/ios/Frameworks/", "/weshd/android/libs/"];
const TO_REMOVE_ITEMS = [
"/weshd/ios/Frameworks/",
"/weshd/android/libs/",
"/ios",
];

fs.readFile(FILE_PATH, "utf8", (err, data) => {
if (err) {
Expand Down

0 comments on commit 5f51d8e

Please sign in to comment.