Enum 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 Detail

    • 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 name
        java.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 SDK

        Use 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 settings
        zendeskUrl - The full URL of your Zendesk instance, https://{subdomain}.zendesk.com
        applicationId - The application id of your SDK app, as found in the web interface
        oauthClientId - 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.
      • 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 RateMyAppSettings. 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 RequestListFragment requires that an Identity has been initialised by calling ZendeskConfig.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 MobileSettings from 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 type CustomField to 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

        public void setCoppaEnabled(boolean enabled)
        Sets whether we should enable COPPA mode.
        Parameters:
        enabled - true to enable COPPA mode, false otherwise.
      • isCoppaEnabled

        public boolean isCoppaEnabled()
        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 identifier
        callback - Callback that will deliver a PushRegistrationResponse or ErrorResponse
      • 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 identifier
        callback - Callback that will deliver a PushRegistrationResponse or ErrorResponse
      • disablePush

        public void disablePush(java.lang.String identifier,
                                <any> callback)
        Unregister the device for push notifications.
        Parameters:
        identifier - The device identifier
        callback - Callback that will deliver a retrofit2.Response or ErrorResponse
      • 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.
      • getTracker

        public ZendeskTracker getTracker()
        Gets the current tracker.
        Returns:
        The tracker, or the default tracker if no tracker was installed