Repository navigation
chore: [SDK-5859] build demo-no-location with Swift Package Manager (1/3) - #2025
fadi-george wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
abdulraqeeb33
left a comment
There was a problem hiding this comment.
Requesting changes. vp run ios fails on a machine that already has this example.
examples/setup.sh:46 skips reinstall when the SDK tarball hash matches. This PR leaves that tarball alone and moves the example CLI from 20.2.0 to 21.0.0 (examples/demo-no-location/package.json:25). CLI 20's project loader returns null when ios/ has no Podfile. react-native spm still runs, because React Native 0.88 registers it. run-ios then has no iOS project. Put the example package.json and bun.lock in the stamp, hashed from $DEMO_DIR:
deps_hash=$(shasum "$DEMO_DIR/package.json" "$DEMO_DIR/bun.lock" | shasum | awk '{print $1}')
stamp_value="${tarball_hash}-${deps_hash}"Compare that to the stamp, and write it after install.
A checkout that has opened the old workspace still has ios/demo.xcworkspace after this pull. .gitignore:45 keeps xcuserdata, so git removes contents.xcworkspacedata and leaves the directory. CLI 21 sorts ios/ and picks .xcworkspace over .xcodeproj, then reads the missing contents file. clean:ios only deletes ios/build (package.json:13). Drop the workspace on the way in:
"preios": "vp run setup && rm -rf ios/Pods ios/demo.xcworkspace && vp run update:spm",
"clean:ios": "rm -rf ios/build ios/Pods ios/demo.xcworkspace"vp run ios does export ONESIGNAL_DISABLE_LOCATION into run-ios, and that is the process that loads Package.swift. spm update does not evaluate this manifest, so the prefix on update:spm (package.json:11) does not drop OneSignalLocation. README line 29 should say the variable has to be set for Xcode or xcodebuild. Launch Xcode from a terminal that exports it, then reset package caches. The root README already says that.
.github/workflows/ios-spm.yml builds examples/demo only. Nothing here links this app or checks that OneSignalLocation is absent. A job on this stack would lock it. I would not hold the script fixes on that.
project.pbxproj:467 still points REACT_NATIVE_PATH at ${PODS_ROOT}. The target xcconfig overrides it. examples/demo rewrote the project-level value. README.md:48 says App.tsx does not call OneSignal.Location. App.tsx:62 does.
Description
One Line Summary
Move
examples/demo-no-location's iOS app from CocoaPods to React Native's Swift Package Manager mode.Details
Motivation
CocoaPods trunk becomes read-only on Dec 2, 2026, so the SDK is dropping CocoaPods (PR 2). This demo was the last app in the repo still on pods besides
demo-pods, which PR 2 deletes.Scope
react-native spm add --deintegrate, same asexamples/demoin chore: [SDK-5818] build the demo with Swift Package Manager (4/4) #2021: SPM packages injected intodemo.xcodeproj;Podfile,Podfile.lock, workspace and Gemfile removed. RN's generatedReactNativeSPM/and.spm-injected.jsonare committed since the project references them.@react-native-community/cli21.0.0 (CLI 20 only finds the iOS project through a Podfile).update:spmreplacespods/update:pods;preiosruns it.iosandupdate:spmexportONESIGNAL_DISABLE_LOCATION=true, since SPM reads it when resolving packages.demoapp target (no extension targets), so noOneSignal-XCFrameworkpackage refs were added..prettierignoreskips the generated.spm-injected.json.Most of the diff is generated (pbxproj, scheme pre-action, RN's SPM scripts).
Stack
Testing
Unit testing
No new tests.
vp testpasses.Manual testing
vp run update:spmand a Debug simulator build fromdemo.xcodeprojpass. The app links the OneSignal frameworks withoutOneSignalLocation.Affected code checklist
Checklist
Overview
Testing
Final pass
🤖 Generated with Claude Code