From 232d509cf98e9335f2f476fd1c73697eac8e1e59 Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Thu, 15 May 2025 14:39:08 +0100 Subject: [PATCH] Project tweaks (layout & docs) (#4121) * Re-order the project groups. * Update the instructions in FORKING.md. --- ElementX.xcodeproj/project.pbxproj | 10 ++++++---- docs/FORKING.md | 20 ++++++++++++++++---- project.yml | 12 +++++++++--- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index e7a79c109..fd95e1135 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -1669,6 +1669,7 @@ 3C368CAB3063EF275357ECD4 /* LoginScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginScreenViewModel.swift; sourceTree = ""; }; 3C3ADF21BE301D0DA48F2A7E /* ShareExtensionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareExtensionView.swift; sourceTree = ""; }; 3C3E67E09FE5A35D73818C39 /* AppLockScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLockScreenModels.swift; sourceTree = ""; }; + 3C8A63F1458D97D832C127DD /* app.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = app.yml; sourceTree = ""; }; 3CCE3636E3D01477C8B2E9D0 /* ReportContentScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReportContentScreenModels.swift; sourceTree = ""; }; 3CFD5EB0B0EEA4549FB49784 /* SettingsScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsScreen.swift; sourceTree = ""; }; 3D1D4A6D451F43A03CACD01D /* PINTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PINTextField.swift; sourceTree = ""; }; @@ -3570,17 +3571,18 @@ 405B00F139AEE3994601B36A = { isa = PBXGroup; children = ( + 3C8A63F1458D97D832C127DD /* app.yml */, 5D26A086A8278D39B5756D6F /* project.yml */, 99B9B46F2D621380428E68F7 /* ElementX */, + B04B538A859CD012755DC19C /* NSE */, + D0111119CDF3E28E6D7768E8 /* ShareExtension */, A4852B57D55D71EEBFCD931D /* UnitTests */, + 1803CD2B96BF06009334BB61 /* PreviewTests */, C0FAC17D4DD7D3A502822550 /* UITests */, 8A9C09B6A392465E03B8D1B1 /* IntegrationTests */, - 823ED0EC3F1B6CF47D284011 /* Tools */, A8002CB4F20B6282850A614C /* DevelopmentAssets */, - B04B538A859CD012755DC19C /* NSE */, - 1803CD2B96BF06009334BB61 /* PreviewTests */, 2197234282B4BC0CE79AAC74 /* Secrets */, - D0111119CDF3E28E6D7768E8 /* ShareExtension */, + 823ED0EC3F1B6CF47D284011 /* Tools */, 681566846AF307E9BA4C72C6 /* Products */, ); sourceTree = ""; diff --git a/docs/FORKING.md b/docs/FORKING.md index 7459b8f5e..f1c09ee21 100644 --- a/docs/FORKING.md +++ b/docs/FORKING.md @@ -1,15 +1,27 @@ # Forking -### Update the bundle identifier / app display name +### Project Configuration -To change the bundle identifier and the app display name for your app, open the `project.yml` file in the project root folder and change these settings: +To create a fork, the first step is to update some of the project's configuration options such as the bundle identifier and the app's display name. To do this, open the `app.yml` file in the project root folder and at a minimum change these settings: ``` -BASE_BUNDLE_IDENTIFIER: io.element.elementx APP_DISPLAY_NAME: Element X +APP_GROUP_IDENTIFIER: group.io.element +BASE_BUNDLE_IDENTIFIER: io.element.elementx +DEVELOPMENT_TEAM: 7J4U792NQT ``` -After the changes run `xcodegen` to propagate them. +After making the changes, run `xcodegen` to regenerate the project. + +### Runtime Configuration + +Once your project is configured and compiles, you'll likely want to tweak how the app works. [AppSettings.swift](../ElementX/Sources/Application/AppSettings.swift) contains all of the settings used by the app at runtime. + +### Authentication + +Element X's primary authentication method is to use OIDC against [Matrix Authentication Service](https://github.com/element-hq/matrix-authentication-service) (MAS). Unlike the older password-based authentication flows, this requires a small amount of configuration within the app. You need to make sure that all of the values passed to the SDK in the [OIDCConfiguration](https://github.com/element-hq/element-x-ios/blob/b2a37ec9d39622586754f58a98dcda35e0e8cf7e/ElementX/Sources/Application/AppSettings.swift#L206-L212) are hosted on the same domain otherwise dynamic client registration will fail. As we're using an [HTTPS callback](https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession/callback/https(host:path:)) for the web authentication, Apple validates ownership of the domain with the app. There are 2 steps to make sure this validation works: +- Add an [apple-app-site-association](https://developer.apple.com/documentation/xcode/supporting-associated-domains) file on your website with your app included in the `webcredentials` section. +- Update the [webcredentials](https://github.com/element-hq/element-x-ios/blob/b2a37ec9d39622586754f58a98dcda35e0e8cf7e/ElementX/SupportingFiles/target.yml#L122) associated domain entitlement in the app to match your domain and re-run `xcodegen`. ### Setup the location sharing diff --git a/project.yml b/project.yml index b84a247e5..1bf399ebd 100644 --- a/project.yml +++ b/project.yml @@ -5,6 +5,7 @@ attributes: fileGroups: - project.yml +- app.yml options: groupSortPosition: bottom @@ -15,9 +16,14 @@ options: groupOrdering: - order: - ElementX + - NSE + - ShareExtension - UnitTests + - PreviewTests - UITests - IntegrationTests + - DevelopmentAssets + - Secrets - Tools - pattern: ElementX order: @@ -69,6 +75,9 @@ packages: url: https://github.com/matrix-org/matrix-analytics-events minorVersion: 0.28.0 # path: ../matrix-analytics-events + EmbeddedElementCall: + url: https://github.com/element-hq/element-call-swift + exactVersion: 0.9.0 Emojibase: url: https://github.com/matrix-org/emojibase-bindings minorVersion: 1.4.1 @@ -81,9 +90,6 @@ packages: url: https://github.com/element-hq/matrix-rich-text-editor-swift exactVersion: 2.37.12 # path: ../matrix-rich-text-editor/platforms/ios/lib/WysiwygComposer - EmbeddedElementCall: - url: https://github.com/element-hq/element-call-swift - exactVersion: 0.9.0 # External dependencies Algorithms: