diff --git a/.gitignore b/.gitignore index 5f98a77a..0559f6db 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,4 @@ faceclaw_settings.xml # Developer configs build_paths.sh - +**/xcuserdata/ diff --git a/App_Resources/iOS/Info.plist b/App_Resources/iOS/Info.plist new file mode 100644 index 00000000..98cc8471 --- /dev/null +++ b/App_Resources/iOS/Info.plist @@ -0,0 +1,30 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleDisplayName + Faceclaw + CFBundleShortVersionString + 1.0.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchScreen + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UIRequiresFullScreen + + + diff --git a/App_Resources/iOS/build.xcconfig b/App_Resources/iOS/build.xcconfig new file mode 100644 index 00000000..e11b5908 --- /dev/null +++ b/App_Resources/iOS/build.xcconfig @@ -0,0 +1,5 @@ +IPHONEOS_DEPLOYMENT_TARGET = 15.1; +TARGETED_DEVICE_FAMILY = 1; +CODE_SIGN_STYLE = Automatic; + +// Select the local signing team in Xcode or pass --teamId to the iOS scripts. diff --git a/README.md b/README.md index bbc693aa..be3f29bd 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,9 @@ walk you through pairing with the glasses and installing custom firmware. ## Compiling +For the initial NativeScript iOS port, see [iOS development](notes/ios-development.md). +The instructions below build the Android app. + If you want to customize faceclaw, the best way to do it is to download the source code and using a coding agent such as Codex or Claude Code. @@ -186,4 +189,3 @@ mention them and link to that provider's privacy policy. For services that involve a user-provided API key, we assume that the user agreed to any terms associated with that service when they generated the key. For services that don't involve API keys, more caution may be required. - diff --git a/app/app.ios.css b/app/app.ios.css new file mode 100644 index 00000000..71b27f3c --- /dev/null +++ b/app/app.ios.css @@ -0,0 +1,12 @@ +Page { + background-color: #f5f5f2; + color: #202820; +} + +Button { + background-color: #285c45; + color: #ffffff; + border-radius: 12; + padding: 16; + font-size: 17; +} diff --git a/app/app.ts b/app/app.ts index b1f9e59b..ea0c6024 100644 --- a/app/app.ts +++ b/app/app.ts @@ -4,13 +4,7 @@ You can use this file to perform app-level initialization, but the primary purpose of the file is to pass control to the app’s first module. */ -import { Application } from '@nativescript/core' -import { registerShareIntentHandler } from './native/share-intents' -import { installNativeUserAgent } from './util/http' - -installNativeUserAgent() -registerShareIntentHandler() - -Application.run({ moduleName: 'app-root' }) +// NativeScript resolves the matching .android.ts or .ios.ts implementation. +import './bootstrap' // Don't place any code after the application has been started diff --git a/app/bootstrap.android.ts b/app/bootstrap.android.ts new file mode 100644 index 00000000..c160dda1 --- /dev/null +++ b/app/bootstrap.android.ts @@ -0,0 +1,8 @@ +import { Application } from '@nativescript/core' +import { registerShareIntentHandler } from './native/share-intents' +import { installNativeUserAgent } from './util/http' + +installNativeUserAgent() +registerShareIntentHandler() + +Application.run({ moduleName: 'app-root' }) diff --git a/app/bootstrap.ios.ts b/app/bootstrap.ios.ts new file mode 100644 index 00000000..c2a43d2c --- /dev/null +++ b/app/bootstrap.ios.ts @@ -0,0 +1,47 @@ +import { Application, Button, Device, Label, Page, ScrollView, StackLayout } from '@nativescript/core' +import { bytesToHex, hexToBytes } from './util/hex-util' + +// Milestone 1: exercise native UI, TypeScript, and an existing shared utility +// without loading the Android services used by the full glasses application. +Application.run({ + create: () => { + const page = new Page() + page.actionBarHidden = true + const scroll = new ScrollView() + const content = new StackLayout() + content.padding = 28 + content.verticalAlignment = 'middle' + + const label = (text: string, fontSize = 17) => { + const view = new Label() + view.text = text + view.fontSize = fontSize + view.textWrap = true + view.marginBottom = 20 + content.addChild(view) + return view + } + + label('Faceclaw', 36) + label('iOS port · First launch', 24) + label(`NativeScript is running on ${Device.model} (iOS ${Device.osVersion}).`) + label('Glasses pairing and the Android features are still to be ported.') + const status = label('Tap below to test native input and shared TypeScript code.') + const button = new Button() + button.text = 'Run shared-code check' + button.accessibilityIdentifier = 'shared-code-check' + let checks = 0 + button.on('tap', () => { + const result = bytesToHex(hexToBytes('46 61 63 65 63 6c 61 77')) + const passed = result === '46616365636C6177' + checks += 1 + status.text = `${passed ? 'Passed' : 'Failed'} · Check ${checks}\nShared hex utilities returned ${result}.` + console.log(`[ios-bootstrap] Shared-code check ${checks}: ${passed ? 'PASS' : 'FAIL'} (${result})`) + }) + content.addChild(button) + scroll.content = content + page.content = scroll + page.on('loaded', () => console.log('[ios-bootstrap] Faceclaw launch screen loaded')) + return page + }, +}) diff --git a/iOS/Faceclaw.xcodeproj/project.pbxproj b/iOS/Faceclaw.xcodeproj/project.pbxproj new file mode 100644 index 00000000..03d18354 --- /dev/null +++ b/iOS/Faceclaw.xcodeproj/project.pbxproj @@ -0,0 +1,350 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* Begin PBXFileReference section */ + 45A0A8CB304D0DD5008BD93B /* Faceclaw.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Faceclaw.app; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + 45A0A8CD304D0DD5008BD93B /* Faceclaw */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = Faceclaw; + sourceTree = ""; + }; +/* End PBXFileSystemSynchronizedRootGroup section */ + +/* Begin PBXFrameworksBuildPhase section */ + 45A0A8C8304D0DD5008BD93B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 45A0A8C2304D0DD5008BD93B = { + isa = PBXGroup; + children = ( + 45A0A8CD304D0DD5008BD93B /* Faceclaw */, + 45A0A8CC304D0DD5008BD93B /* Products */, + ); + sourceTree = ""; + }; + 45A0A8CC304D0DD5008BD93B /* Products */ = { + isa = PBXGroup; + children = ( + 45A0A8CB304D0DD5008BD93B /* Faceclaw.app */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 45A0A8CA304D0DD5008BD93B /* Faceclaw */ = { + isa = PBXNativeTarget; + buildConfigurationList = 45A0A8D6304D0DD6008BD93B /* Build configuration list for PBXNativeTarget "Faceclaw" */; + buildPhases = ( + 45A0A8C7304D0DD5008BD93B /* Sources */, + 45A0A8C8304D0DD5008BD93B /* Frameworks */, + 45A0A8C9304D0DD5008BD93B /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + 45A0A8CD304D0DD5008BD93B /* Faceclaw */, + ); + name = Faceclaw; + packageProductDependencies = ( + ); + productName = Faceclaw; + productReference = 45A0A8CB304D0DD5008BD93B /* Faceclaw.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 45A0A8C3304D0DD5008BD93B /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 2640; + LastUpgradeCheck = 2640; + TargetAttributes = { + 45A0A8CA304D0DD5008BD93B = { + CreatedOnToolsVersion = 26.4.1; + }; + }; + }; + buildConfigurationList = 45A0A8C6304D0DD5008BD93B /* Build configuration list for PBXProject "Faceclaw" */; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 45A0A8C2304D0DD5008BD93B; + minimizedProjectReferenceProxies = 1; + preferredProjectObjectVersion = 77; + productRefGroup = 45A0A8CC304D0DD5008BD93B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 45A0A8CA304D0DD5008BD93B /* Faceclaw */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 45A0A8C9304D0DD5008BD93B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 45A0A8C7304D0DD5008BD93B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 45A0A8D4304D0DD6008BD93B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 45A0A8D5304D0DD6008BD93B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SWIFT_COMPILATION_MODE = wholemodule; + }; + name = Release; + }; + 45A0A8D7304D0DD6008BD93B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + ENABLE_APP_SANDBOX = YES; + ENABLE_PREVIEWS = YES; + ENABLE_USER_SELECTED_FILES = readonly; + GENERATE_INFOPLIST_FILE = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 26.4; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 26.4; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = org.jimrandomh.Faceclaw; + PRODUCT_NAME = "$(TARGET_NAME)"; + REGISTER_APP_GROUPS = YES; + SDKROOT = auto; + STRING_CATALOG_GENERATE_SYMBOLS = YES; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; + SWIFT_APPROACHABLE_CONCURRENCY = YES; + SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; + XROS_DEPLOYMENT_TARGET = 26.4; + }; + name = Debug; + }; + 45A0A8D8304D0DD6008BD93B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + ENABLE_APP_SANDBOX = YES; + ENABLE_PREVIEWS = YES; + ENABLE_USER_SELECTED_FILES = readonly; + GENERATE_INFOPLIST_FILE = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 26.4; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 26.4; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = org.jimrandomh.Faceclaw; + PRODUCT_NAME = "$(TARGET_NAME)"; + REGISTER_APP_GROUPS = YES; + SDKROOT = auto; + STRING_CATALOG_GENERATE_SYMBOLS = YES; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; + SWIFT_APPROACHABLE_CONCURRENCY = YES; + SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; + XROS_DEPLOYMENT_TARGET = 26.4; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 45A0A8C6304D0DD5008BD93B /* Build configuration list for PBXProject "Faceclaw" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 45A0A8D4304D0DD6008BD93B /* Debug */, + 45A0A8D5304D0DD6008BD93B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 45A0A8D6304D0DD6008BD93B /* Build configuration list for PBXNativeTarget "Faceclaw" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 45A0A8D7304D0DD6008BD93B /* Debug */, + 45A0A8D8304D0DD6008BD93B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 45A0A8C3304D0DD5008BD93B /* Project object */; +} diff --git a/iOS/Faceclaw.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/iOS/Faceclaw.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/iOS/Faceclaw.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/iOS/Faceclaw/Assets.xcassets/AccentColor.colorset/Contents.json b/iOS/Faceclaw/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/iOS/Faceclaw/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iOS/Faceclaw/Assets.xcassets/AppIcon.appiconset/Contents.json b/iOS/Faceclaw/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..ffdfe150 --- /dev/null +++ b/iOS/Faceclaw/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,85 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iOS/Faceclaw/Assets.xcassets/Contents.json b/iOS/Faceclaw/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/iOS/Faceclaw/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iOS/Faceclaw/ContentView.swift b/iOS/Faceclaw/ContentView.swift new file mode 100644 index 00000000..6694b8d3 --- /dev/null +++ b/iOS/Faceclaw/ContentView.swift @@ -0,0 +1,24 @@ +// +// ContentView.swift +// Faceclaw +// +// Created by James Babcock on 9/5/26. +// + +import SwiftUI + +struct ContentView: View { + var body: some View { + VStack { + Image(systemName: "globe") + .imageScale(.large) + .foregroundStyle(.tint) + Text("Hello, world!") + } + .padding() + } +} + +#Preview { + ContentView() +} diff --git a/iOS/Faceclaw/FaceclawApp.swift b/iOS/Faceclaw/FaceclawApp.swift new file mode 100644 index 00000000..d1309702 --- /dev/null +++ b/iOS/Faceclaw/FaceclawApp.swift @@ -0,0 +1,17 @@ +// +// FaceclawApp.swift +// Faceclaw +// +// Created by James Babcock on 9/5/26. +// + +import SwiftUI + +@main +struct FaceclawApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/package-lock.json b/package-lock.json index 783099da..677da298 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ }, "devDependencies": { "@nativescript/android": "9.0.4", + "@nativescript/ios": "9.0.3", "@nativescript/types": "~9.0.0", "@nativescript/webpack": "~5.0.25", "typescript": "~5.4.0" @@ -515,6 +516,13 @@ "integrity": "sha512-MzL7R/nPZU2qnvDWWuJ8RB7H3luEwANgFX/d/ILdg7bSYxl6uANCfzlueHnWgrQmBxu6dTkvPsFW2WNVUxlhUg==", "license": "Apache-2.0" }, + "node_modules/@nativescript/ios": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/@nativescript/ios/-/ios-9.0.3.tgz", + "integrity": "sha512-1IE9OIkBac4D8IPeFZ7kNxQRUr9s7BgFwOoS8XwhX5RvJHE/oSqjbSp+ag9A7MennpyDs/qxduGkwpS1EmmxOg==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/@nativescript/theme": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@nativescript/theme/-/theme-3.1.0.tgz", diff --git a/package.json b/package.json index c4a1783e..210a9ed8 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,10 @@ "version": "1.0.0", "private": false, "scripts": { + "build:ios": "scripts/ios.sh build ios --for-device", + "run:ios": "scripts/ios.sh run ios", + "prepare:ios": "scripts/ios.sh prepare ios", + "doctor:ios": "scripts/ios.sh doctor ios", "build": "./build.sh", "run": "./build_and_run.sh", "release": "scripts/release.sh", @@ -23,6 +27,7 @@ }, "devDependencies": { "@nativescript/android": "9.0.4", + "@nativescript/ios": "9.0.3", "@nativescript/types": "~9.0.0", "@nativescript/webpack": "~5.0.25", "typescript": "~5.4.0" diff --git a/webpack.config.js b/webpack.config.js index d26aaac4..94bb49ff 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,6 +4,18 @@ const { resolve } = require("path"); module.exports = (env) => { webpack.init(env); + if (env.ios) { + // The initial iOS UI is constructed in code. Skip automatic registration + // of every XML page (and its Android-only service/worker dependencies). + // Explicit imports can still share any platform-independent app code. + webpack.chainWebpack((config) => { + const entry = config.entry('bundle'); + entry.values().forEach((value) => { + if (value.includes('virtual-entry-typescript')) entry.delete(value); + }); + }); + } + // Learn how to customize: // https://docs.nativescript.org/webpack