Portal Manager
object PortalManager
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.
Example usage (kotlin):
PortalManager.newPortal("my_portal")
.addPlugin(MyCapacitorPlugin::class.java)
.setPortalFragmentType(MyFadeInOutPortalFragment::class.java)
.setInitialContext(mapOf("myVariableFromAndroid" to 42))
.setStartDir("web_app")
.create()
Content copied to clipboard
Example usage (java):
PortalManager.newPortal("my_portal")
.addPlugin(MyCapacitorPlugin.class)
.setPortalFragmentType(MyFadeInOutPortalFragment.class)
.setInitialContext(Map.of("myVariableFromAndroid", 42))
.setStartDir("web_app")
.create();
Content copied to clipboard
Functions
Link copied to clipboard
Check if Portals has been successfully registered with a valid key.
Link copied to clipboard
A helper function to build portal classes and add them to the manager. Classes built with newPortal are added to the PortalManager automatically.
Link copied to clipboard
Removes the Portal from the Portal Manager. The Portal will be returned if it was present. If not, null is returned. Note: if the Portal uses Live Updates and registered an instance on creation, the Live Update instance for the app is not removed.