Enum ZendeskConfig
- java.lang.Object
-
- java.lang.Enum<ZendeskConfig>
-
- com.zendesk.sdk.network.impl.ZendeskConfig
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<ZendeskConfig>
public enum ZendeskConfig extends java.lang.Enum<ZendeskConfig>
Configuration class for Zendesk initialization. Call this first to configure Zendesk to use the correct credentials and Zendesk URL.
-
-
Enum Constant Summary
Enum Constants Enum Constant and Description INSTANCE
-
Field Summary
Fields Modifier and Type Field and Description static intHEADER_SUFFIX_MAX_LENGTH
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description voiddisablePush(java.lang.String identifier, <any> callback)Unregister the device for push notifications.voidenablePushWithIdentifier(java.lang.String identifier, <any> callback)Register the device for push notifications with the given identifier.voidenablePushWithUAChannelId(java.lang.String identifier, <any> callback)Register the device for push notifications with the given UrbanAirship channel id.java.lang.StringgetApplicationId()Gets the application id.java.util.List<CustomField>getCustomFields()Gets the custom fieldsSafeMobileSettingsgetMobileSettings()Gets the SDK settings.java.lang.StringgetOauthClientId()Gets the oauth client id.SdkOptionsgetSdkOptions()Gets the SdkOptions.java.lang.LonggetTicketFormId()Gets the ticket form IdZendeskTrackergetTracker()Gets the current tracker.java.lang.StringgetZendeskUrl()Gets the Zendesk URL.voidinit(Context context, java.lang.String zendeskUrl, java.lang.String applicationId, java.lang.String oauthClientId)Initialises the Zendesk SDKbooleanisAuthenticationAvailable()Determines whether the SDK has been configured to allow authentication.booleanisCoppaEnabled()Deprecated.as of v1.10.2.1.booleanisInitialized()Gets whetherZendeskConfig.init(Context, String, String, String)was called or not.ProviderStoreprovider()Gets aProviderStorefor accessing all available SDK Providers.voidsetCoppaEnabled(boolean enabled)Deprecated.as of v1.10.2.1. Consider supplyingnew AnonymousIdentity.Builder.build()inZendeskConfig.setIdentity(Identity)instead.voidsetCustomFields(java.util.List<CustomField> customFields)Set a List of typeCustomFieldto be used on request submission until unset See Mobile SDK documentation for more information on setting this.voidsetDeviceLocale(java.util.Locale deviceLocale)Sets the preferred locale for Help Center content.voidsetIdentity(Identity identity)Sets the identity which the SDK uses to access and create resourcesvoidsetSdkOptions(SdkOptions sdkOptions)Sets the options for the sdk.voidsetTicketFormId(java.lang.Long ticketFormId)Set a ticket form id which will be included in all request submission until unset See Mobile SDK documentation for more information on setting this.StorageStorestorage()Gets aStorageModulefor accessing all avaiable storages.static ZendeskConfigvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static ZendeskConfig[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final ZendeskConfig INSTANCE
-
-
Field Detail
-
HEADER_SUFFIX_MAX_LENGTH
public static final int HEADER_SUFFIX_MAX_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static ZendeskConfig[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ZendeskConfig c : ZendeskConfig.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ZendeskConfig valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
init
public void init(Context context, java.lang.String zendeskUrl, java.lang.String applicationId, java.lang.String oauthClientId)Initialises the Zendesk SDKUse this constructor when you have enabled the Conversations feature. This requires some authentication settings. Your zendeskUrl must be your full Zendesk URL in the form of https://{subdomain.zendesk.com You should replace {subdomain} with your own subdomain.
As of SDK version, 1.5.0.1 , this constructor will no longer start a background service to poll the server for updates to
SdkSettings. A lazy loading strategy is applied to all Provider calls instead, to ensure that settings are always present before a call to Zendesk.- Parameters:
context- A context, used for initialising stored settingszendeskUrl- The full URL of your Zendesk instance, https://{subdomain}.zendesk.comapplicationId- The application id of your SDK app, as found in the web interfaceoauthClientId- The oauth client id that was supplied when you set up oauth in the web interface- Throws:
ConfigurationRuntimeException- if context is null, the zendeskUrl is invalid or if the application or client id is not supplied.
-
isInitialized
public boolean isInitialized()
Gets whetherZendeskConfig.init(Context, String, String, String)was called or not.- Returns:
- true if init was successfully called, false otherwise.
-
getZendeskUrl
public java.lang.String getZendeskUrl()
Gets the Zendesk URL.This is the URL in the form of https://{subdomain}.zendesk.com
- Returns:
- The Zendesk URL
-
getOauthClientId
public java.lang.String getOauthClientId()
Gets the oauth client id.- Returns:
- The oauth client id
-
getMobileSettings
public SafeMobileSettings getMobileSettings()
Gets the SDK settings.This method will never return a null
SafeMobileSettings. This is because it is only a container for the actual settings and it simplifies client code as they don't have to null check this container.- Returns:
- the SDK settings wrapped in a
SafeMobileSettings.
-
isAuthenticationAvailable
public boolean isAuthenticationAvailable()
Determines whether the SDK has been configured to allow authentication.Certain UI features of the SDK such as
RequestListFragmentrequires that anIdentityhas been initialised by callingZendeskConfig.setIdentity(Identity)- Returns:
- true if an end user is available, false otherwise
-
getApplicationId
public java.lang.String getApplicationId()
Gets the application id.The application id is used to retrieve
MobileSettingsfrom your Zendesk instance.- Returns:
- The application id or null if it was not previously set.
-
setIdentity
public void setIdentity(Identity identity)
Sets the identity which the SDK uses to access and create resources- Parameters:
identity- Identity that the SDK will identify as
-
setCustomFields
public void setCustomFields(java.util.List<CustomField> customFields)
Set a List of typeCustomFieldto be used on request submission until unset See Mobile SDK documentation for more information on setting this.- Parameters:
customFields- List contain CustomField objects which will be included as part of the request
-
getCustomFields
public java.util.List<CustomField> getCustomFields()
Gets the custom fields- Returns:
- the list of custom fields or null if they have not been set
-
setTicketFormId
public void setTicketFormId(java.lang.Long ticketFormId)
Set a ticket form id which will be included in all request submission until unset See Mobile SDK documentation for more information on setting this.- Parameters:
ticketFormId- Long of ticket form id
-
getTicketFormId
public java.lang.Long getTicketFormId()
Gets the ticket form Id- Returns:
- the ticket form id or null if it has not been set
-
setDeviceLocale
public void setDeviceLocale(java.util.Locale deviceLocale)
Sets the preferred locale for Help Center content.This will be the locale that is preferred when requesting Help Center content from your Zendesk. Please note that the preferred locale may not be available in your Zendesk Help Center and the actual locale that is used will be specified in
HelpCenterSettings.getLocale()- Parameters:
deviceLocale- the preferred locale for Help Center content
-
setCoppaEnabled
@Deprecated public void setCoppaEnabled(boolean enabled)
Deprecated. as of v1.10.2.1. Consider supplyingnew AnonymousIdentity.Builder.build()inZendeskConfig.setIdentity(Identity)instead.Sets whether we should enable COPPA mode. If the setAnonymousIdentitydoesn't contain a name or email, this method will do nothing. If the setAnonymousIdentitydoes contain a name or email, this method will clear user storage (such as requests, article votes, identity information) and set a new, emptyAnonymousIdentity. This method is deprecated as of v1.10.2.1. Consider supplyingnew AnonymousIdentity.Builder.build()inZendeskConfig.setIdentity(Identity)instead.- Parameters:
enabled- true to enable COPPA mode, false otherwise.
-
isCoppaEnabled
@Deprecated public boolean isCoppaEnabled()
Deprecated. as of v1.10.2.1.Gets whether we are in COPPA mode or not.- Returns:
- true if COPPA mode is enabled, false otherwise.
-
enablePushWithIdentifier
public void enablePushWithIdentifier(java.lang.String identifier, <any> callback)Register the device for push notifications with the given identifier.- Parameters:
identifier- The device identifiercallback- Callback that will deliver aPushRegistrationResponseorErrorResponse
-
enablePushWithUAChannelId
public void enablePushWithUAChannelId(java.lang.String identifier, <any> callback)Register the device for push notifications with the given UrbanAirship channel id.- Parameters:
identifier- The UrbanAirship channel identifiercallback- Callback that will deliver aPushRegistrationResponseorErrorResponse
-
disablePush
public void disablePush(java.lang.String identifier, <any> callback)Unregister the device for push notifications.- Parameters:
identifier- The device identifiercallback- Callback that will deliver aretrofit2.ResponseorErrorResponse
-
getSdkOptions
public SdkOptions getSdkOptions()
Gets the SdkOptions.If no options have been explicitly set it will return DefaultSdkOptions
- Returns:
- The current SdkOptions
-
setSdkOptions
public void setSdkOptions(SdkOptions sdkOptions)
Sets the options for the sdk. Generally you do not have to call this.- Parameters:
sdkOptions- The options to set.
-
provider
public ProviderStore provider()
Gets aProviderStorefor accessing all available SDK Providers.- Returns:
- an instance of
ProviderStore
-
storage
public StorageStore storage()
Gets aStorageModulefor accessing all avaiable storages.- Returns:
- an instance of
StorageModule
-
getTracker
public ZendeskTracker getTracker()
Gets the current tracker.- Returns:
- The tracker, or the default tracker if no tracker was installed
-
-