Skip to main content

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

NameTypeRequiredDescription
minVersionsobjectPer-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

  • booleantrue if the current app version meets the per-platform minimum, false otherwise.

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.

Open in sdk-example

External references