Skip to content

feat: [SDK-4718] add native iOS SDK support to appium harness#38

Merged
fadi-george merged 11 commits into
mainfrom
fadi/sdk-4718
May 26, 2026
Merged

feat: [SDK-4718] add native iOS SDK support to appium harness#38
fadi-george merged 11 commits into
mainfrom
fadi/sdk-4718

Conversation

@fadi-george
Copy link
Copy Markdown
Contributor

Description

Adds the native iOS demo (OneSignal-iOS-SDK/examples/demo) as a first-class target in the Appium harness, so run-all.sh / run-local.sh can build, install, and exercise it alongside the wrapper SDKs. Closes SDK-4718.

Also includes a few small cleanups picked up while wiring the harness end-to-end (IAM spec consolidation, snackbar policy update in demo/build.md).

Details

Harness changes

  • run-all.sh

    • Adds ios to ALL_SDKS and updates --help.
    • Mirrors the existing android (native) handling: when --sdk=ios is combined with --platform=android, warn + skip with SKIP ios / android in the summary instead of failing.
  • run-local.sh

    • New --sdk=ios path. Infers PLATFORM=ios when only --sdk=ios is passed, validates the combo, and exits 0 if invoked with --platform=android (parity with the native Android skip).
    • New IOS_DIR and IOS_NATIVE_PROJECT env vars. IOS_NATIVE_PROJECT defaults to App.xcodeproj; the Xcode scheme is derived from its basename so users can rename the project without editing the script.
    • build_ios_native():
      • Always writes App/Secrets.plist via plutil (empty dict when env vars are unset) so the bundled resource phase doesn't fail, and so API keys with XML-special characters round-trip safely. Falls back to SecretsConfig.defaultAppId in the demo when credentials aren't provided.
      • Writes Secrets.plist BEFORE running xcodegen, so the generated .pbxproj always references a real on-disk file.
      • Gates xcodegen generate on project.yml -nt project.pbxproj. xcodegen 2.45.x isn't deterministic across no-op runs, so unconditional regen would leave spurious unstaged changes in the iOS SDK repo on every invocation.
      • Adds a content-hash build cache (ios_native_inputs_hash + .ios-native-build.stamp) covering demo sources, the SDK source pulled in via projectReferences, Secrets.plist, and the regenerated .pbxproj. Mirrors the existing dotnet/unity caching pattern; skips a no-op xcodebuild (~30-60s) when nothing relevant changed.
      • Invokes xcodebuild with the derived scheme, Release, the platform-appropriate -sdk, and the existing signing args path so --device-real works on iOS native too.

Test/doc cleanups

  • appium/tests/specs/03_iam.spec.ts: collapse the for (const iam of iamTypes) { it(...) } block into a single it('can show iam messages', …) that loops internally — same coverage, one less per-iteration session reset.
  • demo/build.md: drop login/logout from the snackbar allow-list (the iOS demo and others now match the Capacitor convention of no snackbar for login/logout); minor copy fixes around the User and Send In-App Message sections.

Affects

  • iOS-only changes; Android, Cordova, Capacitor, Flutter, React Native, Expo, .NET MAUI, Unity flows are untouched.
  • run-all.sh --platform=android and existing per-SDK invocations behave identically.

Testing

  • ./run-all.sh --sdks=ios --spec=03_ — IAM spec passes after the consolidation refactor.
  • ./run-all.sh --sdks=ios — full iOS suite runs end-to-end against the rebuilt native demo.
  • ./run-local.sh --sdk=ios (with and without ONESIGNAL_APP_ID / ONESIGNAL_API_KEY env vars) — builds, installs, and the hash cache correctly skips a second invocation.
  • ./run-all.sh --sdks=ios --platform=android — warns and skips without failing.
  • Verified no spurious .pbxproj diff in the iOS SDK repo after repeated runs.

Made with Cursor

@fadi-george fadi-george requested a review from a team as a code owner May 25, 2026 18:28
Comment thread appium/scripts/run-local.sh Outdated
@fadi-george fadi-george force-pushed the fadi/sdk-4718 branch 4 times, most recently from 42a2eb8 to 33be33e Compare May 26, 2026 01:54
Comment thread appium/scripts/run-local.sh
@fadi-george
Copy link
Copy Markdown
Contributor Author

@claude review

Comment thread appium/scripts/run-local.sh Outdated
Comment thread appium/scripts/run-all.sh
Replace ios_pbxproj_inputs_hash's project.yml awk parser with a wholesale
demo-dir file-listing scan. The awk only matched the `- path:` long form
and would silently drop dirs declared with any of XcodeGen's three other
sources: forms — current project.yml is fine but a future-edit footgun.

Hoist the run-all.sh label decision above the platform skip arms so SKIP,
PASS, and FAIL rows share one schema instead of mixing short and long
labels in the same summary table.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All three prior findings (sim/device stamp scoping, xcodegen cache gating, run-all label consistency) have been addressed in the latest commits — LGTM.

Extended reasoning...

Overview

The PR adds native iOS SDK support (OneSignal-iOS-SDK/examples/demo) as a first-class target in the local Appium harness scripts (run-all.sh, run-local.sh), plus two small test/doc cleanups (consolidated IAM spec loop, snackbar policy update in demo/build.md). All changes are confined to the test harness and demo guidance — no production SDK code is touched.

Security risks

None. The new build_ios_native writes a gitignored Secrets.plist via plutil (which handles XML-special characters safely), runs xcodegen and xcodebuild from a fixed demo directory, and reads env vars that already flow through the rest of the harness. No new attack surface.

Level of scrutiny

Low–medium. This is local developer/CI tooling — bugs surface as failed builds or stale binaries in dev, not as production regressions. The build-cache logic is the trickiest part, and my prior reviews flagged three correctness issues there which have all been addressed with verifiable fixes (stamp now scoped by IOS_BUILD_DIR, xcodegen gated on a content hash instead of mtime, summary labels hoisted to a single ${label} variable used in all branches).

Other factors

The author replied substantively to each finding, explained the precedent followed (matching build_dotnet_ios/build_unity_ios cache scoping), and verified the new whole-dir hash behaviour. The bug hunting system found no further issues on the current revision. The remaining diff (IAM spec collapse into a single it, outcome spec reordering to click radio before setting value, snackbar policy doc update) is mechanical and self-contained.

@fadi-george fadi-george merged commit e125192 into main May 26, 2026
3 checks passed
@fadi-george fadi-george deleted the fadi/sdk-4718 branch May 26, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants