Skip to main content

navigation

Close the current view, open external URLs, share content, and control device-level display settings like orientation, secure screen, and screen-awake mode. This namespace covers the host-environment integration points that shape how a mini-app fits into the surrounding Toss app.

Methods

MethodPurpose
closeViewClose the current mini-app view.
getTossShareLinkGenerate a Toss in-app share link.
openURLOpen an external URL.
requestReviewTrigger an App Store / Play Store review prompt.
setDeviceOrientationLock the screen to portrait or landscape.
setIosSwipeGestureEnabledEnable or disable the iOS edge-swipe back gesture.
setScreenAwakeModePrevent the screen from auto-dimming.
setSecureScreenBlock screen capture and recording.
shareOpen the system share sheet with a message.

Permission

No permission required. None of the methods in this namespace are bound to a PermissionName, and none expose getPermission() / openPermissionDialog() helpers. For the permission flow used by other namespaces, see Guides — Permissions pattern.

UX guidance

  • Use closeView only for deliberate exits. Call it from a "Done" button or an "×" icon — explicit signals that the user wants to leave. Calling it from an error handler makes the view disappear unexpectedly.
  • Always release setScreenAwakeMode. Screen-awake mode drains the battery fast. When the feature that needs the screen on is done (or the component unmounts), call setScreenAwakeMode({ enabled: false }). A useEffect cleanup is the right place.
  • Don't over-apply setSecureScreen. Reserve it for screens that genuinely contain sensitive data — payment details, identity numbers. Blocking every screen makes sharing impossible and can clash with accessibility tools.
  • Use setDeviceOrientation for real layout needs. Only lock orientation when the feature meaningfully requires it (video playback, a game, a map in landscape). Arbitrary locks create friction.

Try it live

All methods are available on the Navigation page in sdk-example.

Open in sdk-example

External references