Skip to content

Document forcePortrait Option for Landscape-Locked Games#19

Merged
huda-stash merged 1 commit intomainfrom
hdabbouseh/force-portrait-checkout
Mar 2, 2026
Merged

Document forcePortrait Option for Landscape-Locked Games#19
huda-stash merged 1 commit intomainfrom
hdabbouseh/force-portrait-checkout

Conversation

@huda-stash
Copy link
Copy Markdown
Collaborator

@huda-stash huda-stash commented Feb 26, 2026

Document forcePortrait Option for Landscape-Locked Games

Overview

This PR adds documentation and sample code comments to guide partners on using the existing forcePortrait option when their Unity games are locked to landscape orientation. This ensures checkout is always usable by displaying in portrait mode, even when the game itself is locked to landscape.

Problem

When a Unity game is locked to landscape orientation (defaultScreenOrientation: 4), the Stash checkout would also display in landscape mode, making it difficult or impossible for users to complete purchases. The checkout UI is designed for portrait orientation and doesn't work well in landscape.

Solution

The StashNative SDK already supports forcing portrait orientation via the forcePortrait flag in StashNativeCardConfig. This PR documents when and how partners should use this existing feature.

Changes

Documentation (README.md)

  • Added guidance in the OpenCard() example showing how to use forcePortrait when game is locked to landscape
  • Added a note explaining the requirement for landscape-locked games
  • Updated the forcePortrait field description in the API reference to clarify when it's needed
  • Clarified that portrait orientation must be enabled in Unity Player Settings (iOS: allowedAutorotateToPortrait: 1)

Sample Code (StashSample.cs)

  • Added helpful comments in OpenCard() method explaining when to uncomment forcePortrait = true
  • Added the same guidance in GenerateLinkAndOpen() method
  • Kept forcePortrait commented out by default (partners enable it if needed)

Requirements

  • iOS: Portrait orientation must be enabled in Unity Player Settings (allowedAutorotateToPortrait: 1 in ProjectSettings.asset)
  • Android: No additional configuration needed
  • Game can remain locked to landscape (defaultScreenOrientation: 4)

Usage

Partners with landscape-locked games should:

config.forcePortrait = true; // Force portrait for checkout

StashNative.Instance.OpenCard(checkoutUrl, 
    onDismiss: OnDismissed,
    onSuccess: OnSuccess,
    onFailure: OnFailure,
    config: config
);```

@huda-stash huda-stash force-pushed the hdabbouseh/force-portrait-checkout branch 6 times, most recently from 95bfb77 to 1c134cd Compare February 26, 2026 15:05
- Add guidance for using forcePortrait=true when game is locked to landscape
- Update OpenCard() example to show forcePortrait usage
- Clarify that portrait orientation must be enabled in Unity Player Settings
- Ensures partners know to set forcePortrait for usable checkout in landscape games

Made-with: Cursor
@huda-stash huda-stash force-pushed the hdabbouseh/force-portrait-checkout branch from 1c134cd to 8bf37ac Compare February 26, 2026 15:07
@huda-stash huda-stash changed the title Force Portrait Orientation for Stash Checkout Document forcePortrait Option for Landscape-Locked Games Feb 26, 2026
@huda-stash huda-stash requested a review from oliexe February 26, 2026 15:08
@huda-stash huda-stash merged commit c099168 into main Mar 2, 2026
2 checks passed
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