Repository navigation
Require the SuperwallKit that keeps paywalls to the game's orientations - #21
Conversation
SuperwallKit presents a paywall in a window of its own, whose root allowed every orientation, so Screen.autorotateTo* was never consulted while a paywall was up. superwall/Superwall-iOS#568 makes that window follow the app's own view controller. Require 4.19.1, the first release it can ship in, so games get the fix without pinning it themselves. Podfiles kept by an Append build are moved off any requirement an earlier version of this package wrote, not just `~> 4.0`. Those are listed by their version part only, so native-sdk-bump.yml's rewrite of the current pod line leaves them alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CR7gAmtFzGVaH1B6Mxxrga
Maple review🟡 Confidence 6/10 · needs attention. Held at 6 because a correctness warning is open. Raises the SuperwallKit floor to 4.19.1 and migrates two previously generated Podfile requirements. The migration needs to preserve customized constraint lists before merging. Before merge
Findings🟠 Warning · F1 ·
|
|
Merged with 2 steps from "Before merge" still open. If they are done, tick them on the review comment; if not, now is the time.
|
| string previousPod = "pod 'SuperwallKit', " + requirement; | ||
| if (previousPod != SuperwallKitPod) | ||
| { | ||
| podfileContent = podfileContent.Replace(previousPod, SuperwallKitPod); |
There was a problem hiding this comment.
Warning
UpdateSuperwallKitRequirement rewrites customized constraint lists
F1 · Warning · correctness
A developer who appends '< 4.19.0' to the existing '>= 4.12.10', '< 5.0' requirement gets '>= 4.19.1', '< 5.0', '< 4.19.0' on the next Append build. The substring replacement changes a hand-customized requirement into contradictory bounds, breaking dependency resolution instead of preserving the customization.
Match the complete version-constraint list before replacing it, allowing trailing CocoaPods options or comments but leaving additional version constraints untouched. Add a regression test for an appended upper bound.
🤖 Prompt to fix with an AI agent
In `Editor/SuperwallPostBuildProcessor.cs:42`: `UpdateSuperwallKitRequirement` rewrites customized constraint lists.
A developer who appends `'< 4.19.0'` to the existing `'>= 4.12.10', '< 5.0'` requirement gets `'>= 4.19.1', '< 5.0', '< 4.19.0'` on the next Append build. The substring replacement changes a hand-customized requirement into contradictory bounds, breaking dependency resolution instead of preserving the customization.
Suggested fix: Match the complete version-constraint list before replacing it, allowing trailing CocoaPods options or comments but leaving additional version constraints untouched. Add a regression test for an appended upper bound.
Verify the problem exists at that location before changing it, and keep the fix to those lines.
Why
On iOS, a landscape-only game can be rotated to portrait while a paywall is open, and it stays in portrait after the paywall closes. A customer reported this for a map that's locked to landscape through
Screen.autorotateTo*.SuperwallKit presents the paywall in its own window. That window's root is a plain
UIViewController, which allows every orientation, so Unity's orientation settings are never checked. The fix is native: superwall/Superwall-iOS#568 makes the paywall window follow the app's top view controller. For a Unity game, that's Unity's view controller, which reportsScreen.autorotateTo*. When the paywall closes, the fix also asks UIKit to check orientations again.What
SuperwallKit >= 4.19.1, < 5.0. 4.19.1 is the version staged on Superwall-iOSdevelop, so it's the first release #568 can ship in. No bridge or C# changes are needed.~> 4.0and>= 4.12.10, < 5.0). Before, only~> 4.0was moved. A requirement the developer set by hand is left alone. This logic is now a testableUpdateSuperwallKitRequirement.native-sdk-bump.yml'ssedon thepod 'SuperwallKit', '…'line no longer rewrites them too.Before merging
pod installfail.ci~/ios-harness/Package.swiftatfrom: "4.12.10". Raising it before the release would break the harness's package resolution, and the harness doesn't test orientation.Testing
Tests/Editor/PodfileRequirementTests.cs: both earlier requirements get moved, the current one is unchanged, and a hand-set pin is kept. These are Editor tests, and CI doesn't run Editor tests.Generated by Claude Code