Repository navigation
Embed the Intercom iOS SDK from its GitHub release instead of CocoaPods - #373
Conversation
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>
DD-Intercom
left a comment
There was a problem hiding this comment.
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.
| } | ||
|
|
||
| function sha256(file) { | ||
| return crypto.createHash('sha256').update(fs.readFileSync(file)).digest('hex'); |
There was a problem hiding this comment.
Nit: readFileSync slurps the whole zip. Fine at ~12 MB, but a stream hash is two lines.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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
left a comment
There was a problem hiding this comment.
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.
Why?
The Intercom iOS SDK is no longer published to the CocoaPods trunk, so the plugin's
Intercompod 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
qdependency they needed are removed.Notes for reviewers
Existing apps need
cordova plugin rmthenaddto 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