Package-level declarations

Types

Link copied to clipboard
class AssetMap(val name: String, val virtualPath: String, val path: String)

A class representing a collection of assets to be used by one or more Portals.

Link copied to clipboard

This class is used to load the server URL and Capacitor configuration from the assets folder when the app is being run in developer mode with the Portals CLI.

Link copied to clipboard
class Portal(val name: String)

A class representing a Portal that contains information about the web content to load and any associated plugins used by the Portal. It is discouraged to use this class directly to create a Portal and instead use PortalBuilder or PortalManager to construct a new instance.

Link copied to clipboard
class PortalBuilder(val name: String)

A class used to create Portal instances. It follows a Builder Pattern and can be used in situations where you want to programmatically create a Portal at runtime instead of using one directly in an XML layout.

Link copied to clipboard

An Android Fragment class containing an instance of a Portal to load in a web view supported by Capacitor.

Link copied to clipboard

A class used to create and manage Portal instances. It follows a Singleton Pattern to allow access to any ./portal from anywhere in the application.

Link copied to clipboard
annotation class PortalMethod(val topic: String = "")

An Annotation class used to create message receiver functions with the PortalsPlugin. A function annotated with this class can be triggered by using the Portals.sendMessage() with the message parameter on the web code matching the function name in the native code.

Link copied to clipboard
class PortalsPlugin(pubSub: PortalsPubSub = PortalsPubSub.shared) : Plugin

A special Capacitor Plugin within the Portals library that allows for bi-directional communication between Android and web code. It is loaded with every Portal automatically and does not need to be added like other plugins if the default behavior is desired.

Link copied to clipboard
Link copied to clipboard
class PortalsRouteProcessor(val context: Context, val assetMaps: <Error class: unknown class><String, AssetMap>) : RouteProcessor

A class used by PortalFragment to provide instructions to the Capacitor router to load shared assets.

Link copied to clipboard

A class that provides the ability to integrate Portals into XML Layout or Jetpack Compose files. PortalView extends FrameLayout and contains a PortalFragment to display the Portal content inside the view. Use this class like any other View class.

Link copied to clipboard
data class SubscriptionResult(val topic: String, val data: Any?, val subscriptionRef: Int)

A class used for messages passed to subscriptions.

Link copied to clipboard
class WebVitals(val callback: (String, WebVitals.Metric, Long) -> Unit) : Plugin

A class providing Web Vitals functionality. When Web Vitals metrics are desired, this class adds JavaScript to the Portals web view to support measuring the performance of the web application.

Functions

Link copied to clipboard

An extension function to convert a JSONObject to a map.