@amazon-devices/expo-constantsは、アプリのインストールのライフタイムを通じて変化しないシステム情報を提供します。
インストール
package.jsonファイルにJavaScriptライブラリの依存関係を追加します。該当するReact Nativeバージョンのタブを選択してください。
- React Native 0.72
- React Native 0.83
npm installコマンドを使用して、依存関係を再インストールします。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
expo-constants オープンベータ版ドキュメント:本テクニカルドキュメントは、リリース前のオープンベータ…
@amazon-devices/expo-constantsは、アプリのインストールのライフタイムを通じて変化しないシステム情報を提供します。
package.jsonファイルにJavaScriptライブラリの依存関係を追加します。該当するReact Nativeバージョンのタブを選択してください。dependencies: {
...
"@amazon-devices/expo-constants": "~2.0.0",
"expo": "~50.0.0",
...
}
dependencies: {
...
"@amazon-devices/expo-constants": "~3.0.0",
"expo": "~50.0.0",
...
}
npm installコマンドを使用して、依存関係を再インストールします。import React from 'react';
import Constants from '@amazon-devices/expo-constants';
import {StyleSheet, Text, View} from 'react-native';
export const App = () => {
return (
<View style={styles.container}>
<Text style={styles.text}>
isHeadless: {String(Constants.isHeadless)}
</Text>
<Text style={styles.text}>
statusBarHeight: {Constants.statusBarHeight}
</Text>
<Text style={styles.text}>
systemFonts: {Constants.systemFonts.join(', ')}
</Text>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white',
justifyContent: 'center',
alignItems: 'center',
},
text: {
fontSize: 30,
color: 'black',
},
});
| NPMパッケージのバージョン | Vega SDKバージョン | Vega OSバージョン | React Nativeバージョン |
|---|---|---|---|
| 2.0.1758683737 | 0.23以前 | OS 1.1 (1401010009820)以前 | 0.72 |
| 3.0.1+15.2.0 | 0.24 | OS 1.2 (2101020054720) | 0.72、0.83 |
このページは役に立ちましたか?
