as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
跳转到主要内容
With the react-native-netinfo API, you can access network connection information. The Vega-ported version of this library has a different package name: keplerscript-netmgr-lib.

Installation

Follow the steps below to install keplerscript-netmgr-lib.
  1. Add the library dependency in your React Native for Vega application’s package.json. Select the tab for your React Native version.
  2. Add com.amazon.network.service to [wants.service] in your React Native for Vega app’s manifest.toml:
  3. Add API permission to [wants.privilege] in your React Native for Vega app’s manifest.toml:
  4. Reinstall dependencies using the npm install command.

API privileges

To access full API functionality, your app needs the com.amazon.network.privilege.net-info privilege. This privilege must be granted by the user at runtime. Without it, API responses are limited. To manage privileges:
  • Check the current privilege status using checkPrivilege("com.amazon.network.privilege.net-info").
  • Request user consent by calling requestPrivilege(), if needed.
For complete details, see the Security Manager API documentation.

Usage

The following code snippet shows how to query network status:

Supported Methods

The fetch() and refresh() methods return NetInfoState to access the network connection information.

Implementation details

Test on the simulator

You can test the network connection on the Vega Virtual Device by running the following commands.

Additional resources

For information on other libraries, see Supported Third-Party Libraries and Services.
最后修改于 2026年7月30日