isMinVersionSupported
Synchronously checks whether the currently running Toss app version satisfies the per-platform minimum version requirements passed as an argument. Use it to gate features that only work on newer app versions and prompt users to update when the requirement isn't met.
Signature
import { isMinVersionSupported } from '@apps-in-toss/web-framework';
declare function isMinVersionSupported(minVersions: {
android: `${number}.${number}.${number}` | 'always' | 'never';
ios: `${number}.${number}.${number}` | 'always' | 'never';
}): boolean;
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
minVersions | object | ✓ | Per-platform minimum version requirements. |
minVersions.android | `${number}.${number}.${number}` | 'always' | 'never' | ✓ | Android minimum version. 'always' means supported on all versions; 'never' means never supported. |
minVersions.ios | `${number}.${number}.${number}` | 'always' | 'never' | ✓ | iOS minimum version. 'always' means supported on all versions; 'never' means never supported. |
Returns
boolean—trueif the current app version meets the per-platform minimum,falseotherwise.
Permission
No permission required — isMinVersionSupported is not bound to a PermissionName. For the typical permission flow used by other namespaces, see Guides — Permissions pattern.
Examples
Minimal
import { isMinVersionSupported } from '@apps-in-toss/web-framework';
const isSupported = isMinVersionSupported({
android: '5.100.0',
ios: '5.100.0',
});
if (!isSupported) {
console.log('Please update to the latest version of the Toss app.');
}
Realistic — show update prompt when version requirement isn't met
import { isMinVersionSupported } from '@apps-in-toss/web-framework';
function FeaturePage() {
const isSupported = isMinVersionSupported({
android: '5.150.0',
ios: '5.120.0',
});
if (!isSupported) {
return (
<div>
<h2>Update required</h2>
<p>This feature is only available on the latest version of the Toss app. Please update and try again.</p>
</div>
);
}
return (
<div>
<h2>New feature</h2>
{/* Feature content only available on newer versions */}
</div>
);
}
Using 'always' / 'never' special values
import { isMinVersionSupported } from '@apps-in-toss/web-framework';
// iOS-only feature: Android is always unsupported
const isIosOnlySupported = isMinVersionSupported({
android: 'never',
ios: '5.100.0',
});
// Universally supported: bypass version check entirely
const isAlwaysSupported = isMinVersionSupported({
android: 'always',
ios: 'always',
});
Try it live
Open the Environment page in sdk-example and run the isMinVersionSupported card to inspect the result.
Related APIs
getTossAppVersion— returns the current app version string.getPlatformOS— returns the current platform OS.getServerTime— seegetServerTime.isSupported()for a similar per-function support check pattern.
Related guides
- Guides — Permissions pattern — permission flow used by other namespaces (reference only;
isMinVersionSupporteddoesn't require a permission). - Recipes — App-version branching and update prompt
External references
@apps-in-toss/web-framework— SDK package. The actual exports are re-exported from@apps-in-toss/web-bridge.- Web standard counterpart: none — host app version checking is not available through the standard Web API.