keplerscript-netmgr-lib.
Installation
Follow these steps to installkeplerscript-netmgr-lib in your React Native for Vega application.
-
Add the library dependency to
package.json: -
Add
com.amazon.network.serviceto[wants.service]in yourmanifest.tomlfile: -
Add API permission to
[wants.privilege]in yourmanifest.tomlfile: -
Reinstall dependencies using the
npm installcommand.
API privileges
To access full API functionality, your app needs thecom.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.
Examples
The following code example shows how to query network status:Methods
fetch() and refresh() methods return NetInfoState to access the network connection information.

