### Get Remote Configurations Example Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.Environment Example demonstrating how to fetch remote configurations associated with the current environment using the Eitri library. ```javascript const environment = await Eitri.environment.getRemoteConfigs() ``` -------------------------------- ### Eitri Navigation Class API Documentation Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.Navigation Comprehensive API documentation for the Eitri Navigation class, detailing methods for screen navigation, app opening/closing, and reloading within the Eitri framework. Includes method signatures, parameter descriptions, return types, usage examples, and compatibility information. ```APIDOC Navigation Class Methods: navigate(config): Promise Navigates to another screen contained in the **views** folder. Parameters: config: [NavigationConfig] - Configuration object for navigation. - path: string - The path to the target view. - state?: object - State object to pass to the next view. - replace?: boolean - If true, replaces the current view instead of pushing. Examples: Eitri.navigation.navigate({path: '/AnotherView'}) Eitri.navigation.navigate({path: '/AnotherView', state: { name: 'Pedro Álvares Cabral' }}) Eitri.navigation.navigate({path: '/AnotherView', replace: true}) Returns: Promise Compatibility: API LEVEL 1 - Functionality added back(steps?): void Performs a navigation back to one or several previous screens. Parameters: steps: number - Number of screens to go back (optional). Examples: Eitri.navigation.back() Returns: void Compatibility: API LEVEL 1 - Functionality added backToTop(): void Performs navigation back to the first screen in the navigation stack. Examples: Eitri.navigation.backToTop() Returns: void Compatibility: API LEVEL 1 - Functionality added open(config): Promise Opens an eitri-app. Parameters: config: [OpenInput] - Configuration object for opening an app. - slug: string - The slug of the app to open. - initParams?: object - Parameters to initialize the app with. - restorationContext?: object - Context for restoring the app. - replace?: boolean - If true, replaces the current app. Examples: Eitri.navigation.open({ slug: 'checkout', initParams: {item: 'Refrigerator', id: 999987}, restorationContext: {screen: 'categories/appliances'} }) Returns: Promise Compatibility: API LEVEL 1 - Functionality added API LEVEL 22 - `replace` parameter added close(options?): Promise Closes the current eitri-app. Parameters: options?: [CloseOptions] - Optional closing options. Examples: Eitri.navigation.close() Returns: Promise Compatibility: API LEVEL 1 - Functionality added reload(): Promise Reloads the current eitri-app. Examples: Eitri.navigation.reload() Returns: Promise Compatibility: API LEVEL 21 - Functionality added setOnResumeListener(listener): void Adds a listener that is called when the app resumes. Parameters: listener: function - The callback function to execute on resume. Returns: void addOnResumeListener(listener): void Adds a listener that is called when the app resumes. Parameters: listener: function - The callback function to execute on resume. Returns: void addOnLostUserFocusListener(listener): void Adds a listener that is called when the user focus is lost. Parameters: listener: function - The callback function to execute when focus is lost. Returns: void clearOnResumeListener(): void Clears all resume listeners. Returns: void addBackHandler(handler): void Adds a custom back button handler. Parameters: handler: function - The function to call when the back button is pressed. Returns: void clearBackHandlers(): void Clears all custom back button handlers. Returns: void ``` -------------------------------- ### Get Environment Name Example Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.Environment Example demonstrating how to retrieve the name of the current environment using the Eitri library. ```javascript const environment = await Eitri.environment.getName() ``` -------------------------------- ### Datadog Class API Documentation Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.Datadog Provides comprehensive API documentation for the Datadog class, including its constructor and methods for initialization and instance retrieval. It details parameters, return values, usage examples, and compatibility information. ```APIDOC Class Datadog: Purpose: Manages Datadog integration for tracking and logging. Constructor: new Datadog(): Datadog Returns: An instance of the Datadog class. Methods: init(dataDogConfig): Promise Description: Initializes an instance of Datadog based on the provided configuration. Dependencies: Datadog version 5. External Link: https://docs.datadoghq.com/logs/log_collection/javascript/#initialization-parameters Parameters: dataDogConfig: DatadogConfig clientToken: string - Used to identify and authorize the integration with Datadog. site: string - Indicates where your Datadog organization is hosted. Returns: Promise - A promise that resolves when initialization is complete. Example: const dataDogConfig = { clientToken: "myClientToken", site: "datadoghq.com" } try { await Eitri.tracking.dataDog.init(constants.dataDogConfigs) } catch (error) { console.log("Eitri.tracking.dataDog.init.error: ", error) } Compatibility Control: API LEVEL 2 - Functionality added. getInstance(): any Description: Provides an instance of Datadog for direct interaction. Returns: any - The Datadog instance, allowing access to its logger and other functionalities. Example: try { const dataDog = await Eitri.tracking.dataDog.getInstance() dataDog.logger.info('eitri_doctor', { name: '/Home' }) } catch (error) { console.log("Eitri.tracking.dataDog.getInstance.error: ", error) } Compatibility Control: API LEVEL 2 - Functionality added. ``` -------------------------------- ### Lifecycle and Navigation API Documentation Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/interfaces/_internal_.CameraPermissionResponse Documentation for managing application lifecycle and navigation, including native navigation and back handling. ```APIDOC Navigation: - Class for handling application navigation. NativeNavigation: - Class for performing native navigation actions. NavigationConfig: - Configuration options for navigation. OpenInput: - Input parameters for opening screens or views. CloseOptions: - Options for closing screens or views. NativeOpen: - Structure for native navigation opening parameters. BackHandler: - Type definition for handling back button presses. ``` -------------------------------- ### Check Notification Permission Example Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.Notification Example JavaScript code demonstrating how to call the `checkPermission` method of the Notification class to get the current notification permission status. ```javascript let checkPermissionResult = await Eitri.notification.checkPermission() console.log(checkPermissionResult) /* Example output from this console.log: { status: "DENIED" } */ ``` -------------------------------- ### Device API Documentation Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/interfaces/_internal_.RecordedNavigation Comprehensive documentation for Device-related functionalities, including camera, clipboard, keyboard, sharing, system information, haptics, and screen management. Includes enums for permission statuses and event keys. ```APIDOC CameraPermissionStatus: // Enum representing the status of camera permissions. // Possible values are not detailed in the provided index. KeyboardChangeEventKeys: // Enum representing keys associated with keyboard change events. // Possible values are not detailed in the provided index. Deeplink: // Class for handling deep linking operations. // Methods and properties are not detailed in the provided index. Clipboard: // Class for interacting with the device's clipboard. // Methods and properties are not detailed in the provided index. Camera: // Class for accessing and controlling the device's camera. // Methods and properties are not detailed in the provided index. Keyboard: // Class for managing keyboard interactions and events. // Methods and properties are not detailed in the provided index. Share: // Class for sharing content to other applications or services. // Methods and properties are not detailed in the provided index. System: // Class for accessing system-level information and functionalities. // Methods and properties are not detailed in the provided index. Haptic: // Class for triggering haptic feedback on the device. // Methods and properties are not detailed in the provided index. Screen: // Class for interacting with the device's screen properties. // Methods and properties are not detailed in the provided index. Device: // Represents the device context and provides access to various device functionalities. // Methods and properties are not detailed in the provided index. AppConfigs: // Configuration settings related to the application. // Fields and types are not detailed in the provided index. DeeplinkInput: // Input structure for deep linking operations. // Fields and types are not detailed in the provided index. ClipboardTextInput: // Input structure for clipboard text operations. // Fields and types are not detailed in the provided index. CameraPermissionResponse: // Response structure for camera permission requests. // Fields and types are not detailed in the provided index. KeyboardChangeEvent: // Event object for keyboard change notifications. // Fields and types are not detailed in the provided index. ShareLinkInput: // Input structure for sharing links. // Fields and types are not detailed in the provided index. ShareTextInput: // Input structure for sharing text. // Fields and types are not detailed in the provided index. EitriAppData: // Data structure containing application-specific information. // Fields and types are not detailed in the provided index. ApplicationData: // General data structure for application information. // Fields and types are not detailed in the provided index. ``` -------------------------------- ### WebFlow Class and start Method API Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.WebFlow Documentation for the WebFlow class, detailing its purpose, limitations, and the 'start' method. The 'start' method initiates a web flow, accepting input parameters like start URL, stop pattern, and allowed domains, and returns a promise with the flow's output. ```APIDOC Class WebFlow Description: Web interface that allows users to navigate through a complex web flow. Limitations: Android limitations: only available for Android Pie (API 28) or higher. Usage: Can be used for corporate logins and other complex web flows involving multiple redirects in an OAuth flow. The web flow interface has an internet browser that can be controlled by the user while respecting restrictions defined here. Every navigation is recorded and can be accessed after the web flow is finished. Notes: Data persistence inside a web flow is enabled in modern Operating Systems (Android 9+, iOS 17+). This means that the web flow will remember the state of the browser and the cookies between navigations and app sessions. Methods: start(args): Promise<[WebFlowOutput]> Description: Starts a web flow. Compatibility Control: + API LEVEL `23` - Functionality added + API LEVEL `25` - Adds support for keepLoadingScreenUntilDomainChange Parameters: + args: [WebFlowInput] - startUrl: string - The initial URL to load. - stopPattern: string - A pattern to detect when the flow should stop. - allowedDomains: string[] - A list of domains that are permitted during the flow. Returns: Promise<[WebFlowOutput]> - A promise that resolves with the output of the web flow. Error Conditions: None explicitly mentioned, but flow might fail if URLs are invalid or domains are restricted. ``` ```javascript const userNavigation = await Eitri.webFlow.start({ "startUrl": "https://domain/startLogin", "stopPattern": "/oauth/finish", "allowedDomains": ["www.google.com"] }) ``` -------------------------------- ### System.openAppSettings Method Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.System Opens the application's preferences in the system settings. This asynchronous method returns a Promise that resolves to void. Compatibility requires API Level 9. ```APIDOC System.openAppSettings Signature: openAppSettings(): Promise Description: Open the app's preferences in the system settings. Compatibility: - API LEVEL `9` - Functionality added Returns: Promise ``` -------------------------------- ### Lifecycle API Documentation Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/interfaces/_internal_.RecordedNavigation Documentation for Lifecycle management, including navigation, native navigation, configuration, and handlers for back button events. ```APIDOC Navigation: // Class for managing application navigation. // Methods and properties are not detailed in the provided index. NativeNavigation: // Class for handling native navigation operations. // Methods and properties are not detailed in the provided index. NavigationConfig: // Configuration options for navigation. // Fields and types are not detailed in the provided index. OpenInput: // Input structure for opening screens or views. // Fields and types are not detailed in the provided index. CloseOptions: // Options for closing screens or views. // Fields and types are not detailed in the provided index. NativeOpen: // Structure for native navigation opening actions. // Fields and types are not detailed in the provided index. BackHandler: // Type definition for handling back button events. // Signature and behavior are not detailed in the provided index. ``` -------------------------------- ### Vibrate Device Example Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.Haptic Example of how to trigger haptic feedback using the Eitri library's haptic module. ```javascript await Eitri.haptic.vibrate() ``` -------------------------------- ### Device API Documentation Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/interfaces/_internal_.CameraPermissionResponse Comprehensive API documentation for device-related functionalities, including camera, clipboard, deep linking, keyboard, sharing, and system information. ```APIDOC CameraPermissionStatus: - Enum for camera permission status. KeyboardChangeEventKeys: - Enum for keys related to keyboard change events. Deeplink: - Class for handling deep linking operations. Clipboard: - Class for interacting with the device's clipboard. Camera: - Class for accessing and controlling the device camera. Keyboard: - Class for managing keyboard interactions. Share: - Class for sharing content to other applications. System: - Class for accessing system-level information and settings. Haptic: - Class for triggering haptic feedback. Screen: - Class for interacting with the device screen. Device: - Represents the overall device context and capabilities. AppConfigs: - Configuration settings for the application. DeeplinkInput: - Input parameters for deep linking. ClipboardTextInput: - Input for text operations on the clipboard. CameraPermissionResponse: - Response object for camera permission requests. KeyboardChangeEvent: - Event object for keyboard state changes. ShareLinkInput: - Input for sharing a link. ShareTextInput: - Input for sharing text. EitriAppData: - Application data specific to the Eitri framework. ApplicationData: - General application data structure. ``` -------------------------------- ### Request Notification Permission Example Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.Notification Example JavaScript code demonstrating how to call the `requestPermission` method of the Notification class to prompt the user for notification permissions. ```javascript let requestPermissionResult = await Eitri.notification.requestPermission() console.log(requestPermissionResult) /* Example output from this console.log: { status: "DENIED" } */ ``` -------------------------------- ### Cancel Local Push Notification Example Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.Notification Provides an example of how to cancel a specific pending local push notification by its unique identifier using the Eitri library. ```javascript await Eitri.notification.cancelLocalPush({ id: "1" }); ``` -------------------------------- ### Lifecycle API Documentation Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/interfaces/_internal_.DeeplinkInput Documentation for Lifecycle management, including navigation, native navigation, configuration, and handlers for back button events. ```APIDOC Navigation: // Class for managing application navigation. // Methods and properties are not detailed in the provided index. NativeNavigation: // Class for handling native navigation operations. // Methods and properties are not detailed in the provided index. NavigationConfig: // Configuration options for navigation. // Fields and types are not detailed in the provided index. OpenInput: // Input structure for opening screens or views. // Fields and types are not detailed in the provided index. CloseOptions: // Options for closing screens or views. // Fields and types are not detailed in the provided index. NativeOpen: // Structure for native navigation opening actions. // Fields and types are not detailed in the provided index. BackHandler: // Type definition for handling back button events. // Signature and behavior are not detailed in the provided index. ``` -------------------------------- ### Request Schedule Permission Example Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.Notification Example JavaScript code demonstrating how to call the `requestSchedulePermission` method of the Notification class to request permission for scheduling local notifications. ```javascript let requestPermissionResult = await Eitri.notification.requestSchedulePermission() console.log(requestPermissionResult) /* Example output from this console.log: { status: "DENIED" } */ ``` -------------------------------- ### Device API Documentation Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/interfaces/_internal_.DeeplinkInput Comprehensive documentation for Device-related functionalities, including camera, clipboard, keyboard, sharing, system information, haptics, and screen management. Includes enums for permission statuses and event keys. ```APIDOC CameraPermissionStatus: // Enum representing the status of camera permissions. // Possible values are not detailed in the provided index. KeyboardChangeEventKeys: // Enum representing keys associated with keyboard change events. // Possible values are not detailed in the provided index. Deeplink: // Class for handling deep linking operations. // Methods and properties are not detailed in the provided index. Clipboard: // Class for interacting with the device's clipboard. // Methods and properties are not detailed in the provided index. Camera: // Class for accessing and controlling the device's camera. // Methods and properties are not detailed in the provided index. Keyboard: // Class for managing keyboard interactions and events. // Methods and properties are not detailed in the provided index. Share: // Class for sharing content to other applications or services. // Methods and properties are not detailed in the provided index. System: // Class for accessing system-level information and functionalities. // Methods and properties are not detailed in the provided index. Haptic: // Class for triggering haptic feedback on the device. // Methods and properties are not detailed in the provided index. Screen: // Class for interacting with the device's screen properties. // Methods and properties are not detailed in the provided index. Device: // Represents the device context and provides access to various device functionalities. // Methods and properties are not detailed in the provided index. AppConfigs: // Configuration settings related to the application. // Fields and types are not detailed in the provided index. DeeplinkInput: // Input structure for deep linking operations. // Fields and types are not detailed in the provided index. ClipboardTextInput: // Input structure for clipboard text operations. // Fields and types are not detailed in the provided index. CameraPermissionResponse: // Response structure for camera permission requests. // Fields and types are not detailed in the provided index. KeyboardChangeEvent: // Event object for keyboard change notifications. // Fields and types are not detailed in the provided index. ShareLinkInput: // Input structure for sharing links. // Fields and types are not detailed in the provided index. ShareTextInput: // Input structure for sharing text. // Fields and types are not detailed in the provided index. EitriAppData: // Data structure containing application-specific information. // Fields and types are not detailed in the provided index. ApplicationData: // General data structure for application information. // Fields and types are not detailed in the provided index. ``` -------------------------------- ### Check Schedule Permission Example Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.Notification Example JavaScript code demonstrating how to call the `checkSchedulePermission` method of the Notification class to check the status for scheduling local notifications. ```javascript let checkPermissionResult = await Eitri.notification.checkSchedulePermission() console.log(checkPermissionResult) /* Example output from this console.log: { status: "DENIED" } */ ``` -------------------------------- ### Eitri Breaking Change Example Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/changelog Illustrates a breaking change in method signature contracts from positional to named parameters. ```APIDOC Breaking change on method signature contract (positional to named) - Example: - Before: `myMethod(arg1, arg2)` - After: `myMethod({ arg1, arg2 })` - Introduced in v2.0.0. ``` -------------------------------- ### Lifecycle API Documentation Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/modules/_internal_ Manages application lifecycle events and navigation. ```APIDOC Lifecycle: // Represents the Lifecycle module for managing app state and navigation. Navigation: // Class for handling application navigation. // Methods: // open(input: OpenInput): Promise // Navigates to a new screen or view. // Parameters: // input: OpenInput - Configuration for navigation. // - screen: string - The identifier of the screen to open. // - params?: Record - Optional parameters to pass to the screen. // - replace?: boolean - Whether to replace the current screen in the history. // Returns: Promise // close(options?: CloseOptions): Promise // Closes the current screen or view. // Parameters: // options?: CloseOptions - Optional configuration for closing. // - animated?: boolean - Whether the closing animation should be used. // Returns: Promise // goBack(): void // Navigates back to the previous screen. NativeNavigation: // Class for performing native navigation actions. // Methods: // open(input: NativeOpen): Promise // Opens a native screen or URL. // Parameters: // input: NativeOpen - Configuration for native navigation. // - url: string - The URL or screen identifier to open. // - params?: Record - Optional parameters. // Returns: Promise NavigationConfig: // Interface for configuring navigation behavior. // Properties: // // (Properties not detailed in the provided text) OpenInput: // Interface for input parameters when opening a screen. // Properties: // screen: string // params?: Record // replace?: boolean CloseOptions: // Interface for options when closing a screen. // Properties: // animated?: boolean NativeOpen: // Interface for input parameters for native navigation. // Properties: // url: string // params?: Record BackHandler: // Type definition for a back handler function. // Signature: () => boolean ``` -------------------------------- ### Eitri WebFlow API Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/changelog Manages web flow operations, including starting new flows and controlling loading screen behavior. ```APIDOC Eitri.webFlow.start(keepLoadingScreenUntilDomainChange?: boolean) - Description: Initiates a web flow. Optionally keeps the loading screen active until the domain changes. - Parameters: - keepLoadingScreenUntilDomainChange: Optional. If true, the loading screen persists across domain changes. - Returns: Promise or void. ``` -------------------------------- ### Device and System Interactions Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.FileSystem Enables interaction with device hardware and system features, such as camera, clipboard, haptics, screen management, and system information. ```APIDOC Device: Clipboard: getText(input: ClipboardTextInput) Retrieves text from the clipboard. Parameters: input: ClipboardTextInput - Configuration for clipboard text retrieval. setText(input: ClipboardTextInput) Sets text to the clipboard. Parameters: input: ClipboardTextInput - Configuration for setting clipboard text. Camera: requestPermission(input: CameraPermissionResponse) Requests camera permission. Parameters: input: CameraPermissionResponse - Response object for camera permission request. takePicture(input: CameraPermissionResponse) Takes a picture using the device camera. Parameters: input: CameraPermissionResponse - Response object for camera permission request. Keyboard: addListener(input: KeyboardChangeEvent) Adds a listener for keyboard events. Parameters: input: KeyboardChangeEvent - Event object for keyboard changes. removeListener(input: KeyboardChangeEvent) Removes a listener for keyboard events. Parameters: input: KeyboardChangeEvent - Event object for keyboard changes. Share: link(input: ShareLinkInput) Shares a link. Parameters: input: ShareLinkInput - Configuration for sharing a link. text(input: ShareTextInput) Shares text. Parameters: input: ShareTextInput - Configuration for sharing text. System: getAppData() Retrieves application data. getApplicationData() Retrieves application data. Haptic: vibrate(duration: number) Triggers a haptic vibration. Parameters: duration: The duration of the vibration in milliseconds. Screen: getOrientation() Gets the current screen orientation. setOrientation(orientation: string) Sets the screen orientation. Parameters: orientation: The desired screen orientation (e.g., 'portrait', 'landscape'). ``` -------------------------------- ### Geolocation Module Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/enums/_internal_.EventBusCommonEvents Handles location services, including requesting permissions, getting current location, and managing location precision. ```APIDOC GeolocationPrecisionType: Description: Enum for geolocation precision levels. Values: - HIGH - BALANCED - LOW GeolocationStatus: Description: Enum for geolocation status. Values: - GRANTED - DENIED - NOT_DETERMINED - RESTRICTED Geolocation: Description: Manages device location. Methods: - requestPermission(input: GeolocationPermissionInput): Promise - input: GeolocationPermissionInput - Configuration for permission request. - Returns: Promise resolving with permission status. - getCurrentPosition(input: GeolocationRequestOutput): Promise - input: GeolocationRequestOutput - Configuration for location request. - Returns: Promise resolving with current location details. GeolocationPermissionInput: Description: Input for requesting geolocation permission. Properties: - precision: GeolocationPrecisionType - The desired precision level. GeolocationPermissionOutput: Description: Output from a geolocation permission request. Properties: - status: GeolocationStatus - The status of the permission. GeolocationRequestOutput: Description: Input for requesting current geolocation. Properties: - enableHighAccuracy: boolean - Whether to enable high accuracy. - timeout: number - Timeout in milliseconds. - maximumAge: number - Maximum age of cached location. - precision: GeolocationPrecisionType - The desired precision level. GeolocationDetails: Description: Details of the current geolocation. Properties: - latitude: number - The latitude coordinate. - longitude: number - The longitude coordinate. - accuracy: number - The accuracy of the location in meters. - altitude: number (optional) - The altitude in meters. - speed: number (optional) - The speed in meters per second. - timestamp: number - The timestamp of the location fix. ``` -------------------------------- ### Lifecycle and Navigation Management Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.FileSystem Handles application lifecycle events and navigation within the application, including native navigation and back button handling. ```APIDOC Lifecycle: Navigation: open(input: OpenInput) Navigates to a new screen. Parameters: input: OpenInput - Configuration for opening a new screen. close(options: CloseOptions) Closes the current screen. Parameters: options: CloseOptions - Options for closing the screen. NativeNavigation: open(input: NativeOpen) Performs native navigation. Parameters: input: NativeOpen - Configuration for native navigation. BackHandler: register(callback: Function) Registers a callback for the back button press. Parameters: callback: The function to execute when the back button is pressed. unregister(callback: Function) Unregisters a back button callback. Parameters: callback: The callback function to unregister. ``` -------------------------------- ### Environment API Documentation Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.AppStore Provides access to environment-specific configurations and settings. ```APIDOC Environment: // Methods and properties for environment configuration are expected here. // Specific details not provided in the input text. ``` -------------------------------- ### EventBus API Documentation Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.EventBus Comprehensive documentation for the EventBus class methods, including subscribe, clear, clearChannel, and publish. Details parameters, return values, and usage examples. ```APIDOC EventBus Class Methods subscribe(input: SubscribeInput): void - Subscribes to notifications on a specified channel, providing a callback function to handle received messages. - Parameters: - input: An object of type SubscribeInput. - channel: The identifier of the channel to subscribe to. - callback: A function that will be called when a message is received on the channel. - Returns: void - Example: ```javascript Eitri.eventBus.subscribe({ channel: "myChannel", callback: (data) => { // Handle the received data here console.log('Received data:', data); } }); ``` - Compatibility: API LEVEL `7` - Functionality added. clear(input: ClearInput): void - Unsubscribes a callback function from receiving notifications on a specific channel. - Parameters: - input: An object of type ClearInput. - Returns: void - Compatibility: API LEVEL `7` - Functionality added. clearChannel(channel: string): void - Clears all listeners subscribed to a specific channel. - Parameters: - channel: string - The identifier of the channel for which to clear all listeners. - Returns: void - Compatibility: API LEVEL `7` - Functionality added. publish(input: PublishInput): void - Publishes data to a specific channel, notifying all subscribed listeners. - Parameters: - input: An object of type PublishInput. - channel: The identifier of the channel to publish to. - data: The data payload to send. - Returns: void - Example: ```javascript Eitri.eventBus.publish({ channel: "myChannel", data: { "a": 1 } }); ``` - Compatibility: API LEVEL `7` - Functionality added. ``` -------------------------------- ### Biometrics Class Methods Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.Biometrics Provides methods to check the availability of biometric authentication and to perform biometric authentication on the device. Includes details on parameters, return values, and usage examples. ```APIDOC Biometrics: checkStatus(): Promise Checks if biometrics are registered on the device. Example: let biometricStatus = await Eitri.biometrics.checkStatus() console.log(biometricStatus) /* Example output from this console.log: { status: "AVAILABLE" } */ Compatibility Control: + API LEVEL `10` - Functionality added Returns: Promise authenticate(authenticateInput): Promise Authenticate using biometrics. Example: let result = await Eitri.biometrics.authenticate({ android: { promptInfo: { title: "Login", subtitle: "Validate your credentials.", cancelButton: "Cancel" } }, ios: { authenticationReason: "Authenticate using your biometrics." } }) console.log(result) /* Example output from this console.log: { type: "FaceID", result: "FAILED", details: "USER_CANCEL"} */ Compatibility Control: + API LEVEL `10` - Functionality added Parameters: + authenticateInput: BiometricAuthenticateInput Returns: Promise ``` -------------------------------- ### App Store Integration Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.FileSystem Provides functionality related to the App Store, specifically for requesting reviews. ```APIDOC App Store: requestReview(input: RequestReviewInput) Requests a review from the user in the App Store. Parameters: input: RequestReviewInput - Configuration for requesting a review. ``` -------------------------------- ### Device API Documentation Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/modules/_internal_ Provides utilities for interacting with device hardware and system information. ```APIDOC Device: // Represents the Device module for accessing device-specific features. CameraPermissionStatus: // Enum for the status of camera permissions. // Values: // GRANTED // DENIED // BLOCKED KeyboardChangeEventKeys: // Enum for keys related to keyboard events. // Values: // KEYBOARD_WILL_SHOW // KEYBOARD_DID_SHOW // KEYBOARD_WILL_HIDE // KEYBOARD_DID_HIDE Deeplink: // Class for handling deep linking functionality. // Methods: // getInitialURL(): Promise // Gets the initial deep link URL that launched the application. // Returns: Promise // addEventListener(handler: (url: string) => void): () => void // Adds a listener for incoming deep links. // Parameters: // handler: (url: string) => void - Callback function to handle the URL. // Returns: () => void - Function to remove the event listener. Clipboard: // Class for interacting with the device's clipboard. // Methods: // getString(): Promise // Retrieves the text content from the clipboard. // Returns: Promise // setString(input: ClipboardTextInput): Promise // Sets the text content of the clipboard. // Parameters: // input: ClipboardTextInput - The text to set. // - text: string // Returns: Promise Camera: // Class for accessing and controlling the device camera. // Methods: // requestPermission(): Promise // Requests camera permission from the user. // Returns: Promise // - status: CameraPermissionStatus // getPermissionStatus(): Promise // Gets the current status of camera permission. // Returns: Promise // - status: CameraPermissionStatus Keyboard: // Class for managing keyboard behavior. // Methods: // addListener(event: KeyboardChangeEventKeys, handler: (event: KeyboardChangeEvent) => void): () => void // Adds a listener for keyboard events. // Parameters: // event: KeyboardChangeEventKeys - The type of keyboard event to listen for. // handler: (event: KeyboardChangeEvent) => void - Callback function. // Returns: () => void - Function to remove the listener. // dismiss(): void // Dismisses the keyboard. Share: // Class for sharing content to other applications. // Methods: // shareLink(input: ShareLinkInput): Promise // Shares a URL. // Parameters: // input: ShareLinkInput - Configuration for sharing a link. // - url: string // - message?: string // Returns: Promise // shareText(input: ShareTextInput): Promise // Shares plain text. // Parameters: // input: ShareTextInput - Configuration for sharing text. // - text: string // - message?: string // Returns: Promise System: // Class for accessing system-level information and actions. // Methods: // getAppData(): Promise // Retrieves application-specific data. // Returns: Promise // - appName: string // - appVersion: string // - bundleId: string // getDeviceName(): Promise // Gets the name of the device. // Returns: Promise // getOsVersion(): Promise // Gets the operating system version. // Returns: Promise // getPlatform(): Promise // Gets the device platform (e.g., 'ios', 'android'). // Returns: Promise Haptic: // Class for triggering haptic feedback. // Methods: // trigger(type: 'impact' | 'notification' | 'selection', options?: { style?: 'light' | 'medium' | 'heavy' }): void // Triggers haptic feedback. // Parameters: // type: 'impact' | 'notification' | 'selection' - The type of haptic feedback. // options?: { style?: 'light' | 'medium' | 'heavy' } - Optional style for impact feedback. Screen: // Class for interacting with screen properties. // Methods: // getBrightness(): Promise // Gets the current screen brightness. // Returns: Promise (0.0 to 1.0) // setBrightness(brightness: number): Promise // Sets the screen brightness. // Parameters: // brightness: number - The desired brightness level (0.0 to 1.0). // Returns: Promise // isLocked(): Promise // Checks if the screen is locked. // Returns: Promise Device: // Class providing general device information. // Methods: // getModel(): Promise // Gets the device model name. // Returns: Promise // getManufacturer(): Promise // Gets the device manufacturer. // Returns: Promise // getUniqueId(): Promise // Gets a unique identifier for the device. // Returns: Promise AppConfigs: // Interface for application configuration data. // Properties: // appName: string // appVersion: string // bundleId: string DeeplinkInput: // Interface for deep link related inputs (currently unused in provided structure). ClipboardTextInput: // Interface for text input to the clipboard. // Properties: // text: string CameraPermissionResponse: // Interface for camera permission status. // Properties: // status: CameraPermissionStatus KeyboardChangeEvent: // Interface for keyboard event data. // Properties: // keyboardHeight: number // duration: number // isKeyboardVisible: boolean ShareLinkInput: // Interface for sharing a link. // Properties: // url: string // message?: string ShareTextInput: // Interface for sharing text. // Properties: // text: string // message?: string EitriAppData: // Interface for Eitri-specific application data. // Properties: // appName: string // appVersion: string // bundleId: string ApplicationData: // Interface for general application data. // Properties: // appName: string // appVersion: string // bundleId: string ``` -------------------------------- ### Send Local Push Notification Example Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/classes/_internal_.Notification Demonstrates how to send a local push notification using the Eitri library. It includes checking and requesting necessary notification and scheduling permissions before sending the notification. ```javascript try { let notificationPermission = await Eitri.notification.checkPermission(); if (notificationPermission.status !== "GRANTED") { // prepare user for answering the permission request const status = await Eitri.notification.requestPermission(); if (status !== "GRANTED") { // notify user that they need to enable notifications throw new Error("Notification permission denied"); } } let schedulePermission = await Eitri.notification.checkSchedulePermission(); if (schedulePermission.status !== "GRANTED") { // prepare user for answering the permission request const status = await Eitri.notification.requestSchedulePermission(); if (status !== "GRANTED") { // notify user that they need to enable notification scheduling throw new Error("Schedule permission denied"); } schedulePermission.status = status; } await Eitri.notification.sendLocalPush({ id: "1", title: "TITLE", message: "MESSAGE", delayInMilliseconds: 1000 * 10, deeplink: "eitri://run/eitri-doctor" }); } catch(error) { console.log("sendLocalPush.error: ", error) } ``` -------------------------------- ### WebFlowInput Interface Configuration Source: https://cdn.83io.com.br/library/eitri-bifrost/doc/latest/interfaces/_internal_.WebFlowInput Defines the configuration options for controlling web flow navigation. This interface specifies parameters such as the starting URL, patterns to stop navigation, allowed domains, navigation limits, and JavaScript execution. ```APIDOC Interface WebFlowInput: Properties: startUrl: string The URL to start navigation. stopPattern: string A regex pattern to stop web flow navigation. Navigation will be stopped when the URL matches this regex. allowedDomains: string[] A list of domains that are allowed to be accessed during the web flow. If the user tries to navigate to a domain not in this list, navigation will be stopped. If this list is empty, no domain will be allowed. Example: allowedDomains: ["domain1.com", "domain2.tech"] allowedDomains: ["*"] // allows all domains. Use with caution. maxNavigationLimit?: number The maximum number of navigations allowed before stopping the web flow. If the navigation count reaches this limit, the web flow will be stopped. Default value: 10 onLoadJsScript?: string A js script to be executed when the startUrl completes loading. Example: onLoadJsScript: "document.querySelector('button.login').click();" keepLoadingScreenUntilDomainChange?: boolean Shows a loading screen until the browser navigates away from the initial domain. This is useful to prevent user interaction while the web flow is loading. Use cases: Login with Google, Login with Facebook, etc. The loading screen remains visible until the user is redirected to a different domain, typically triggered by onLoadJsScript. Default value: false ```