diff --git a/app.plugin.js b/app.plugin.js index 5e80896..7b94a83 100644 --- a/app.plugin.js +++ b/app.plugin.js @@ -4,18 +4,38 @@ const { createRunOncePlugin } = require("expo/config-plugins"); const withCopyTargetFolder = require("./config-plugin/withCopyTargetFolder"); const withEntitlementsPlugin = require("./config-plugin/withEntitlements"); +const withExpoExperimentalAppExtension = require("./config-plugin/withExperimentalExpoAppExtensions"); +const withInfoPlistAppGroup = require("./config-plugin/withInfoPlistAppGroup"); +const { + withTargetEntitlements, +} = require("./config-plugin/withTargetEntitlements"); +const withXcodeSettings = require("./config-plugin/withXCodeSettings"); const pkg = require("./package.json"); -/** @type {import('@expo/config-plugins').ConfigPlugin<{ appleTeamId: string; match?: string; appGroup: string; copyToTargetFolder?: boolean }>} */ +/** @type {import('@expo/config-plugins').ConfigPlugin<{ appleTeamId?: string; match?: string; appGroup: string; copyToTargetFolder?: boolean }>} */ const withActivityMonitorExtensionPlugin = (config, props) => { - if (!props || !props.appGroup || typeof props.appleTeamId !== "string") { + if (!props || !props.appGroup) { throw Error( - "'appGroup' and 'appleTeamId' props are required for react-native-device-activity config plugin", + "'appGroup' is required for react-native-device-activity config plugin", ); } - return withTargetsDir( - withEntitlementsPlugin(withCopyTargetFolder(config, props), props), + return withXcodeSettings( + withTargetEntitlements( + withInfoPlistAppGroup( + withTargetsDir( + withEntitlementsPlugin( + withCopyTargetFolder( + withExpoExperimentalAppExtension(config, props), + props, + ), + props, + ), + ), + props, + ), + props, + ), props, ); }; diff --git a/config-plugin/withCopyTargetFolder.js b/config-plugin/withCopyTargetFolder.js index ef79808..fac4a99 100644 --- a/config-plugin/withCopyTargetFolder.js +++ b/config-plugin/withCopyTargetFolder.js @@ -1,4 +1,3 @@ -const { default: plist } = require("@expo/plist"); const fs = require("fs"); /** @type {import('@expo/config-plugins').ConfigPlugin<{ appGroup: string; copyToTargetFolder?: boolean }>} */ @@ -38,47 +37,6 @@ const withCopyTargetFolder = ( } } - // find all entitlements files in the projectTargetFolderPath - const entitlementsFiles = fs - .readdirSync(projectTargetFolderPath, { recursive: true }) - .filter((file) => file.endsWith(".entitlements")); - - for (const entitlementsFile of entitlementsFiles) { - const entitlementsFilePath = - projectTargetFolderPath + "/" + entitlementsFile; - - const entitlementsFileContents = fs.readFileSync( - entitlementsFilePath, - "utf8", - ); - - const parsedEntitlements = plist.parse(entitlementsFileContents); - - if (parsedEntitlements["com.apple.security.application-groups"]) { - parsedEntitlements["com.apple.security.application-groups"] = [appGroup]; - } - - const modifiedEntitlementsFileContents = plist.build(parsedEntitlements); - - fs.writeFileSync(entitlementsFilePath, modifiedEntitlementsFileContents); - } - - const swiftFiles = fs - .readdirSync(projectTargetFolderPath, { recursive: true }) - .filter((file) => file.endsWith(".swift")); - - for (const swiftFile of swiftFiles) { - const swiftFilePath = projectTargetFolderPath + "/" + swiftFile; - const swiftFileContents = fs.readFileSync(swiftFilePath, "utf8"); - - const modifiedSwiftFileContents = swiftFileContents.replace( - "group.ActivityMonitor", - appGroup, - ); - - fs.writeFileSync(swiftFilePath, modifiedSwiftFileContents); - } - return config; }; diff --git a/config-plugin/withEntitlements.js b/config-plugin/withEntitlements.js index 1f801dd..699df27 100644 --- a/config-plugin/withEntitlements.js +++ b/config-plugin/withEntitlements.js @@ -5,8 +5,10 @@ const withEntitlementsPlugin = (config, { appGroup }) => withEntitlementsPlist(config, (config) => { // todo: make this configurable - but would requiring changes in both Swift code and the /target/Info.plist to make sense config.modResults["com.apple.security.application-groups"] = [ - ...(config.modResults["com.apple.security.application-groups"] ?? []), - appGroup ?? "group.ActivityMonitor", + ...(config.modResults["com.apple.security.application-groups"]?.filter( + (group) => group !== appGroup, + ) ?? []), + appGroup, ]; config.modResults["com.apple.developer.family-controls"] = true; diff --git a/config-plugin/withExperimentalExpoAppExtensions.js b/config-plugin/withExperimentalExpoAppExtensions.js new file mode 100644 index 0000000..dca6528 --- /dev/null +++ b/config-plugin/withExperimentalExpoAppExtensions.js @@ -0,0 +1,35 @@ +const { targets } = require("./withTargetEntitlements"); + +/** @type {import('@expo/config-plugins').ConfigPlugin<{ appGroup: string; }>} */ +const withExpoExperimentalAppExtensionFlags = (config, props) => { + config.extra = { + ...config.extra, + eas: { + ...config.extra?.eas, + build: { + ...config.extra?.eas?.build, + experimental: { + ...config.extra?.eas?.build?.experimental, + ios: { + ...config.extra?.eas?.build?.experimental?.ios, + appExtensions: targets.map((targetName) => { + return { + targetName, + bundleIdentifier: + config.ios.bundleIdentifier + "." + targetName, + entitlements: { + "com.apple.developer.family-controls": true, + "com.apple.security.application-groups": [props.appGroup], + }, + }; + }), + }, + }, + }, + }, + }; + + return config; +}; + +module.exports = withExpoExperimentalAppExtensionFlags; diff --git a/config-plugin/withInfoPlistAppGroup.js b/config-plugin/withInfoPlistAppGroup.js new file mode 100644 index 0000000..21bea23 --- /dev/null +++ b/config-plugin/withInfoPlistAppGroup.js @@ -0,0 +1,12 @@ +const { withInfoPlist } = require("expo/config-plugins"); + +/** @type {import('@expo/config-plugins').ConfigPlugin<{ appGroup: string }>} */ +const withInfoPlistAppGroup = (config) => { + return withInfoPlist(config, (config) => { + config.modResults.REACT_NATIVE_DEVICE_ACTIVITY_APP_GROUP = + "$(REACT_NATIVE_DEVICE_ACTIVITY_APP_GROUP)"; + return config; + }); +}; + +module.exports = withInfoPlistAppGroup; diff --git a/config-plugin/withTargetEntitlements.js b/config-plugin/withTargetEntitlements.js new file mode 100644 index 0000000..9fcc41c --- /dev/null +++ b/config-plugin/withTargetEntitlements.js @@ -0,0 +1,49 @@ +const { default: plist } = require("@expo/plist"); +const fs = require("fs"); + +const targets = [ + "ActivityMonitorExtension", + "ShieldConfiguration", + "ShieldAction", +]; + +/** @type {import('@expo/config-plugins').ConfigPlugin<{ appGroup: string; }>} */ +const withTargetEntitlements = (config, { appGroup }) => { + const projectRoot = config._internal.projectRoot; +const path = require('path'); + +// eslint-disable-next-line no-undef +const projectTargetFolderPath = path.join(projectRoot, "targets"); + // find all entitlements files in the projectTargetFolderPath + const entitlementsFiles = fs + .readdirSync(projectTargetFolderPath, { recursive: true }) + .filter( + (file) => + targets.some((target) => file.startsWith(target)) && + file.endsWith(".entitlements"), + ); + + for (const entitlementsFile of entitlementsFiles) { + const entitlementsFilePath = + projectTargetFolderPath + "/" + entitlementsFile; + + const entitlementsFileContents = fs.readFileSync( + entitlementsFilePath, + "utf8", + ); + + const parsedEntitlements = plist.parse(entitlementsFileContents); + + if (parsedEntitlements["com.apple.security.application-groups"]) { + parsedEntitlements["com.apple.security.application-groups"] = [appGroup]; + } + + const modifiedEntitlementsFileContents = plist.build(parsedEntitlements); + + fs.writeFileSync(entitlementsFilePath, modifiedEntitlementsFileContents); + } + + return config; +}; + +module.exports = { withTargetEntitlements, targets }; diff --git a/config-plugin/withXCodeSettings.js b/config-plugin/withXCodeSettings.js new file mode 100644 index 0000000..ac3175d --- /dev/null +++ b/config-plugin/withXCodeSettings.js @@ -0,0 +1,27 @@ +const { withXcodeProject } = require("@expo/config-plugins"); + +/** @type {import('@expo/config-plugins').ConfigPlugin<{ appGroup: string }>} */ +const withXcodeSettings = (config, { appGroup }) => { + return withXcodeProject(config, (newConfig) => { + const xcodeProject = newConfig.modResults; + + const settings = { + REACT_NATIVE_DEVICE_ACTIVITY_APP_GROUP: appGroup, + }; + + const configurations = xcodeProject.pbxXCBuildConfigurationSection(); + + for (const key in configurations) { + // could be trimmed down to main target + react-native-device-activity targets, but since it's the name is so specific this should be fine + if (typeof configurations[key].buildSettings !== "undefined") { + const buildSettingsObj = configurations[key].buildSettings; + for (const key in settings) { + buildSettingsObj[key] = settings[key]; + } + } + } + return newConfig; + }); +}; + +module.exports = withXcodeSettings; diff --git a/example/app.json b/example/app.json index 4cbb2a6..483603d 100644 --- a/example/app.json +++ b/example/app.json @@ -13,6 +13,7 @@ "backgroundColor": "#ffffff" }, "ios": { + "appleTeamId": "34SE8X7Q58", "supportsTablet": true, "bundleIdentifier": "expo.modules.deviceactivity.example" }, @@ -48,7 +49,6 @@ [ "../app.plugin.js", { - "appleTeamId": "34SE8X7Q58", "appGroup": "group.ActivityMonitor", "copyToTargetFolder": false } diff --git a/example/ios/Podfile b/example/ios/Podfile index 2c8a93f..fb0a1c0 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -79,3 +79,17 @@ target 'reactnativedeviceactivityexample' do pod 'SwiftLint' end + + +# apple-targets-extension-loader -- Dynamic loading of target configurations +Dir.glob(File.join(__dir__, '..', 'targets', '**', 'pods.rb')).each do |target_file| + target_name = File.basename(File.dirname(target_file)) + target target_name do + # Create a new binding with access to necessary methods and variables + target_binding = binding + target_binding.local_variable_set(:podfile_properties, podfile_properties) + + # Evaluate the target file content in the new binding + eval(File.read(target_file), target_binding, target_file) + end +end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index f98c920..82648f6 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1513,6 +1513,6 @@ SPEC CHECKSUMS: SwiftLint: 92196976e597b9afec5dbe374810103e6c1d9d7c Yoga: 950bbfd7e6f04790fdb51149ed51df41f329fcc8 -PODFILE CHECKSUM: 5ae09240dec8db7b55ecff135c6659568a0c6d16 +PODFILE CHECKSUM: b8b40c46183fad3b03c145dfc75dd8fc64203c70 COCOAPODS: 1.16.2 diff --git a/example/ios/reactnativedeviceactivityexample.xcodeproj/project.pbxproj b/example/ios/reactnativedeviceactivityexample.xcodeproj/project.pbxproj index 2527f49..dd6a64b 100644 --- a/example/ios/reactnativedeviceactivityexample.xcodeproj/project.pbxproj +++ b/example/ios/reactnativedeviceactivityexample.xcodeproj/project.pbxproj @@ -31,6 +31,8 @@ D4B3EB83B4EF427D8D8F7E6C /* ManagedSettingsUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1413C6DF9E3E4F8795DD1144 /* ManagedSettingsUI.framework */; }; DA41F741593849B68655A75F /* noop-file.swift in Sources */ = {isa = PBXBuildFile; fileRef = C10474BDB8DC49849F0DAB7D /* noop-file.swift */; }; FC38F5A2C4C54BAFA2ADD8F5 /* ShieldConfiguration.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = EEEB0A38EA724033BF060181 /* ShieldConfiguration.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + XX44FC18D28196FBCB6075XX /* ManagedSettingsUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = XXB6D82409997898620841XX /* ManagedSettingsUI.framework */; }; + XXD33E402502F114432AD3XX /* DeviceActivity.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = XXCA68A9416C78B970D1D9XX /* DeviceActivity.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -97,13 +99,13 @@ 6C2E3173556A471DD304B334 /* Pods-reactnativedeviceactivityexample.debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-reactnativedeviceactivityexample.debug.xcconfig"; path = "Target Support Files/Pods-reactnativedeviceactivityexample/Pods-reactnativedeviceactivityexample.debug.xcconfig"; sourceTree = ""; }; 7A4D352CD337FB3A3BF06240 /* Pods-reactnativedeviceactivityexample.release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-reactnativedeviceactivityexample.release.xcconfig"; path = "Target Support Files/Pods-reactnativedeviceactivityexample/Pods-reactnativedeviceactivityexample.release.xcconfig"; sourceTree = ""; }; 84457EAD9B9F41CDA5B58B4E /* ActivityMonitorExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; fileEncoding = 4; includeInIndex = 0; path = ActivityMonitorExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; - 86C617632690A9F3C5D768FE /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = ../targets/ShieldConfiguration/PrivacyInfo.xcprivacy; sourceTree = ""; }; + 86C617632690A9F3C5D768FE /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = ../targets/ShieldConfiguration/PrivacyInfo.xcprivacy; sourceTree = ""; }; 98E197012252434F88CCEEB4 /* ActivityMonitorExtension.entitlements */ = {isa = PBXFileReference; explicitFileType = text.plist.entitlements; fileEncoding = 4; includeInIndex = 0; path = ActivityMonitorExtension.entitlements; sourceTree = ""; }; - A9A030712CFF142000D9E7E8 /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - A9B2DBE72CECAE610001BBAF /* Shared.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = Shared.swift; path = ../../ios/Shared.swift; sourceTree = ""; }; - A9B2DBFF2CECB91A0001BBAF /* DeviceActivityMonitorExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = DeviceActivityMonitorExtension.swift; path = ../../targets/ActivityMonitorExtension/DeviceActivityMonitorExtension.swift; sourceTree = ""; }; - A9B2DC012CECB9430001BBAF /* ShieldConfigurationExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ShieldConfigurationExtension.swift; path = ../../targets/ShieldConfiguration/ShieldConfigurationExtension.swift; sourceTree = ""; }; - A9B2DC032CECB9600001BBAF /* ShieldActionExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ShieldActionExtension.swift; path = ../../targets/ShieldAction/ShieldActionExtension.swift; sourceTree = ""; }; + A9A030712CFF142000D9E7E8 /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; fileEncoding = 4; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + A9B2DBE72CECAE610001BBAF /* Shared.swift */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = Shared.swift; path = ../../ios/Shared.swift; sourceTree = ""; }; + A9B2DBFF2CECB91A0001BBAF /* DeviceActivityMonitorExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = DeviceActivityMonitorExtension.swift; path = ../../targets/ActivityMonitorExtension/DeviceActivityMonitorExtension.swift; sourceTree = ""; }; + A9B2DC012CECB9430001BBAF /* ShieldConfigurationExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = ShieldConfigurationExtension.swift; path = ../../targets/ShieldConfiguration/ShieldConfigurationExtension.swift; sourceTree = ""; }; + A9B2DC032CECB9600001BBAF /* ShieldActionExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = ShieldActionExtension.swift; path = ../../targets/ShieldAction/ShieldActionExtension.swift; sourceTree = ""; }; AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = file.storyboard; name = SplashScreen.storyboard; path = reactnativedeviceactivityexample/SplashScreen.storyboard; sourceTree = ""; }; AEB321985C804DE4AB33EC69 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; BA3FB2A82413462F881AEB5A /* reactnativedeviceactivityexample-Bridging-Header.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "reactnativedeviceactivityexample-Bridging-Header.h"; path = "reactnativedeviceactivityexample/reactnativedeviceactivityexample-Bridging-Header.h"; sourceTree = ""; }; @@ -113,6 +115,8 @@ ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 1; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; EEEB0A38EA724033BF060181 /* ShieldConfiguration.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; fileEncoding = 4; includeInIndex = 0; path = ShieldConfiguration.appex; sourceTree = BUILT_PRODUCTS_DIR; }; FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-reactnativedeviceactivityexample/ExpoModulesProvider.swift"; sourceTree = ""; }; + XXB6D82409997898620841XX /* ManagedSettingsUI.framework */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 1; lastKnownFileType = wrapper.framework; name = ManagedSettingsUI.framework; path = System/Library/Frameworks/ManagedSettingsUI.framework; sourceTree = SDKROOT; }; + XXCA68A9416C78B970D1D9XX /* DeviceActivity.framework */ = {isa = PBXFileReference; fileEncoding = 4; includeInIndex = 1; lastKnownFileType = wrapper.framework; name = DeviceActivity.framework; path = System/Library/Frameworks/DeviceActivity.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ /* Begin PBXFileSystemSynchronizedRootGroup section */ @@ -123,6 +127,27 @@ path = Tests; sourceTree = ""; }; + XX39D67B16C97D546C2A68XX /* ShieldAction */ = { + isa = PBXFileSystemSynchronizedRootGroup; + exceptions = ( + ); + path = ShieldAction; + sourceTree = ""; + }; + XXBEF4732D652A763B01C2XX /* ShieldConfiguration */ = { + isa = PBXFileSystemSynchronizedRootGroup; + exceptions = ( + ); + path = ShieldConfiguration; + sourceTree = ""; + }; + XXC76190DB8B2D90600E9FXX /* ActivityMonitorExtension */ = { + isa = PBXFileSystemSynchronizedRootGroup; + exceptions = ( + ); + path = ActivityMonitorExtension; + sourceTree = ""; + }; /* End PBXFileSystemSynchronizedRootGroup section */ /* Begin PBXFrameworksBuildPhase section */ @@ -139,6 +164,7 @@ buildActionMask = 2147483647; files = ( D4B3EB83B4EF427D8D8F7E6C /* ManagedSettingsUI.framework in Frameworks */, + XX44FC18D28196FBCB6075XX /* ManagedSettingsUI.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -161,6 +187,7 @@ buildActionMask = 2147483647; files = ( 35FEA156B28F4E06B56A39C6 /* DeviceActivity.framework in Frameworks */, + XXD33E402502F114432AD3XX /* DeviceActivity.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -202,6 +229,8 @@ 58EEBF8E8E6FB1BC6CAF49B5 /* libPods-reactnativedeviceactivityexample.a */, 1413C6DF9E3E4F8795DD1144 /* ManagedSettingsUI.framework */, E01EDC40AAA54847A43C3F99 /* DeviceActivity.framework */, + XXCA68A9416C78B970D1D9XX /* DeviceActivity.framework */, + XXB6D82409997898620841XX /* ManagedSettingsUI.framework */, ); name = Frameworks; sourceTree = ""; @@ -225,6 +254,7 @@ 2D16E6871FA4F8E400B85C8A /* Frameworks */, D65327D7A22EEC0BE12398D9 /* Pods */, D7E4C46ADA2E9064B798F356 /* ExpoModulesProviders */, + AECFFDE3ED4343DCA9CC2989 /* Resources */, ); indentWidth = 2; sourceTree = ""; @@ -262,6 +292,13 @@ path = ../targets/ActivityMonitorExtension; sourceTree = ""; }; + AECFFDE3ED4343DCA9CC2989 /* Resources */ = { + isa = PBXGroup; + children = ( + ); + name = Resources; + sourceTree = ""; + }; BB2F792B24A3F905000567C9 /* Supporting */ = { isa = PBXGroup; children = ( @@ -277,6 +314,9 @@ D0AD29FCE88C41BC90BA7D10 /* ShieldConfiguration */, 2CA754293FC5430EBFCBDD04 /* ShieldAction */, AE110DB5899B4D8887B5B8C9 /* ActivityMonitorExtension */, + XXC76190DB8B2D90600E9FXX /* ActivityMonitorExtension */, + XX39D67B16C97D546C2A68XX /* ShieldAction */, + XXBEF4732D652A763B01C2XX /* ShieldConfiguration */, ); name = "expo:targets"; sourceTree = ""; @@ -314,7 +354,7 @@ /* Begin PBXNativeTarget section */ 09AF28B634D54463AF9E2548 /* ShieldAction */ = { isa = PBXNativeTarget; - buildConfigurationList = 74721A2818F9411CB18C23FF /* Build configuration list for PBXNativeTarget "ShieldAction" */; + buildConfigurationList = XXE0C7376B08BE7CD8053CXX /* Build configuration list for PBXNativeTarget "ShieldAction" */; buildPhases = ( C5969BCCB0EE45DCB9BBF01A /* Sources */, 462DEE8A51194DC08531C38A /* Frameworks */, @@ -324,6 +364,9 @@ ); dependencies = ( ); + fileSystemSynchronizedGroups = ( + XX39D67B16C97D546C2A68XX /* ShieldAction */, + ); name = ShieldAction; productName = ShieldAction; productReference = 55BEF032CC20441DA94ED74D /* ShieldAction.appex */; @@ -358,7 +401,7 @@ }; 1B33B275DB45484EAECB1B1B /* ShieldConfiguration */ = { isa = PBXNativeTarget; - buildConfigurationList = 8A17866BF9A04A8CA2A49157 /* Build configuration list for PBXNativeTarget "ShieldConfiguration" */; + buildConfigurationList = XXA80D9B0E76C23E6EB489XX /* Build configuration list for PBXNativeTarget "ShieldConfiguration" */; buildPhases = ( E87B628F0597447DB98AACE3 /* Sources */, A9BF3BE22D0521A900611B0F /* SwiftLint */, @@ -369,6 +412,9 @@ ); dependencies = ( ); + fileSystemSynchronizedGroups = ( + XXBEF4732D652A763B01C2XX /* ShieldConfiguration */, + ); name = ShieldConfiguration; productName = ShieldConfiguration; productReference = EEEB0A38EA724033BF060181 /* ShieldConfiguration.appex */; @@ -397,7 +443,7 @@ }; B020639A1E02498DA97B7121 /* ActivityMonitorExtension */ = { isa = PBXNativeTarget; - buildConfigurationList = 70B6388B62644A0AB504262B /* Build configuration list for PBXNativeTarget "ActivityMonitorExtension" */; + buildConfigurationList = XX2FE62DA24018D18B6DFDXX /* Build configuration list for PBXNativeTarget "ActivityMonitorExtension" */; buildPhases = ( 19D75FAED6304B899C951F97 /* Sources */, E03DF3C7E0EB4FE6ADEC4D42 /* Frameworks */, @@ -407,6 +453,9 @@ ); dependencies = ( ); + fileSystemSynchronizedGroups = ( + XXC76190DB8B2D90600E9FXX /* ActivityMonitorExtension */, + ); name = ActivityMonitorExtension; productName = ActivityMonitorExtension; productReference = 84457EAD9B9F41CDA5B58B4E /* ActivityMonitorExtension.appex */; @@ -722,6 +771,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 6C2E3173556A471DD304B334 /* Pods-reactnativedeviceactivityexample.debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = reactnativedeviceactivityexample/reactnativedeviceactivityexample.entitlements; @@ -733,12 +783,13 @@ "FB_SONARKIT_ENABLED=1", ); INFOPLIST_FILE = reactnativedeviceactivityexample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 16.6; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.0.0; + NEW_SETTING = ""; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -747,6 +798,7 @@ OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; PRODUCT_BUNDLE_IDENTIFIER = expo.modules.deviceactivity.example; PRODUCT_NAME = reactnativedeviceactivityexample; + REACT_NATIVE_DEVICE_ACTIVITY_APP_GROUP = group.ActivityMonitor; SWIFT_OBJC_BRIDGING_HEADER = "reactnativedeviceactivityexample/reactnativedeviceactivityexample-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -759,18 +811,20 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7A4D352CD337FB3A3BF06240 /* Pods-reactnativedeviceactivityexample.release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = reactnativedeviceactivityexample/reactnativedeviceactivityexample.entitlements; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 34SE8X7Q58; INFOPLIST_FILE = reactnativedeviceactivityexample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 16.6; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.0.0; + NEW_SETTING = ""; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -779,6 +833,7 @@ OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; PRODUCT_BUNDLE_IDENTIFIER = expo.modules.deviceactivity.example; PRODUCT_NAME = reactnativedeviceactivityexample; + REACT_NATIVE_DEVICE_ACTIVITY_APP_GROUP = group.ActivityMonitor; SWIFT_OBJC_BRIDGING_HEADER = "reactnativedeviceactivityexample/reactnativedeviceactivityexample-Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -786,131 +841,6 @@ }; name = Release; }; - 19B3FBE53C124BD196F71B6D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_ENTITLEMENTS = ../targets/ShieldConfiguration/ShieldConfiguration.entitlements; - CODE_SIGN_STYLE = Automatic; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = 34SE8X7Q58; - GCC_C_LANGUAGE_STANDARD = gnu11; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = ../targets/ShieldConfiguration/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = ShieldConfiguration; - INFOPLIST_KEY_NSHumanReadableCopyright = ""; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@executable_path/../../Frameworks", - ); - MARKETING_VERSION = 1.0; - MTL_FAST_MATH = YES; - OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; - PRODUCT_BUNDLE_IDENTIFIER = expo.modules.deviceactivity.example.ShieldConfiguration; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - 1ABF51986B1849E19B6404DA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_ENTITLEMENTS = ../targets/ActivityMonitorExtension/ActivityMonitorExtension.entitlements; - CODE_SIGN_STYLE = Automatic; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = 34SE8X7Q58; - GCC_C_LANGUAGE_STANDARD = gnu11; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = ../targets/ActivityMonitorExtension/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = ActivityMonitorExtension; - INFOPLIST_KEY_NSHumanReadableCopyright = ""; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@executable_path/../../Frameworks", - ); - MARKETING_VERSION = 1.0; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; - PRODUCT_BUNDLE_IDENTIFIER = expo.modules.deviceactivity.example.ActivityMonitorExtension; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 7DA11E8D43D3400C81003C92 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_ENTITLEMENTS = ../targets/ShieldAction/ShieldAction.entitlements; - CODE_SIGN_STYLE = Automatic; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = 34SE8X7Q58; - GCC_C_LANGUAGE_STANDARD = gnu11; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = ../targets/ShieldAction/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = ShieldAction; - INFOPLIST_KEY_NSHumanReadableCopyright = ""; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@executable_path/../../Frameworks", - ); - MARKETING_VERSION = 1.0; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; - PRODUCT_BUNDLE_IDENTIFIER = expo.modules.deviceactivity.example.ShieldAction; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; 83CBBA201A601CBA00E9B192 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1044,9 +974,47 @@ }; name = Release; }; - 8425521B09634B978191E365 /* Release */ = { + A9A030772CFF142000D9E7E8 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = 34SE8X7Q58; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.6; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; + PRODUCT_BUNDLE_IDENTIFIER = com.kingstinct.reactnativedeviceactivityexampleTests.Tests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/reactnativedeviceactivityexample.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/reactnativedeviceactivityexample"; + }; + name = Debug; + }; + A9A030782CFF142000D9E7E8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; @@ -1054,7 +1022,40 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_ENTITLEMENTS = ../targets/ActivityMonitorExtension/ActivityMonitorExtension.entitlements; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 34SE8X7Q58; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.6; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0.0; + MTL_FAST_MATH = YES; + OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; + PRODUCT_BUNDLE_IDENTIFIER = com.kingstinct.reactnativedeviceactivityexampleTests.Tests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/reactnativedeviceactivityexample.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/reactnativedeviceactivityexample"; + }; + name = Release; + }; + XX2B9E060A37CDC639FD37XX /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = ../targets/ShieldAction/ShieldAction.entitlements; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; @@ -1062,20 +1063,22 @@ DEVELOPMENT_TEAM = 34SE8X7Q58; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = ../targets/ActivityMonitorExtension/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = ActivityMonitorExtension; + INFOPLIST_FILE = ../targets/ShieldAction/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = ShieldAction; INFOPLIST_KEY_NSHumanReadableCopyright = ""; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.0.0; MTL_FAST_MATH = YES; + NEW_SETTING = ""; OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; - PRODUCT_BUNDLE_IDENTIFIER = expo.modules.deviceactivity.example.ActivityMonitorExtension; + PRODUCT_BUNDLE_IDENTIFIER = expo.modules.deviceactivity.example.ShieldAction; PRODUCT_NAME = "$(TARGET_NAME)"; + REACT_NATIVE_DEVICE_ACTIVITY_APP_GROUP = group.ActivityMonitor; SKIP_INSTALL = YES; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_EMIT_LOC_STRINGS = YES; @@ -1085,7 +1088,7 @@ }; name = Release; }; - 984FD302E06E4F8585276CF2 /* Debug */ = { + XX724BBE6F77538C7FD8E0XX /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_NONNULL = YES; @@ -1095,7 +1098,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_ENTITLEMENTS = ../targets/ShieldConfiguration/ShieldConfiguration.entitlements; + CODE_SIGN_ENTITLEMENTS = ../targets/ActivityMonitorExtension/ActivityMonitorExtension.entitlements; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; @@ -1103,23 +1106,25 @@ DEVELOPMENT_TEAM = 34SE8X7Q58; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = ../targets/ShieldConfiguration/Info.plist; - INFOPLIST_KEY_CFBundleDisplayName = ShieldConfiguration; + INFOPLIST_FILE = ../targets/ActivityMonitorExtension/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = ActivityMonitorExtension; INFOPLIST_KEY_NSHumanReadableCopyright = ""; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.0.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; - PRODUCT_BUNDLE_IDENTIFIER = expo.modules.deviceactivity.example.ShieldConfiguration; + PRODUCT_BUNDLE_IDENTIFIER = expo.modules.deviceactivity.example.ActivityMonitorExtension; PRODUCT_NAME = "$(TARGET_NAME)"; + REACT_NATIVE_DEVICE_ACTIVITY_APP_GROUP = group.ActivityMonitor; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_COMPILATION_MODE = wholemodule; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -1127,11 +1132,51 @@ }; name = Debug; }; - A9A030772CFF142000D9E7E8 /* Debug */ = { + XX79801B28DADF2990F191XX /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = ../targets/ShieldConfiguration/ShieldConfiguration.entitlements; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 34SE8X7Q58; + GCC_C_LANGUAGE_STANDARD = gnu11; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = ../targets/ShieldConfiguration/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = ShieldConfiguration; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0.0; + MTL_FAST_MATH = YES; + OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; + PRODUCT_BUNDLE_IDENTIFIER = expo.modules.deviceactivity.example.ShieldConfiguration; + PRODUCT_NAME = "$(TARGET_NAME)"; + REACT_NATIVE_DEVICE_ACTIVITY_APP_GROUP = group.ActivityMonitor; + SKIP_INSTALL = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + XX9C93C1671DAD0750CE19XX /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; @@ -1139,35 +1184,43 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = ../targets/ShieldConfiguration/ShieldConfiguration.entitlements; CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = 34SE8X7Q58; - ENABLE_USER_SCRIPT_SANDBOXING = YES; - GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 17.6; - LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 1.0; + INFOPLIST_FILE = ../targets/ShieldConfiguration/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = ShieldConfiguration; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; - PRODUCT_BUNDLE_IDENTIFIER = com.kingstinct.reactnativedeviceactivityexampleTests.Tests; + PRODUCT_BUNDLE_IDENTIFIER = expo.modules.deviceactivity.example.ShieldConfiguration; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; - SWIFT_EMIT_LOC_STRINGS = NO; + REACT_NATIVE_DEVICE_ACTIVITY_APP_GROUP = group.ActivityMonitor; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/reactnativedeviceactivityexample.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/reactnativedeviceactivityexample"; }; name = Debug; }; - A9A030782CFF142000D9E7E8 /* Release */ = { + XXAE7A89F4FD7D2298297CXX /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; @@ -1175,30 +1228,39 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = ../targets/ActivityMonitorExtension/ActivityMonitorExtension.entitlements; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 34SE8X7Q58; - ENABLE_USER_SCRIPT_SANDBOXING = YES; - GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 17.6; - LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 1.0; + INFOPLIST_FILE = ../targets/ActivityMonitorExtension/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = ActivityMonitorExtension; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + MARKETING_VERSION = 1.0.0; MTL_FAST_MATH = YES; OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; - PRODUCT_BUNDLE_IDENTIFIER = com.kingstinct.reactnativedeviceactivityexampleTests.Tests; + PRODUCT_BUNDLE_IDENTIFIER = expo.modules.deviceactivity.example.ActivityMonitorExtension; PRODUCT_NAME = "$(TARGET_NAME)"; + REACT_NATIVE_DEVICE_ACTIVITY_APP_GROUP = group.ActivityMonitor; + SKIP_INSTALL = YES; SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/reactnativedeviceactivityexample.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/reactnativedeviceactivityexample"; }; name = Release; }; - AE37E16FFF5F42278976AF2A /* Release */ = { + XXD1169F79EA1BE6030601XX /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_NONNULL = YES; @@ -1212,32 +1274,36 @@ CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = 34SE8X7Q58; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = ../targets/ShieldAction/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = ShieldAction; INFOPLIST_KEY_NSHumanReadableCopyright = ""; - IPHONEOS_DEPLOYMENT_TARGET = 16.4; + IPHONEOS_DEPLOYMENT_TARGET = 18.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.0.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; - OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; + NEW_SETTING = ""; + OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; PRODUCT_BUNDLE_IDENTIFIER = expo.modules.deviceactivity.example.ShieldAction; PRODUCT_NAME = "$(TARGET_NAME)"; + REACT_NATIVE_DEVICE_ACTIVITY_APP_GROUP = group.ActivityMonitor; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; - name = Release; + name = Debug; }; /* End XCBuildConfiguration section */ @@ -1251,47 +1317,47 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 70B6388B62644A0AB504262B /* Build configuration list for PBXNativeTarget "ActivityMonitorExtension" */ = { + 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "reactnativedeviceactivityexample" */ = { isa = XCConfigurationList; buildConfigurations = ( - 1ABF51986B1849E19B6404DA /* Debug */, - 8425521B09634B978191E365 /* Release */, + 83CBBA201A601CBA00E9B192 /* Debug */, + 83CBBA211A601CBA00E9B192 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 74721A2818F9411CB18C23FF /* Build configuration list for PBXNativeTarget "ShieldAction" */ = { + A9A030792CFF142000D9E7E8 /* Build configuration list for PBXNativeTarget "Tests" */ = { isa = XCConfigurationList; buildConfigurations = ( - 7DA11E8D43D3400C81003C92 /* Debug */, - AE37E16FFF5F42278976AF2A /* Release */, + A9A030772CFF142000D9E7E8 /* Debug */, + A9A030782CFF142000D9E7E8 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "reactnativedeviceactivityexample" */ = { + XX2FE62DA24018D18B6DFDXX /* Build configuration list for PBXNativeTarget "ActivityMonitorExtension" */ = { isa = XCConfigurationList; buildConfigurations = ( - 83CBBA201A601CBA00E9B192 /* Debug */, - 83CBBA211A601CBA00E9B192 /* Release */, + XX724BBE6F77538C7FD8E0XX /* Debug */, + XXAE7A89F4FD7D2298297CXX /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 8A17866BF9A04A8CA2A49157 /* Build configuration list for PBXNativeTarget "ShieldConfiguration" */ = { + XXA80D9B0E76C23E6EB489XX /* Build configuration list for PBXNativeTarget "ShieldConfiguration" */ = { isa = XCConfigurationList; buildConfigurations = ( - 984FD302E06E4F8585276CF2 /* Debug */, - 19B3FBE53C124BD196F71B6D /* Release */, + XX9C93C1671DAD0750CE19XX /* Debug */, + XX79801B28DADF2990F191XX /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - A9A030792CFF142000D9E7E8 /* Build configuration list for PBXNativeTarget "Tests" */ = { + XXE0C7376B08BE7CD8053CXX /* Build configuration list for PBXNativeTarget "ShieldAction" */ = { isa = XCConfigurationList; buildConfigurations = ( - A9A030772CFF142000D9E7E8 /* Debug */, - A9A030782CFF142000D9E7E8 /* Release */, + XXD1169F79EA1BE6030601XX /* Debug */, + XX2B9E060A37CDC639FD37XX /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/example/ios/reactnativedeviceactivityexample/Info.plist b/example/ios/reactnativedeviceactivityexample/Info.plist index ba95f54..60f4305 100644 --- a/example/ios/reactnativedeviceactivityexample/Info.plist +++ b/example/ios/reactnativedeviceactivityexample/Info.plist @@ -43,6 +43,8 @@ NSAllowsLocalNetworking + REACT_NATIVE_DEVICE_ACTIVITY_APP_GROUP + $(REACT_NATIVE_DEVICE_ACTIVITY_APP_GROUP) UILaunchStoryboardName SplashScreen UIRequiredDeviceCapabilities diff --git a/example/ios/reactnativedeviceactivityexample/reactnativedeviceactivityexample.entitlements b/example/ios/reactnativedeviceactivityexample/reactnativedeviceactivityexample.entitlements index 276c2b4..33014f9 100644 --- a/example/ios/reactnativedeviceactivityexample/reactnativedeviceactivityexample.entitlements +++ b/example/ios/reactnativedeviceactivityexample/reactnativedeviceactivityexample.entitlements @@ -2,6 +2,8 @@ + aps-environment + development com.apple.developer.family-controls com.apple.security.application-groups diff --git a/example/package-lock.json b/example/package-lock.json index 980d10e..c415619 100644 --- a/example/package-lock.json +++ b/example/package-lock.json @@ -10,7 +10,6 @@ "dependencies": { "expo": "~51.0.39", "expo-asset": "~10.0.10", - "expo-constants": "^16.0.2", "expo-file-system": "17", "expo-notifications": "~0.28.19", "react": "18.2.0", diff --git a/example/package.json b/example/package.json index 0f20eab..baeb669 100644 --- a/example/package.json +++ b/example/package.json @@ -12,7 +12,6 @@ "dependencies": { "expo": "~51.0.39", "expo-asset": "~10.0.10", - "expo-constants": "^16.0.2", "expo-file-system": "17", "expo-notifications": "~0.28.19", "react": "18.2.0", diff --git a/example/screens/ShieldTab.tsx b/example/screens/ShieldTab.tsx index 3660e44..b41e28d 100644 --- a/example/screens/ShieldTab.tsx +++ b/example/screens/ShieldTab.tsx @@ -71,7 +71,11 @@ export function ShieldTab() { { title: shieldTitle, backgroundBlurStyle: UIBlurEffectStyle.systemMaterialDark, - // backgroundColor: null, + backgroundColor: { + red: 255, + green: 0, + blue: 0, + }, titleColor: { red: 255, green: 0, diff --git a/example/screens/SimpleTab.tsx b/example/screens/SimpleTab.tsx index 1a4e394..278a68f 100644 --- a/example/screens/SimpleTab.tsx +++ b/example/screens/SimpleTab.tsx @@ -17,6 +17,7 @@ import { useActivities, useAuthorizationStatus, AuthorizationStatusType, + requestAuthorization, } from "react-native-device-activity"; import { Button, Modal, Text, Title } from "react-native-paper"; @@ -33,7 +34,7 @@ export function SimpleTab() { const [activities, refreshActivities] = useActivities(); - const requestAuthorization = useCallback(async () => { + const onPressRequestCallback = useCallback(async () => { if (authorizationStatus === AuthorizationStatus.notDetermined) { await requestAuthorization(); } else if (authorizationStatus === AuthorizationStatus.denied) { @@ -102,7 +103,7 @@ export function SimpleTab() { {authorizationStatusMap[authorizationStatus]} -