Class EnvProps
- All Implemented Interfaces:
EventListener, IGProp<GProp<?>[]>, IPropCnr, Cloneable
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumCapabilities of a Client.static interfaceThe answer to a passkey ceremony the client ran.static interfaceThe answer to a capability report.static interfaceMakes the options of an autofill: at its start and at each renewal.static final recordWhat the client reported about itself, as the bridge measured it in the client.Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringMapPropThe client environment properties.protected GeoPropsThe Geolocation properties.static final StringThe name of the error of a request that was aborted in the client (AbortError): the autofill of the user name field, when the user took a passkey button instead.static final longThe age at which the options of an autofill are made again and handed to the client: 14 minutes, one before the 15 minutes the server keeps the challenge of an autofill.static final longHow long the client has to report its capabilities: 30 seconds.static final StringThe name of the error of a registration on an authenticator that holds a passkey of the user already (InvalidStateError): no failure of the user's, to be told with a text of its own.static final StringThe name of the error of a ceremony the user cancelled or let time out, or that the authenticator refused (NotAllowedError): the sign-in failed, and nothing is to be handed to the server'sfinish...call.static final StringThe name of the error of a request the client cannot run (NotSupportedError): a client without WebAuthn (iiziRun among them, whose passkeys are SignIn L-12), or an autofill in a client without conditional mediation.static final StringThe name of the error of an autofill whose options could not be made again at its renewal (the reason is in the server log).static final StringThe name of the boolean property the client sets under this environment with the user's Web Analytics consent:trueaccepted,falsedeclined, absent while undecided.protected StringMapPropThe server environment properties.Fields inherited from class PropCnr
EMPTY, EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_IDFields inherited from class GProp
GPDEBUG, PROP_ATTR_STRING_EDITOR_PROP, PROP_ATTR_STRING_ERRORED_NAME, PROP_ATTR_STRING_EXTENDS, PROP_ATTR_STRING_EXTENDS_FINAL, PROP_ATTR_STRING_EXTENDS_PRIVATE, PROP_ATTR_STRING_NULLABLE, PROP_ATTR_STRING_PRIVATE, PROP_ATTR_STRING_PRIVATE_CHANGE_EVENT, PROP_ATTR_STRING_READ_ONLY, PROP_ATTR_STRING_SECRET, PROP_USER_1, PROP_USER_2Fields inherited from interface IGProp
EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_INCLUDE_PRIVATE, EQC_SAVE_FILE, EQC_SAVE_RELEVANT_ONLY, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATEConstructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionprotected voidAdds the predefined properties for this container.booleanAdds a screen orientation listener for the client session.booleanaddScreenSizeListener(IScreenSizeListener listener) Adds a screen size listener for the client session.booleanaddStatusBarTapListener(IStatusBarTapListener listener) Adds a status bar tap listener for the client session.booleanaddUISchemeListener(IUISchemeListener listener) Adds a theme scheme listener for the client session: told when the resolved scheme the client shows changes, by the user, a URL, the OS under auto, or the API.intarmPasskeyAssertion(UIComp comp, String options, EnvProps.IPasskeyCallback callback) Arms a sign-in with a passkey on a component: when the user clicks it, the client callsnavigator.credentials.get()with the options, inside the click - a Browser may refuse a ceremony that is not started by the user's gesture, and a message of the server is none.intarmPasskeyRegistration(UIComp comp, String options, EnvProps.IPasskeyCallback callback) Arms the registration of a passkey on a component: when the user clicks it, the client callsnavigator.credentials.create()with the options, inside the click.booleanAsks the client to show IIZI's Web Analytics consent prompt now, even when a decision is already stored.booleancancelPasskeyRequest(int request) Cancels a passkey request: a component is disarmed, an autofill ends.clone()Clones the environment properties.booleanconfigureStatusBar(StatusBarConfig config) Sets the client sessions status bar to the configuration specified.booleanTells the client that the credentials the user typed in a form container were accepted, so that the password manager of the Browser offers to save them.Gets the user's Web Analytics consent as the client last reported it in this environment (thePN_ANALYTICS_CONSENTboolean, set at connect and at every decision).<TYPE> TYPEgetCachedValue(String name, Class<TYPE> valueClass) Gets a cached property of a certain type.Gets the client environment properties.Gets the client session gyro instance.io.github.mngsk.devicedetector.DetectionGets the cached device detection instance based on the parsed user agent.Gets the device UUID.getDeviceUUID(boolean mustBeValid) Gets the device UUID.doublegetDPR()The device pixel ratio of the client.Gets the Geolocation properties.Gets the language code to use.Gets the client local info class instance.ua_parser.ClientGets the parsed user agent instance.intGets the number of passkey requests that wait for the client.protected voidGets potential references to predefined properties for this container.intGets the current screen height.Gets the current screen orientation.Gets the current screen size.intGets the current screen width.Gets the server environment properties.Gets the speech recognition instance.Gets the speech synthesis instance.Gets the theme scheme the client shows: the shipped theme family and the resolved mode, light or dark, never auto (UISchemes; THEME-DESIGN.md section 4.6).Gets the theme scheme the client was told to show, the mode as chosen: light, dark, auto or auto_dark (UISchemes; order CC-THEME-DARK-V5).Gets the verdict on the web engine this environment's client runs on, as the server computed it when the client session connected, and again at every reconnect.booleanhasClientCapabilities(EnvProps.ClientCapability capability) Checks if a client has the specified capabilities.booleanChecks if iiziRun (Corvova) is present.booleanChecks if screen orientation locking is supported or not.voidonEventSelf(GEvent event) Called when a property event is send to this property.protected voidonInsertProp(GProp<?> aProperty, int index, boolean replace, boolean isCloning, PropMgr propMgr, boolean isMoving) Called when a property is inserted.protected voidCalled when the environment is disposed of, with its root: every passkey request that waits is logged as not completed and dropped; no callback is called.voidonRemoteEvent(RemoteEvent event) Called when a remote property event should be processed by this property.voidCalled once by the property manager after the root has been created from the remote party.registerSession(IClientSessionGyro clientGyro, IRemoteSessionControlListener listener) Assigns the application session control listener.booleanRemoves a screen orientation listener for the client session.booleanremoveScreenSizeListener(IScreenSizeListener listener) Removes a screen size listener for the client session.booleanRemoves a status bar tap listener for the client session.booleanremoveUISchemeListener(IUISchemeListener listener) Removes a theme scheme listener for the client session.intAsks the client what it can do with passkeys - at the start of every sign-in, since a user can set up a platform authenticator at any time.booleansetAnalyticsConsent(boolean granted) Sets the user's Web Analytics consent directly, when the application asked the user itself (the App page's consent choice "the application asks").voidsetCachedValue(String name, Object value) Sets a cached property by name.setLocale(LocaleInfo locale) Changes or sets the LocaleInfo for the environment.voidsetPasskeyTimerEngine(ITimerEngine engine) Sets the timer engine the deadline of a capability report and the renewal of an autofill are registered with, e.g.booleansetScreenOrientation(ScreenOrientation orientation) Locks the screen orientation.voidsetWebEngineStatus(WebEngineStatus status) Sets the verdict on the web engine this environment's client runs on.protected booleanshouldSerializeToXML(int programType) The EnvProps are never written to XML.booleanshowWebEngineWarning(boolean now) Tells the client that its web engine no longer receives security updates, so that it warns its user: the engine and its version, that it stopped receiving security updates, and since when.intstartPasskeyAutofill(EnvProps.IPasskeyOptions options, EnvProps.IPasskeyCallback callback) Starts the autofill of the user name field with passkeys (conditional mediation): the Browser offers the passkeys it holds for the application in the autofill of the field whoseautocompletehas the tokenwebauthn, while the page is open, with no button.booleanUnlocks the screen orientation.Methods inherited from class PropCnr
__transferChildProps, addProp, addProp, addProp2, addProp2, appendPropValue, canRequestFocus, completeVirtualize, containsProp, containsProp, convertLoadedProp, couldRequestFocusIfVirtualized, createCopyOfAtom, createUniqueAtom, createUniqueAtom, createUniqueAtom, createVSReference, doPropEqualsArrayValues, enablePropCommunication, enablePropHashMap, equalsTree, equalsTree, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsContainer, getExtendsError, getExtendsName, getExtendsOverride, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropBaseReference, getPropCnr, getPropCount, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue0, getRetargetedVerifyContainer, getString, getString, getString, getString, getValueClasses, getVSReference, hasFocus, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializePropTree, initializeValue, initPropCnr, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, isPropValueTreeLockNeeded, list, list, logPropNotFound, maybeAddProp, onPropRemoved, onPropTreeInitialized, onReferenceEvent, onVirtualContainerCreated, onVirtualizationCompleted, paramString, prepare, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, replaceProps, requestFocus, requestFocus, requestFocusEx, requestFocusEx, resolveReferences, resolveRuntimeReferences, setBool, setBool, setBool, setBool, setCreateRequiredProp, setExtendsName, setExtendsOverride, setInt, setInt, setInt, setLong, setLong, setLong, setLong, setNumber, setNumber, setNumber, setNumber, setProp, setProp, setProp, setProp2, setProp2, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setString, setString, setString, setString, shouldCreateProps, shouldSerializeToXML, toElementString, toNativeValue0, usePropHashMap, usesPropIndex, validateChildPropInValue, validateClassInstances, validatePropType, validatePropValue, verify, verifyInternalUseOnly, verifyTree, virtualizeMethods inherited from class GProp
addPropError, addPropListener, appendProp, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalValues, finalize, fine, fine, finer, finer, finest, finest, fromElementString, getAliasName, getAppSessionGyro, getAppWorker, getAtomPath, getAttribute, getChildReferencePropName, getClientWorker, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropName, getFullPropNameDebug, getFullPropNameDebug, getListeners, getModuleFolder, getModuleFolder, getParent, getParent, getProjectName, getPropAtom, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getReferencePropNameNoAssert, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParentNoAssert, getTreeLock, hasChanged, hasCircularReferencesError, hashCode, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropErrorPersisted, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropForEditorAtCreation, isPropNullable, isPropPrivate, isPropPrivateAtCreation, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropRootLoading, isPropRootTreeModificationsAllowed, isPropSaveRelevant, isPropSecret, isPropSecretCapable, isPropUSER, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, isSibling, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onInitialize, onPrepare, onPropInvalidateCache, onPropParentChanged, onPropValueSet, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropSecret, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, throwIfReadOnly, toNativeValue, toShortString, toShortString, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warningMethods inherited from interface IGProp
addPropError, addPropListener, dispose, equals, fine, fine, finer, finer, finest, finest, fromElementString, getAppSessionGyro, getAtomPath, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropNameDebug, getModuleFolder, getModuleFolder, getParent, getParent, getPropAtom, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getRelativePropName, getRootParent, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, isSibling, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, removePropError, removePropListener, renameProp, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warningMethods inherited from interface IPropCnr
canRequestFocus, canRequestFocus, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized
Field Details
PN_ANALYTICS_CONSENT
The name of the boolean property the client sets under this environment with the user's Web Analytics consent:trueaccepted,falsedeclined, absent while undecided. The client sets it when its connection is established and again whenever the user decides (iz/client.js buildEnv,iz/analytics.js), and reports it again on a reconnect.- See Also:
clientEnv
The client environment properties.geoProps
The Geolocation properties.serverEnv
The server environment properties.PASSKEY_NOT_ALLOWED
The name of the error of a ceremony the user cancelled or let time out, or that the authenticator refused (NotAllowedError): the sign-in failed, and nothing is to be handed to the server'sfinish...call.- See Also:
PASSKEY_INVALID_STATE
The name of the error of a registration on an authenticator that holds a passkey of the user already (InvalidStateError): no failure of the user's, to be told with a text of its own.- See Also:
PASSKEY_ABORTED
The name of the error of a request that was aborted in the client (AbortError): the autofill of the user name field, when the user took a passkey button instead.- See Also:
PASSKEY_NOT_SUPPORTED
The name of the error of a request the client cannot run (NotSupportedError): a client without WebAuthn (iiziRun among them, whose passkeys are SignIn L-12), or an autofill in a client without conditional mediation.- See Also:
PASSKEY_RENEWAL_FAILED
The name of the error of an autofill whose options could not be made again at its renewal (the reason is in the server log). It is the bridge's own, not aDOMException.- See Also:
PASSKEY_CAPABILITIES_DEADLINE_MS
public static final long PASSKEY_CAPABILITIES_DEADLINE_MSHow long the client has to report its capabilities: 30 seconds.- See Also:
PASSKEY_AUTOFILL_RENEW_MS
public static final long PASSKEY_AUTOFILL_RENEW_MSThe age at which the options of an autofill are made again and handed to the client: 14 minutes, one before the 15 minutes the server keeps the challenge of an autofill.- See Also:
Constructor Details
EnvProps
protected EnvProps()Creates the environment properties without a name.EnvProps
Creates the environment properties with a name.- Parameters:
atom- The atom name.
Method Details
getClientSessionGyro
Gets the client session gyro instance.- Specified by:
getClientSessionGyroin interfaceIGProp<GProp<?>[]>- Overrides:
getClientSessionGyroin classGProp<GProp<?>[]>- Returns:
- The instance, or null if not found.
shouldSerializeToXML
protected boolean shouldSerializeToXML(int programType) The EnvProps are never written to XML.- Overrides:
shouldSerializeToXMLin classGProp<GProp<?>[]>- Parameters:
programType- From PropFactory.getProgramType(): 0=PropFactory.CLIENT, 1=PropFactory.SERVERor 2=PropFactory.EDITOR.- Returns:
- true (default if not VOLATILE) to save to XML, false to avoid writing the property to XML.
addPredefinedProps
Adds the predefined properties for this container. This method is called once just after construction of the property container.Properties added:
- client environment StringMapProp Atom.A_CLIENT - server environment StringMapProp Atom.A_SERVER
- Overrides:
addPredefinedPropsin classPropCnr- Throws:
PropException- for property exceptions.
getPredefinedProps
protected void getPredefinedProps()Gets potential references to predefined properties for this container. This method is called once just after cloning of the property container.The method should get reference to using the
getProp(...)methods. This allows the subclass to be able to retrieve the new instances to the properties created duringaddPredefinedProps()if stored in instance variables.- Overrides:
getPredefinedPropsin classPropCnr
onInsertProp
protected void onInsertProp(GProp<?> aProperty, int index, boolean replace, boolean isCloning, PropMgr propMgr, boolean isMoving) throws PropException Called when a property is inserted. The atoms of the children the remote party creates are recorded, so thatonRemoteRootCreated()can tell which of the predefined properties it did not send.- Overrides:
onInsertPropin classPropCnr- Parameters:
aProperty- The property to insert.index- Index where to insert the property.replace- Flag indicating if the value should be replaced or not.isCloning- Flag indicating this property is being cloned.propMgr- The property manager for remote change, null for local.isMoving- Flag indicating the property is moved.- Throws:
PropException- For property exceptions.
onRemoteRootCreated
public void onRemoteRootCreated()Called once by the property manager after the root has been created from the remote party. The predefined$geoand$zonesproperties that the remote party did not create are marked private: they stay present, non-null and attached, but are never sent to a party that has no such properties. The Integrated Designer creates neither, the Design Viewer and the VSViewers create only$zones, and a client creates both. The change flag of a property made private is reset, otherwise it would mark this container as changed after every send transaction and an empty update would be sent forever.clone
getServerEnv
Gets the server environment properties.- Returns:
- StringMapProp for the server environment.
getClientEnv
Gets the client environment properties.- Returns:
- StringMapProp for the client environment.
iiziRunPresent
public boolean iiziRunPresent()Checks if iiziRun (Corvova) is present.- Returns:
- true if present, false otherwise.
getGeolocation
Gets the Geolocation properties.getSpeechSynthesis
Gets the speech synthesis instance.- Returns:
- The instance, or null if not supported.
getSpeechRecognition
Gets the speech recognition instance.- Returns:
- The instance, or null if not supported.
getLocale
Gets the client local info class instance.- Returns:
- The client locale info class instance when the client environment has been set, otherwise the default client locale info instance specified for the server.
setLocale
Changes or sets the LocaleInfo for the environment. This method is intended to be used to change the language setting of a client session.Note that this change does not fire any refresh to the client property tree, use the
instead.IClientSessionGyro.setLocale(LocaleInfo)- Parameters:
locale- localeInfo The locale information to use.- Returns:
- The old LocaleInfo, or null if not set.
- Throws:
PropTypeException- If the property is read-only.
getDPR
public double getDPR()The device pixel ratio of the client.- Returns:
- The Device Pixel Ratio, or 1.0 if not found.
getLanguageCode
Gets the language code to use.- Returns:
- The language code, or null for default (not defined by the client).
getUIScheme
Gets the theme scheme the client shows: the shipped theme family and the resolved mode, light or dark, never auto (UISchemes; THEME-DESIGN.md section 4.6). The client reports it as theuiSchemestring property at connect and on every change (iz/uischeme.js), so that app code can ask.- Returns:
- The scheme, or null when the client has not reported one: an older client, a Designer session before the Panel Editor sent its choice, or a report that is not a shipped family and mode.
getUISchemeChoice
Gets the theme scheme the client was told to show, the mode as chosen: light, dark, auto or auto_dark (UISchemes; order CC-THEME-DARK-V5). The client reports it as theuiSchemeChoicestring property at connect and on every change, beside the resolvedgetUIScheme().- Returns:
- The choice, or null when the client has not reported one: an older client, a Designer session before the Panel Editor sent its choice, or a report that is not a shipped family and mode.
setCachedValue
getCachedValue
hasClientCapabilities
Checks if a client has the specified capabilities. It is important to use the appropriate EnvProps instance, i.e. the client session EnvProps and not e.g. the server's.- Parameters:
capability- The capability to query.- Returns:
- true for support, false when client doesn't have the capability.
getParsedUserAgent
getDeviceDetectionFromUserAgent
Gets the cached device detection instance based on the parsed user agent.- Returns:
- The cached device detection instance based on the parsed user agent (i.e. parsed once only).
- Throws:
Exception- An exception due to failure in performing the test, with a message why it failed.
registerSession
public IRemoteSessionControl registerSession(IClientSessionGyro clientGyro, IRemoteSessionControlListener listener) Assigns the application session control listener.This method is only intended for the framework and will throw an error if called.
- Parameters:
clientGyro- The client gyro instance.listener- The control listener.- Throws:
IllegalStateException- If not called from the framework.
onRemoteEvent
Called when a remote property event should be processed by this property.A subclass can override this method to perform appropriate processing and is not required to call
super.onRemoteEvent(e).The onRemoteEvent is NOT called when in a proxied property container, but rather the normal onEventSelf method.
- Specified by:
onRemoteEventin interfaceIGProp<GProp<?>[]>- Overrides:
onRemoteEventin classGProp<GProp<?>[]>- Parameters:
event- The remote event.
onEventSelf
Called when a property event is send to this property.A subclass can override this method to perform appropriate processing and is not required to call
super.onEventSelf(e).- Specified by:
onEventSelfin interfaceIGProp<GProp<?>[]>- Overrides:
onEventSelfin classGProp<GProp<?>[]>- Parameters:
event- The property event.
addUISchemeListener
Adds a theme scheme listener for the client session: told when the resolved scheme the client shows changes, by the user, a URL, the OS under auto, or the API. Calling this method multiple times with the same listener will have no effect (but to return false).- Parameters:
listener- The listener to add.- Returns:
- true if the listener was added, false otherwise.
- Throws:
NullPointerException- If the listener isnull.
removeUISchemeListener
Removes a theme scheme listener for the client session.- Parameters:
listener- The listener to remove.- Returns:
- true if listener is successfully removed, false otherwise.
addScreenSizeListener
Adds a screen size listener for the client session. Calling this method multiple times with the same listener will have no effect (but to return false).- Parameters:
listener- The listener to add.- Returns:
- true if the listener was added, false otherwise.
- Throws:
NullPointerException- If the listener isnull.
removeScreenSizeListener
Removes a screen size listener for the client session.- Parameters:
listener- The listener to remove.- Returns:
- true if listener is successfully removed, false otherwise.
getScreenWidth
public int getScreenWidth()Gets the current screen width.- Returns:
- The current screen width, or zero if not initialized.
getScreenHeight
public int getScreenHeight()Gets the current screen height.- Returns:
- The current screen height, or zero if not initialized.
getScreenSize
Gets the current screen size.- Returns:
- The current screen size, or zero width and/or height if not initialized.
addScreenOrientationListener
Adds a screen orientation listener for the client session. Calling this method multiple times with the same listener will have no effect (but to return false).- Parameters:
listener- The listener to add.- Returns:
- true if the listener was added, false otherwise.
- Throws:
NullPointerException- If the listener isnull.
removeScreenOrientationListener
Removes a screen orientation listener for the client session.- Parameters:
listener- The listener to remove.- Returns:
- true if listener is successfully removed, false otherwise.
isScreenOrientationLockSupported
public boolean isScreenOrientationLockSupported()Checks if screen orientation locking is supported or not.- Returns:
- true if the functions to lock or unlock screen orientation are supported, false otherwise.
getScreenOrientation
Gets the current screen orientation.- Returns:
- The orientation,
ScreenOrientation.unknownif not supported.
setScreenOrientation
Locks the screen orientation.Note that there may be a delay in the orientation change after calling this method. This could be due to slow client connection, disconnected client or just due to device lag.
- Parameters:
orientation- The orientation.- Returns:
- true for success, false for not supported.
- Throws:
IllegalArgumentException- IforientationisScreenOrientation.unknown.
unlockScreenOrientation
public boolean unlockScreenOrientation()Unlocks the screen orientation.Note that there may be a delay in the orientation change after calling this method. This could be due to slow client connection, disconnected client or just due to device lag.
- Returns:
- true for success, false for not supported.
getDeviceUUID
Gets the device UUID.- Returns:
- The device's UUID if iiziRun is used and has been initialized,
unknownotherwise. It is always "browser" for browsers.
getDeviceUUID
Gets the device UUID.- Parameters:
mustBeValid- Flag requiring device UUID to be from a valid device, otherwise null is returned. When flag is false,- Returns:
- The device's UUID if iiziRun is used and has been initialized, when
mustBeValidis falseunknownotherwise. It is always "browser" for browsers whenmustBeValidis false. WhenmustBeValidis true, null is returned.
configureStatusBar
Sets the client sessions status bar to the configuration specified.Note: this only works on devices using iiziRun.
- Parameters:
config- The configuration.- Returns:
- true for ch
addStatusBarTapListener
Adds a status bar tap listener for the client session. Calling this method multiple times with the same listener will have no effect (but to return false).Status bar tap events are only fired for devices using iiziRun with status bars available, using iOS devices.
- Parameters:
listener- The listener to add.- Returns:
- true if the listener was added, false otherwise.
- Throws:
NullPointerException- If the listener isnull.
removeStatusBarTapListener
Removes a status bar tap listener for the client session.- Parameters:
listener- The listener to remove.- Returns:
- true if listener is successfully removed, false otherwise.
getAnalyticsConsent
Gets the user's Web Analytics consent as the client last reported it in this environment (thePN_ANALYTICS_CONSENTboolean, set at connect and at every decision).Never a cookie wall: the server may read this value, for example to decide what to log or to offer a privacy page, but no function of the application or of IIZI may ever depend on it. A user who declined must get exactly the same application as one who accepted.
- Returns:
Boolean.TRUEwhen accepted,Boolean.FALSEwhen declined, ornullwhen undecided, when the client is not a Browser running an application with a Measurement ID (iiziRun, the Designer pages), or when it has not reported yet.
askAnalyticsConsent
public boolean askAnalyticsConsent()Asks the client to show IIZI's Web Analytics consent prompt now, even when a decision is already stored. The user's answer is written on the device, applied by the client without a page reload and reported back throughgetAnalyticsConsent(); this method does not wait for it.Only a Browser client running an application with a Measurement ID shows anything; iiziRun and the Designer pages ignore the event.
- Returns:
truewhen the request was sent,falsewhen the environment is disposed of.
setAnalyticsConsent
public boolean setAnalyticsConsent(boolean granted) Sets the user's Web Analytics consent directly, when the application asked the user itself (the App page's consent choice "the application asks"). The client writes the decision on the device, starts or stops Analytics accordingly without a page reload, and reports the new value back throughgetAnalyticsConsent(); this method does not wait for it.Only a Browser client running an application with a Measurement ID acts on it; iiziRun and the Designer pages ignore the event.
- Parameters:
granted-truewhen the user accepted,falsewhen the user declined.- Returns:
truewhen the decision was sent,falsewhen the environment is disposed of.
credentialsAccepted
Tells the client that the credentials the user typed in a form container were accepted, so that the password manager of the Browser offers to save them. Call it once the sign-in, the sign-up or the change of password has succeeded, BEFORE the container is hidden, swapped out or its fields are cleared: the client reads the fields as they are in the page.Why it is needed. A Browser offers to save a password when it sees a sign-in succeed: a form submission that navigates, or a fetch. An IIZI application talks over its WebSocket, which no password manager watches, so without this call nothing is ever offered.
What the client does. It hides a revealed password again, dispatches the
submitevent of the form (cancelled: a form of an IIZI application is never posted) and replaces the current entry of the session history with itself, which adds no entry and changes no address. Browsers pair the fields by theirautocompletetokens:usernamewithcurrent-passwordornew-password. Nothing typed travels in this call: only the path of the container does.The container should have the "Data entry form" option (
form); without it nosubmitevent is dispatched, the rest is done. This method does not wait for the client and gets no answer: whether the Browser offers anything is its decision, and the user's.- Parameters:
form- The container holding the text fields of the credentials.- Returns:
truewhen the signal was sent,falsewhen the environment is disposed of.- Throws:
NullPointerException- If the container is null.IllegalArgumentException- If the container is not in the property tree of this environment's client session.
getWebEngineStatus
Gets the verdict on the web engine this environment's client runs on, as the server computed it when the client session connected, and again at every reconnect.The verdict is kept on this instance only, as the parsed user agents are (
getCachedValue(String, Class)): a clone has none.- Returns:
- The verdict, or
nullwhen none was computed: on a client, in a Designer session, in a clone, or before the client session exists.
setWebEngineStatus
Sets the verdict on the web engine this environment's client runs on. This method is not intended to be called by user code: the server calls it when it has classified the client. The verdict decides no access, so nothing is gained by setting another one.- Parameters:
status- The verdict,nullfor none.
showWebEngineWarning
public boolean showWebEngineWarning(boolean now) Tells the client that its web engine no longer receives security updates, so that it warns its user: the engine and its version, that it stopped receiving security updates, and since when. The client shows the notice after the first panel of the application, never on top of another prompt; it never blocks the application. This method does not wait for the client and gets no answer.Nothing is sent when the verdict is not
WebEngineStatus.isUnpatched(): a patched engine, or one that is not assessed, is never warned about.- Parameters:
now-truewhen the application asks for the warning: the client shows it now, whether or not it showed it on this device before.falsefor the warning IIZI sends when the client session connects, which the client shows once per device and engine version and again after 30 days.- Returns:
truewhen the warning was sent,falsewhen there is no verdict, the engine is not unpatched, or the environment is disposed of.
setPasskeyTimerEngine
Sets the timer engine the deadline of a capability report and the renewal of an autofill are registered with, e.g. the client session's.- Parameters:
engine- The engine, or null for the system's.
requestPasskeyCapabilities
Asks the client what it can do with passkeys - at the start of every sign-in, since a user can set up a platform authenticator at any time. The answer is handed first toIUserAuthenticationUI.setPasskeyCapabilitiesof the application, on which what is offered and the policy "require a passkey where available" rest, and then to the callback. A client that does not answer withinPASSKEY_CAPABILITIES_DEADLINE_MSis reported as having none of the three (EnvProps.PasskeyCapabilities.reported()false).The answer is the client's own statement: it decides what is offered, never whether a credential is accepted.
- Parameters:
callback- The callback, called once.- Returns:
- The request ID, or 0 when the environment is disposed of: nothing was sent and the callback is never called.
- Throws:
NullPointerException- Ifcallbackis null.
armPasskeyAssertion
Arms a sign-in with a passkey on a component: when the user clicks it, the client callsnavigator.credentials.get()with the options, inside the click - a Browser may refuse a ceremony that is not started by the user's gesture, and a message of the server is none. The options are those ofIUserAuthenticationUI.startPasskeyAssertionfor the button "Sign in with a passkey", for a sign-in that waits for its passkey, or for the confirmation of the signed-in user.One click, one ceremony: the component is disarmed by it, and the callback gets the credential for
finishPasskeyAssertion, or the error. An autofill that runs is aborted by the click and answeredPASSKEY_ABORTED. The challenge in the options has the time the server gives it; a click after it getsPASSKEY_REQUEST_EXPIREDfromfinishPasskeyAssertion, after which the component is armed again with new options.- Parameters:
comp- The component, typically a button, in the property tree of this environment's client session.options- The JSON text of thePublicKeyCredentialRequestOptionsJSON.callback- The callback, called once unless the request is cancelled.- Returns:
- The request ID, or 0 when the environment is disposed of.
- Throws:
NullPointerException- If an argument is null.IllegalArgumentException- If the component is not in the property tree of this environment's client session.
armPasskeyRegistration
Arms the registration of a passkey on a component: when the user clicks it, the client callsnavigator.credentials.create()with the options, inside the click. The options are those ofIUserAuthenticationUI.startPasskeyRegistration. The callback gets the credential forfinishPasskeyRegistration, or the error:PASSKEY_INVALID_STATEwhen the authenticator holds a passkey of the user already. Otherwise asarmPasskeyAssertion(UIComp, String, EnvProps.IPasskeyCallback).- Parameters:
comp- The component, typically a button, in the property tree of this environment's client session.options- The JSON text of thePublicKeyCredentialCreationOptionsJSON.callback- The callback, called once unless the request is cancelled.- Returns:
- The request ID, or 0 when the environment is disposed of.
- Throws:
NullPointerException- If an argument is null.IllegalArgumentException- If the component is not in the property tree of this environment's client session.
startPasskeyAutofill
public int startPasskeyAutofill(EnvProps.IPasskeyOptions options, EnvProps.IPasskeyCallback callback) throws Exception Starts the autofill of the user name field with passkeys (conditional mediation): the Browser offers the passkeys it holds for the application in the autofill of the field whoseautocompletehas the tokenwebauthn, while the page is open, with no button. The options are made at once, on the caller's thread, and again everyPASSKEY_AUTOFILL_RENEW_MSon the worker of the application session, before the server's challenge runs out; the client then replaces the request it waits with.One autofill at a time: a new one cancels the one that runs. The callback gets the credential for
finishPasskeyAssertionwhen the user picks a passkey,PASSKEY_ABORTEDwhen the user took an armed button instead,PASSKEY_NOT_SUPPORTEDin a client without conditional mediation, orPASSKEY_RENEWAL_FAILED. After any of these the autofill has ended; to offer it again, start a new one.- Parameters:
options- Makes the options, typically withstartPasskeyAssertion(clientGyro,true).callback- The callback, called once unless the autofill is cancelled.- Returns:
- The request ID, or 0 when the environment is disposed of.
- Throws:
NullPointerException- If an argument is null, or the options made are.Exception- Whatoptionsthrows at the start: nothing was sent.
cancelPasskeyRequest
public boolean cancelPasskeyRequest(int request) Cancels a passkey request: a component is disarmed, an autofill ends. The client is told and answers nothing, and the callback is not called.- Parameters:
request- The request ID.- Returns:
- true when the request was waiting, false when it had ended or is unknown.
getPendingPasskeyRequests
public int getPendingPasskeyRequests()Gets the number of passkey requests that wait for the client.- Returns:
- The count.
onPropDispose
protected void onPropDispose()Called when the environment is disposed of, with its root: every passkey request that waits is logged as not completed and dropped; no callback is called.- Overrides:
onPropDisposein classPropCnr