Package com.iizix.device.settings
Interface IOpenNativeSettings
- All Known Implementing Classes:
- NativeSetting
public interface IOpenNativeSettings
Interface used to open native device settings when the client is iiziRun based.
The device settings opens native Android or iOS settings. This interface is only present on the Hybrid iiziRun based client (Cordova based) and is not available for other client types such as pure browser or Progressive Web Apps (PWA).
This interface is retrieved from the client session using IClientSessionGyro.getOpenNativeSettings(). The native setting is opened with the method #openNativeSettings(INativeSetting, java.util.function.BiConsumer, java.util.function.BiConsumer).
See cordova-open-native-settings of the implementation in Cordova for more information.
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- static final IOpenNativeSettingsDefault instance that always returns unsupported and not Android nor iOS client, and throws IllegalArgumentException when attempting to open a setting.
- Method SummaryModifier and TypeMethodDescriptionGets the client session associated with this flashlight instance.- booleanChecks if the client is Android.- booleanChecks if the client is iOS.- boolean- isReady()Verifies if this instance is ready to accept an open native settings call.- booleanChecks if this client supports any native settings or not.- boolean- openNativeSettings- (INativeSetting setting, IOpenSettingSuccess success, IOpenSettingFailure failure) Opens a native setting on the client.
- Field Details- DEFAULT_IMPLDefault instance that always returns unsupported and not Android nor iOS client, and throws IllegalArgumentException when attempting to open a setting.
 
- Method Details- isSupportedboolean isSupported()Checks if this client supports any native settings or not.- Returns:
- trueif client is Android or iOS running iiziRun,- falseotherwise (e.g. browser or PWA).
 
- isClient_Androidboolean isClient_Android()Checks if the client is Android.- Returns:
- trueif client is Android running iiziRun,- falseotherwise (e.g. browser or PWA).
 
- isClient_iOSboolean isClient_iOS()Checks if the client is iOS.- Returns:
- trueif client is iOS running iiziRun,- falseotherwise (e.g. browser or PWA).
 
- isReadyboolean isReady()Verifies if this instance is ready to accept an open native settings call. Please note that it is not guaranteed due to threading that the call to- openNativeSettings(INativeSetting, IOpenSettingSuccess, IOpenSettingFailure)will succeed.- Returns:
- trueif the client supports opening a setting and that it is not busy, disconnected or not available to process requests.
 
- getClientSessionIClientSessionGyro getClientSession()Gets the client session associated with this flashlight instance.- Returns:
- The client session, or nullif it is disposed of already. Please note that the client session might be returned as non-null but that it is currently in dispose operation.
 
- openNativeSettingsboolean openNativeSettings- (INativeSetting setting, IOpenSettingSuccess success, IOpenSettingFailure failure) Opens a native setting on the client. The- successand- failureparameters can be specified as a callbacks that receives two parameters: the client session that was the target of the open native setting, and the setting requested for the open operation. If either- successor- failurefunctions are- null, it is accepted and just ignored by the API.- Parameters:
- setting- The setting to open.
- success- Success callback function,- nullfor none (ignored).
- failure- Failure callback function,- nullfor none (ignored).
- Returns:
- Flag for successful request issued. When true, the callbacks (if defined) will be invoked at a later stage. If the request fails immediately and this return code isfalse, a potentialfailurecallback will be invoked prior to returning, in the same thread.
- Throws:
- NullPointerException- If the- settingis- null.
- IllegalArgumentException- If the- settingis not valid for the client device in question.