Skip to content

Embed the Intercom iOS SDK from its GitHub release instead of CocoaPods - #373

Merged
niamh-coleman merged 2 commits into
masterfrom
niamh/ios-sdk-from-github-release
Nov 10, 2026
Merged

niamh-coleman merged 2 commits into
masterfrom
niamh/ios-sdk-from-github-release

Conversation

@niamh-coleman

Copy link
Copy Markdown
Contributor

Why?

The Intercom iOS SDK is no longer published to the CocoaPods trunk, so the plugin's Intercom pod can't pick up new SDK versions.

How?

When the plugin is installed for iOS, a hook downloads the pinned SDK release from GitHub, checks its SHA-256 and caches it, and the plugin embeds it as a framework instead of a pod. The CocoaPods update hooks and the q dependency they needed are removed.

Notes for reviewers

Existing apps need cordova plugin rm then add to drop the old pod (README updated). The pinned version and checksum now live in the install hook, so release PRs bump them there.

tested: simulator build and launch of the Example app on a fresh install, and an upgrade from the pod-based plugin via plugin rm / add.

Generated with Claude Code

The Intercom pod is no longer published to the CocoaPods trunk, so the
plugin now downloads Intercom.xcframework for a pinned version from the
intercom-ios GitHub release when it is installed for iOS, verifies its
SHA-256 and embeds it as a framework. The CocoaPods hooks and the q
dependency they needed are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@niamh-coleman
niamh-coleman marked this pull request as ready for review November 9, 2026 16:24

@DD-Intercom DD-Intercom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approach is right: a podspec can't redirect a dependency to a non-trunk source, so fetching the release zip in an install hook is the option that doesn't push work onto every app. Pinned checksum, documented cache override, and dropping the after_prepare hook that silently ran pod update Intercom are all wins. CircleCI's cordova plugin add + build ios does exercise the new hook, so green CI means something here.

Blocking-ish: the hook can serve a stale SDK after a version bump, and the download lands in a tracked directory with no .gitignore entry. Both inline.

Two things with no line to attach to: intercom-plugin has no files allowlist or .npmignore, so a publish from a dirty working copy would ship the binary (publish.yml runs from a clean checkout, so CI is fine); and there's no dependency-update workflow in this repo, unlike intercom-react-native.

~ Automated via Claude

}

function sha256(file) {
return crypto.createHash('sha256').update(fs.readFileSync(file)).digest('hex');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: readFileSync slurps the whole zip. Fine at ~12 MB, but a stream hash is two lines.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Kept readFileSync: the hook is synchronous, so streaming means a chunked read loop or making the hook async, and at ~12 MB I don't think it's worth the extra code.

🤖 Addressed by Claude Code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fair — a chunked read loop or an async hook isn't worth it at 12 MB. Dropping this.

try {
execFileSync('unzip', ['-q', zipPath, '-d', tmp], { stdio: 'inherit' });
fs.rmSync(frameworkPath, { recursive: true, force: true });
fs.renameSync(path.join(tmp, 'Intercom.xcframework'), frameworkPath);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: the pod kept preserve_paths for dSYM; this drops the dSYMs. Only affects symbolicating Intercom frames in crash reports — just flagging it as a choice rather than a side effect.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No dSYMs are lost here: the xcframework Info.plist sets DebugSymbolsPath = dSYMs for each slice, and Xcode copies Intercom.framework.dSYM into the build products from it (seen in the Example simulator build).

🤖 Addressed by Claude Code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Confirmed on the 19.9.2 zip: no top-level dSYM directory, DebugSymbolsPath = dSYMs on both slices, and dSYMs/Intercom.framework.dSYM inside ios-arm64 and ios-arm64_x86_64-simulator. The trunk spec's 'dSYM' preserve path matched nothing. Nothing lost — resolving.

Comment thread intercom-plugin/plugin.xml Resolved
Comment thread README.md Resolved
Comment thread README.md Resolved
The install hook writes a version and checksum stamp next to the
extracted framework and re-extracts when it changes, so a linked plugin
picks up a bumped SDK. The extracted SDK is git- and npm-ignored, and
the README covers the download hosts, the use_frameworks! change and a
platform re-add fallback for upgrades.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@DD-Intercom DD-Intercom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All four addressed. The stamp re-extracts on a changed or missing pin, the nested .gitignore covers the framework and the stamp and doubles as the npm exclude, and the README now names the proxy hosts, the platform rm/add fallback and the use_frameworks! symptom.

Verified independently: the pinned SHA256 matches the 19.9.2 release asset, and CircleCI's ios job does download from a cold cache — so a wrong checksum can't ship green. That's a better guard than the digest check I suggested; the plugin.xml pointer is enough.

dSYM and stream-hash threads resolved in your favour. LGTM.

~ Automated via Claude

@niamh-coleman
niamh-coleman merged commit a7274ff into master Nov 10, 2026
5 checks passed
@niamh-coleman
niamh-coleman deleted the niamh/ios-sdk-from-github-release branch November 10, 2026 13:24
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