Version
1. Getting the Toss app version (getTossAppVersion)
getTossAppVersion The function gets the Toss app version. For example, 5.206.0It is returned in a form like this. It is used to log the Toss app version or when a certain feature should run only on versions above a specific one.
Signature
function getTossAppVersion(): string;Return value
string
Toss app version
Example
import { getTossAppVersion } from '@apps-in-toss/web-framework';
const tossAppVersion = getTossAppVersion();import { getTossAppVersion } from '@apps-in-toss/web-framework';
import { Text } from '@toss/tds-mobile';
function TossAppVersionPage() {
const tossAppVersion = getTossAppVersion();
return <Text>{tossAppVersion}</Text>;
}import { getTossAppVersion } from '@apps-in-toss/framework';
import { Text } from '@toss/tds-react-native';
function TossAppVersionPage() {
const tossAppVersion = getTossAppVersion();
return <Text>{tossAppVersion}</Text>;
}2. Checking the app's minimum version (isMinVersionSupported)
This function checks whether the version of the Toss app currently running satisfies the minimum version requirement passed as a parameter. When a certain feature only works on the latest version, you can guide users to update the app.
Signature
function isMinVersionSupported(minVersions: {
android: `${number}.${number}.${number}` | 'always' | 'never';
ios: `${number}.${number}.${number}` | 'always' | 'never';
}): boolean;Parameter
minVersions · Required ·
ObjectAn object that specifies the minimum version requirements for each platform.
minVersions.android · Required ·
(${number}.${number}.${number}| 'always' | 'never'))The minimum version requirement for the Android platform.
minVersions.ios · Required ·
(${number}.${number}.${number}| 'always' | 'never'))The minimum version requirement for the iOS platform.
Return value
boolean
Returns true if the current app version is at least the minimum version, otherwise returns false.
Example
Last updated
Was this helpful?