refactor(tv): simplify user profile management with automatic sandboxing

This commit is contained in:
Fredrik Burmester
2026-01-31 17:28:15 +01:00
parent 717186e13e
commit 44b7434cdd
8 changed files with 281 additions and 7 deletions

View File

@@ -0,0 +1,21 @@
const { withEntitlementsPlist } = require("expo/config-plugins");
/**
* Expo config plugin to add User Management entitlement for tvOS profile linking
*/
const withTVUserManagement = (config) => {
return withEntitlementsPlist(config, (config) => {
// Only add for tvOS builds (check if building for TV)
// The entitlement is needed for TVUserManager.currentUserIdentifier to work
config.modResults["com.apple.developer.user-management"] = [
"runs-as-current-user",
"get-current-user",
];
console.log("[withTVUserManagement] Added user-management entitlement");
return config;
});
};
module.exports = withTVUserManagement;