Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
788 changes: 513 additions & 275 deletions implementations/ios-sdk/OptimizationApp.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
runPostActionsOnFailure = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6B18419FBDE96C10776B1E0D"
BuildableName = "OptimizationAppSwiftUI.app"
BlueprintName = "OptimizationAppSwiftUI"
ReferencedContainer = "container:OptimizationApp.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
onlyGenerateCoverageForSpecifiedTargets = "NO">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6B18419FBDE96C10776B1E0D"
BuildableName = "OptimizationAppSwiftUI.app"
BlueprintName = "OptimizationAppSwiftUI"
ReferencedContainer = "container:OptimizationApp.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F579B74E29D9881CA6DA1E7B"
BuildableName = "OptimizationAppUITestsSwiftUI.xctest"
BlueprintName = "OptimizationAppUITestsSwiftUI"
ReferencedContainer = "container:OptimizationApp.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<CommandLineArguments>
</CommandLineArguments>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6B18419FBDE96C10776B1E0D"
BuildableName = "OptimizationAppSwiftUI.app"
BlueprintName = "OptimizationAppSwiftUI"
ReferencedContainer = "container:OptimizationApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6B18419FBDE96C10776B1E0D"
BuildableName = "OptimizationAppSwiftUI.app"
BlueprintName = "OptimizationAppSwiftUI"
ReferencedContainer = "container:OptimizationApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
runPostActionsOnFailure = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB66258D797442B93A7B2200"
BuildableName = "OptimizationAppUIKit.app"
BlueprintName = "OptimizationAppUIKit"
ReferencedContainer = "container:OptimizationApp.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
onlyGenerateCoverageForSpecifiedTargets = "NO">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB66258D797442B93A7B2200"
BuildableName = "OptimizationAppUIKit.app"
BlueprintName = "OptimizationAppUIKit"
ReferencedContainer = "container:OptimizationApp.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B4657F1B8073EF57509BFE17"
BuildableName = "OptimizationAppUITestsUIKit.xctest"
BlueprintName = "OptimizationAppUITestsUIKit"
ReferencedContainer = "container:OptimizationApp.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<CommandLineArguments>
</CommandLineArguments>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB66258D797442B93A7B2200"
BuildableName = "OptimizationAppUIKit.app"
BlueprintName = "OptimizationAppUIKit"
ReferencedContainer = "container:OptimizationApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB66258D797442B93A7B2200"
BuildableName = "OptimizationAppUIKit.app"
BlueprintName = "OptimizationAppUIKit"
ReferencedContainer = "container:OptimizationApp.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
11 changes: 0 additions & 11 deletions implementations/ios-sdk/OptimizationApp/Info.plist

This file was deleted.

73 changes: 28 additions & 45 deletions implementations/ios-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,79 +4,62 @@
</a>
</p>

<h1 align="center">Contentful Personalization & Analytics</h1>
Reference app for the iOS Optimization SDK. Two app shells that exercise the SDK against the mock
server in `lib/mocks/`:

<h3 align="center">iOS Reference App</h3>

<div align="center">

[Readme](./README.md) ·
[Guides](https://contentful.github.io/optimization/documents/Documentation.Guides.html) ·
[Reference](https://contentful.github.io/optimization) · [Contributing](../../CONTRIBUTING.md)

</div>
- **`OptimizationAppSwiftUI`** — SwiftUI shell, sources under `swiftui/`.
- **`OptimizationAppUIKit`** — UIKit shell, sources under `uikit/`.

> [!WARNING]
>
> The Optimization SDK Suite is pre-release (alpha). Breaking changes may be published at any time.
Both apps share `shared/` (config, Contentful fetcher, analytics event store) and run the **same**
UI test bundle from `uitests/` against their respective host app. Two host bundles, one test source
tree — the only way to prove SDK behavior is identical across UI frameworks.

Reference app for current native iOS bridge and preview-panel validation work. This app exercises
the local iOS implementation surface against the mock server in `lib/mocks/` and hosts the XCUITest
suite.
## Project generation

> [!NOTE]
>
> This is not a published iOS SDK package. The public native iOS SDK is still planned; see the
> package placeholder at [`packages/ios`](../../packages/ios/README.md).
The Xcode project is generated by [xcodegen](https://github.com/yonaskolb/XcodeGen) from
`project.yml`. Whenever you add, rename, or move a source file, regenerate:

## What This Demonstrates

Use this app when you need to validate current native iOS bridge and preview-panel behavior against
the shared mock API. The XCUITest suite mirrors selected cross-platform preview-panel scenarios so
iOS behavior can be compared with React Native E2E coverage.

## Prerequisites

- Xcode with an iOS Simulator available.
- pnpm workspace dependencies installed from the monorepo root.
- The mock server running at `http://localhost:8000`.
```sh
brew install xcodegen # one-time
xcodegen generate
```

## Setup
<h3 align="center">iOS Reference App</h3>

From the monorepo root, start the mock API server before running UI tests:
Tests live under `uitests/Tests/` and assume the mock server is running at `http://localhost:8000`:

```sh
pnpm serve:mocks
```

## Running Tests

All UI tests live under `OptimizationAppUITests/Tests/`.

Run the full suite locally:
Run the full suite against both shells:

```sh
xcodebuild test \
-project OptimizationApp.xcodeproj \
-scheme OptimizationApp \
-scheme OptimizationAppSwiftUI \
-destination 'platform=iOS Simulator,name=iPhone 16'

xcodebuild test \
-project OptimizationApp.xcodeproj \
-scheme OptimizationAppUIKit \
-destination 'platform=iOS Simulator,name=iPhone 16'
```

Run only the preview-panel override suite (recommended during development of that feature):
Run a single test class against the SwiftUI shell:

```sh
xcodebuild test \
-project OptimizationApp.xcodeproj \
-scheme OptimizationApp \
-scheme OptimizationAppSwiftUI \
-destination 'platform=iOS Simulator,name=iPhone 16' \
-only-testing:OptimizationAppUITests/PreviewPanelOverridesTests
-only-testing:OptimizationAppUITestsSwiftUI/PreviewPanelOverridesTests
```

### Adding New Test Files

XCUITest source files must be added to the `OptimizationAppUITests` target in Xcode before they're
compiled. Adding a `.swift` file to `OptimizationAppUITests/Tests/` on disk is **not** enough; open
the project in Xcode and confirm the new file's Target Membership includes `OptimizationAppUITests`.
Drop the `.swift` into `uitests/Tests/` and run `xcodegen generate`. Both UI test bundles pick it up
automatically — no Target Membership clicking in Xcode.

## Preview Panel Tests

Expand Down
Loading
Loading