Class AngularNativeConfig
-
- All Implemented Interfaces:
public final class AngularNativeConfig
-
-
Field Summary
Fields Modifier and Type Field Description private final PathConfigurationpathConfigurationprivate List<BridgeComponentFactory<?, BridgeComponent<?>>>registeredBridgeComponentFactoriesprivate BridgeComponentJsonConverterjsonConverterprivate OfflineRequestHandlerofflineRequestHandlerprivate BooleandebugLoggingEnabledprivate BooleanwebViewDebuggingEnabledprivate Function1<Context, AngularNativeWebView>makeCustomWebViewprivate StringapplicationUserAgentPrefixprivate final StringuserAgent
-
Method Summary
Modifier and Type Method Description final PathConfigurationgetPathConfiguration()The path configuration that defines your navigation rules. final List<BridgeComponentFactory<?, BridgeComponent<?>>>getRegisteredBridgeComponentFactories()final UnitsetRegisteredBridgeComponentFactories(List<BridgeComponentFactory<?, BridgeComponent<?>>> registeredBridgeComponentFactories)final BridgeComponentJsonConvertergetJsonConverter()Set a custom JSON converter to easily decode Message.dataJson to a data object in received messages and to encode a data object back to json to reply with a custom message back to the web. final UnitsetJsonConverter(BridgeComponentJsonConverter jsonConverter)Set a custom JSON converter to easily decode Message.dataJson to a data object in received messages and to encode a data object back to json to reply with a custom message back to the web. final OfflineRequestHandlergetOfflineRequestHandler()Experimental: API may be removed, not ready for production use. final UnitsetOfflineRequestHandler(OfflineRequestHandler offlineRequestHandler)Experimental: API may be removed, not ready for production use. final BooleangetDebugLoggingEnabled()Enables/disables debug logging. final UnitsetDebugLoggingEnabled(Boolean debugLoggingEnabled)Enables/disables debug logging. final BooleangetWebViewDebuggingEnabled()Enables/disables debugging of web contents loaded into WebViews. final UnitsetWebViewDebuggingEnabled(Boolean webViewDebuggingEnabled)Enables/disables debugging of web contents loaded into WebViews. final Function1<Context, AngularNativeWebView>getMakeCustomWebView()Called whenever a new WebView instance needs to be (re)created. final UnitsetMakeCustomWebView(Function1<Context, AngularNativeWebView> makeCustomWebView)Called whenever a new WebView instance needs to be (re)created. final StringgetApplicationUserAgentPrefix()Set a custom user agent application prefix for every WebView instance. final UnitsetApplicationUserAgentPrefix(String applicationUserAgentPrefix)Set a custom user agent application prefix for every WebView instance. final StringgetUserAgent()Gets the user agent that the library builds to identify the app and its registered bridge components. final StringuserAgentWithWebViewDefault(Context context)Gets the full user agent that is used for every WebView instance. -
-
Method Detail
-
getPathConfiguration
final PathConfiguration getPathConfiguration()
The path configuration that defines your navigation rules.
-
getRegisteredBridgeComponentFactories
final List<BridgeComponentFactory<?, BridgeComponent<?>>> getRegisteredBridgeComponentFactories()
-
setRegisteredBridgeComponentFactories
final Unit setRegisteredBridgeComponentFactories(List<BridgeComponentFactory<?, BridgeComponent<?>>> registeredBridgeComponentFactories)
-
getJsonConverter
final BridgeComponentJsonConverter getJsonConverter()
Set a custom JSON converter to easily decode Message.dataJson to a data object in received messages and to encode a data object back to json to reply with a custom message back to the web.
-
setJsonConverter
final Unit setJsonConverter(BridgeComponentJsonConverter jsonConverter)
Set a custom JSON converter to easily decode Message.dataJson to a data object in received messages and to encode a data object back to json to reply with a custom message back to the web.
-
getOfflineRequestHandler
final OfflineRequestHandler getOfflineRequestHandler()
Experimental: API may be removed, not ready for production use.
-
setOfflineRequestHandler
final Unit setOfflineRequestHandler(OfflineRequestHandler offlineRequestHandler)
Experimental: API may be removed, not ready for production use.
-
getDebugLoggingEnabled
final Boolean getDebugLoggingEnabled()
Enables/disables debug logging. This should be disabled in production environments. Disabled by default.
Important: You should not enable debug logging in production release builds.
-
setDebugLoggingEnabled
final Unit setDebugLoggingEnabled(Boolean debugLoggingEnabled)
Enables/disables debug logging. This should be disabled in production environments. Disabled by default.
Important: You should not enable debug logging in production release builds.
-
getWebViewDebuggingEnabled
final Boolean getWebViewDebuggingEnabled()
Enables/disables debugging of web contents loaded into WebViews. Disabled by default.
Important: You should not enable debugging in production release builds.
-
setWebViewDebuggingEnabled
final Unit setWebViewDebuggingEnabled(Boolean webViewDebuggingEnabled)
Enables/disables debugging of web contents loaded into WebViews. Disabled by default.
Important: You should not enable debugging in production release builds.
-
getMakeCustomWebView
final Function1<Context, AngularNativeWebView> getMakeCustomWebView()
Called whenever a new WebView instance needs to be (re)created. Provide your own implementation and subclass AngularNativeWebView if you need custom behaviors.
-
setMakeCustomWebView
final Unit setMakeCustomWebView(Function1<Context, AngularNativeWebView> makeCustomWebView)
Called whenever a new WebView instance needs to be (re)created. Provide your own implementation and subclass AngularNativeWebView if you need custom behaviors.
-
getApplicationUserAgentPrefix
final String getApplicationUserAgentPrefix()
Set a custom user agent application prefix for every WebView instance. The library will automatically append a substring to your prefix which includes:
"AngularNative Native Android; WebNavigation Native Android;"
"bridge-components: your bridge components;"
The WebView's default Chromium user agent string
-
setApplicationUserAgentPrefix
final Unit setApplicationUserAgentPrefix(String applicationUserAgentPrefix)
Set a custom user agent application prefix for every WebView instance. The library will automatically append a substring to your prefix which includes:
"AngularNative Native Android; WebNavigation Native Android;"
"bridge-components: your bridge components;"
The WebView's default Chromium user agent string
-
getUserAgent
final String getUserAgent()
Gets the user agent that the library builds to identify the app and its registered bridge components. This includes:
Your (optional) custom
applicationUserAgentPrefix"AngularNative Native Android; WebNavigation Native Android;"
"bridge-components: your bridge components;"
-
userAgentWithWebViewDefault
final String userAgentWithWebViewDefault(Context context)
Gets the full user agent that is used for every WebView instance. This includes:
Your (optional) custom
applicationUserAgentPrefix"AngularNative Native Android; WebNavigation Native Android;"
"bridge-components: your bridge components;"
The WebView's default Chromium user agent string
-
-
-
-