setIsReactNative
Sets the React Native environment flag for FCL. This function should be called during initialization of React Native applications to inform FCL that it's running in a React Native environment. This enables React Native-specific behaviors and optimizations.
Import
You can import the entire package and access the function:
_10import * as fcl from "@onflow/fcl-core"_10_10fcl.setIsReactNative(value)
Or import directly the specific function:
_10import { setIsReactNative } from "@onflow/fcl-core"_10_10setIsReactNative(value)
Usage
_11// Set React Native flag during app initialization_11import * as fcl from "@onflow/fcl"_11_11// In your React Native app's entry point (e.g., App.js)_11fcl.setIsReactNative(true)_11_11// Configure FCL for React Native_11fcl.config({_11 "accessNode.api": "https://rest-testnet.onflow.org",_11 "discovery.wallet": "https://fcl-discovery.onflow.org/api/testnet/authn"_11})
Parameters
value
- Type:
boolean
- Description: True to indicate React Native environment, false otherwise
Returns
void