Class Luciq

  • All Implemented Interfaces:

    
    public class Luciq
    
                        

    The core Luciq SDK class.

    The Luciq SDK can provide logs that may be helpful if you want to test out the integration or trace the SDK process. To turn it on, just enable debugging by setting Luciq.DEBUG = true;

    For more info, please refer to

    • Constructor Detail

    • Method Detail

      • setSdkDebugLogsLevel

         static void setSdkDebugLogsLevel(int level)

        Sets the printed logs priority filter to one of the following levels:

        - NONE disables all SDK console logs. - ERROR prints errors, we use this level to let you know if something goes wrong. - WARNING prints errors and warnings, we use this level to let you know if something goes wrong. This is also enabled by default - DEBUG use this in case you are debugging an issue. Not recommended for production use. - VERBOSE use this only if DEBUG was not enough and you need more visibility on what is going on under the hood. Similar to the DEBUG level, this is not meant to be used on production environments.

        More information can be found .html>here

        Parameters:
        level - the priority level.
      • getPrimaryColor

         static int getPrimaryColor()

        Get the primary color that the SDK will use to tint certain UI elements in the SDK

        Since:

        2.0

      • addFileAttachment

         static void addFileAttachment(@NonNull() Uri fileUri, @NonNull() String fileNameWithExtension)

        Adds extra file attachment to be uploaded along with upcoming reports. By using this API you can attach more than one file up to 10 files each file size up to 50MB, more than that will be ignored. Notes: 1) The file will be copied at the reporting time only, So you can update the file whenever you want and you don't need to re-add it. 2) This API will retain only the latest 10 files have been added. 3) This API uses LinkedHashMap collection internally, So it will never accept repeated URIs.

        Parameters:
        fileUri - Uri of desired file to be uploaded along upcoming reports note:uri shouldn't be null, otherwise it will be ignored
        fileNameWithExtension - the file name with extension
        Since:

        3.4.0

      • addFileAttachment

         static void addFileAttachment(@NonNull() Array<byte> data, @NonNull() String fileNameWithExtension)

        Adds extra data as a file attachment to be uploaded along with upcoming reports. By using this API you can attach more than one file up to 10 files each file size up to 50MB, more than that will be ignored. Notes: This API save the data to new Uri then it adds it using the addFileAttachment

        Parameters:
        data - byte[] of data wil be saved as a file to be uploaded along upcoming reports note:data shouldn't be null, otherwise it will be ignored
        fileNameWithExtension - the file name with extension
        Since:

        4.2.8

      • clearFileAttachment

         static void clearFileAttachment()

        Clears all Uris of the attached files. The URIs which added via addFileAttachment API not the physical files.

      • setUserData

         static void setUserData(@NonNull() String userData)

        Adds specific user data that you need to be added to the reports

        Parameters:
        userData - string representing user data
        Since:

        2.0

      • identifyUser

         static void identifyUser(@Nullable() String userName, @Nullable() String email, @Nullable() String id)

        Set the user identity. Luciq will pre-fill the user email in reports.

        Parameters:
        userName - Username.
        email - User's default email (optional)
        id - User's Id (optional)
      • logoutUser

         static void logoutUser()

        Logout user.

        Since:

        4.0.0

      • isBuilt

         static boolean isBuilt()
        Returns:

        true if Luciq.Builder().build() was called Luciq, false if not

      • isEnabled

         static boolean isEnabled()
        Returns:

        true if Luciq is enabled, false if it's disabled

      • enable

         static void enable()

        Enables all Luciq functionality

      • disable

         static void disable()

        Disables all Luciq functionality

      • pauseSdk

         static void pauseSdk()

        Internal Use Only Pauses all Luciq functionality temp.

      • resumeSdk

         static void resumeSdk()

        Internal Use Only Resume luciq state.

      • setLocale

         static void setLocale(@NonNull() Locale locale)

        Change Locale of Luciq UI elements

        Parameters:
        locale - new locale to use with Luciq (defaults to English)
      • addTags

         static void addTags(@NonNull() Array<String> tags)

        Adds tag(s) to issues before sending them

        Parameters:
        tags - to be added to issues uploaded from now on till it's reset using resetTags
      • setUserAttribute

         static void setUserAttribute(@NonNull() String key, @NonNull() String value)

        Sets user attribute to overwrite it's value or create a new one if it doesn't exist.

        Parameters:
        key - the attribute
        value - the value
        Since:

        3.2.0

      • removeUserAttribute

         static void removeUserAttribute(@NonNull() String key)

        Removes user attribute if exists.

        Parameters:
        key - the attribute key as string
        Since:

        3.2.0

      • clearAllUserAttributes

         static void clearAllUserAttributes()

        Clears all user attributes if exists.

        Since:

        3.0

      • setWelcomeMessageState

         static void setWelcomeMessageState(@NonNull() WelcomeMessage.State welcomeMessageState)

        Sets the welcome message mode to live, beta or disabled.

        By default, the welcome message live mode is enabled. and it appears automatically after 30 seconds from the user's first session. You can change it to the beta mode or disable it.

        The live mode consists of one step to inform the users how to report a bug or feedback. The beta mode consists of three steps to welcome your testers on board, inform them how to report a bug or feedback and to motivate them to always be on the latest app version.

        Please note, the into message appears only if the invocation event isn't set to none.

        Parameters:
        welcomeMessageState - An enum to set the welcome message state to live, beta or disabled.
        Since:

        4.14.0

      • showWelcomeMessage

         static void showWelcomeMessage(@NonNull() WelcomeMessage.State welcomeMessageState)

        Shows the welcome message in a specific mode.

        By default, the welcome message live mode is enabled. and it appears automatically after 30 seconds from the user's first session. You can change it to the beta mode or disable it.

        The live mode consists of one step to inform the users how to report a bug or feedback. The beta mode consists of three steps to welcome your testers on board, inform them how to report a bug or feedback and to motivate them to always be on the latest app version.

        Please note, the into message appears only if the invocation event isn't set to none.

        Parameters:
        welcomeMessageState - An enum to set the welcome message state to live, beta or disabled.
        Since:

        4.14.0

      • setColorTheme

         static void setColorTheme(@NonNull() LuciqColorTheme luciqTheme)

        Set which color theme to use for the SDK's UI

        Parameters:
        luciqTheme - color theme to apply on the SDK
        Since:

        8.0.0

      • setCustomBrandingImage

         static void setCustomBrandingImage(@DrawableRes() int lightLogoVariant, @DrawableRes() int darkLogoVariant)

        Set a custom brand logo image that could be displayed at the bottom of Luciq screens when the LuciqFeature.WHITE_LABELING is enabled.

        Parameters:
        lightLogoVariant - that will be used when the light theme is enabled.
        darkLogoVariant - that will be used when the dark theme is enabled.
        Since:

        11.6.0

      • logUserEvent

         static void logUserEvent(@NonNull() String eventIdentifier)

        log @UserEvent associated with the current user

        Parameters:
        eventIdentifier - identifier to identify this UserEvent
        Since:

        8.0.0

      • logUserEvent

         static void logUserEvent(@NonNull() String eventIdentifier, @NonNull() Array<UserEventParam> userEventParams)

        Logs a user event with custom parameters.

        Parameters are key-value pairs that provide additional context for the event. Invalid parameters (exceeding length limits or count limits) will be logged as errors and discarded.

        Parameters:
        eventIdentifier - The name/identifier of the event to log
        userEventParams - Variable arguments of UserEventParam objects (max 15 parameters)
      • onReportSubmitHandler

         static void onReportSubmitHandler(Report.OnReportCreatedListener listener)

        Sets the onReportSubmitHandler that calls onReportCreated just after creating a bug report or a crash report Please note that you can add up to 10 Tags, User Attributes, Console Logs and 3 Files. WARNING: This runs on a background thread. Long operations will delay sending the report.

        Since:

        8.0.0

      • show

         static void show()

        Shows Luciq Prompt Options. By default, it contains Report a problem, Suggest an improvement, Ask a question, and a button that navigates to the chats list. To control which options should be enabled, see BugReporting.setState(), Chats.setState(), and Replies.setState().

      • addPrivateViews

         static void addPrivateViews(@NonNull() Array<View> views)

        Marks sensitive views as private.

        Parameters:
        views - the sensitive views to be masked.
      • setViewsContentCaptureEnabled

         static void setViewsContentCaptureEnabled(boolean enabled)

        Master flag controlling whether User Steps and Repro Steps capture view content (text, labels).

        When disabled, captured events still fire with gesture, view class, and screen name, but view text / labels are redacted using the same non-identifying descriptors as addPrivateViews.

        Does not affect Session Replay screenshots or bug-report screenshots; use setAutoMaskScreenshotsTypes for those.

        Default: true. Runtime-only; resets on each SDK build.

        Parameters:
        enabled - true to capture view content (default), false to redact content while preserving events.
      • setScreenshotProvider

         static void setScreenshotProvider(@NonNull() Callable<Bitmap> provider)

        Provides a Callable<Bitmap> to capture screenshots externally. Should be only called from a cross-platform SDK (e.g. React Native, Flutter…etc)

        Parameters:
        provider - when called, returns a bitmap of the screenshot taken
      • setAutoMaskScreenshotsTypes

         static void setAutoMaskScreenshotsTypes(Array<int> types)

        an API to auto-mask screenshots.

        Parameters:
        types - are the masking types on screenshots by default WEB_VIEWS is enabled unless this API is called.
      • setFullscreen

         static void setFullscreen(boolean isFullscreen)

        Sets the SDK views to be displayed in fullscreen mode when SDK is in fullscreen mode, status bar and navigation bar will not be displayed when an SDK view appears

        Parameters:
        isFullscreen - boolean to set the views to be displayed in fullscreen mode
      • willRedirectToStore

         static void willRedirectToStore()

        API to be called from the app when it navigates the user to the play store for app rating.

      • setCodePushVersion

        @Deprecated() static void setCodePushVersion(@Nullable() String codePushVersion)

        Sets Code Push version to be used for all reports. Note: Should only be set for React Native apps

        Parameters:
        codePushVersion - the Code Push version to work with.
      • setOverAirVersion

         static void setOverAirVersion(@Nullable() String version, int overAirVersionType)

        Sets over Air version to be used for all reports. Note: Should only be set for React Native apps

        Parameters:
        version - the on Air version to be used
        overAirVersionType - to Determine whatever the type is Expo or code push
      • setNetworkAutoMaskingState

         static void setNetworkAutoMaskingState(Feature.State state)

        Enable/Disable network logs auto masking

        Parameters:
        state - desired state of network logs auto masking feature
      • setNetworkLogBodyEnabled

         static void setNetworkLogBodyEnabled(boolean shouldEnableBody)

        Enable/Disable network Body logs

        Parameters:
        shouldEnableBody - desired state of disable or enable capturing network body logs from SDK
      • setWebViewNetworkTrackingEnabled

         static void setWebViewNetworkTrackingEnabled(boolean webViewNetworkLogsEnabled)

        Enables or disables the tracking of network logs performed inside WebViews. This API allows the host app to control whether network requests inside android.webkit.WebView components are recorded

        Parameters:
        webViewNetworkLogsEnabled - a boolean to determine tracking network logs inside WebViews
      • setScreenshotCaptureDelay

         static void setScreenshotCaptureDelay(int delay)

        Delay capture screenshot

        Parameters:
        delay - desired delay that will be apply to capture screenshot
      • setAppVariant

         static void setAppVariant(@Nullable() String appVariant)

        Sets App Variant to be used for all reports. Should send with all requests headers

        Parameters:
        appVariant - the app variant version to work with.
      • setWebViewMonitoringEnabled

         static void setWebViewMonitoringEnabled(boolean webViewEnabled)

        Enables or disables monitoring of android.webkit.WebView components.

        This API allows the host app to control whether APM should capture WebView performance traces, user interactions within WebViews, and network requests made from WebView instances.

        Parameters:
        webViewEnabled - true to enable WebView monitoring; false to disable it.
      • setWebViewUserInteractionsTrackingEnabled

         static void setWebViewUserInteractionsTrackingEnabled(boolean webViewUserStepsEnabled)

        Enables or disables the tracking of user steps performed inside WebViews. This API allows the host app to control whether interactions (clicks, form fills, navigations, etc.) inside android.webkit.WebView components are recorded

        Parameters:
        webViewUserStepsEnabled - a boolean to determine tracking user steps inside WebViews
      • addFeatureFlag

         static void addFeatureFlag(LuciqFeatureFlag featureFlag)

        Adds feature flag to sent with reports to BR / CR / SV3

        Parameters:
        featureFlag - LuciqFeatureFlag to be added using this API
      • addFeatureFlags

         static void addFeatureFlags(List<LuciqFeatureFlag> featureFlagsList)

        Adds features flags to sent with reports to BR / CR / SV3

        Parameters:
        featureFlagsList - list of LuciqFeatureFlag to be added using this API
      • removeFeatureFlag

         static void removeFeatureFlag(List<String> keys)

        remove features flags from features flags table on database based on specific keys

        Parameters:
        keys - list to remove features flags from database based on search this keys
      • removeAllFeatureFlags

         static void removeAllFeatureFlags()

        remove all features flags from features flags table on database based on specific keys

      • removeFeatureFlag

         static void removeFeatureFlag(String key)

        remove feature flag from features flags table on database based on specific key

        Parameters:
        key - string to remove features flags from database based on search this key
      • shouldCaptureDialogs

         static void shouldCaptureDialogs(boolean shouldCapture)

        capture dialogs when taking screenshot based on boolean

        Parameters:
        shouldCapture - boolean to determine if dialogs should be captured when capturing screenshots
      • shouldCaptureSurfaceView

         static void shouldCaptureSurfaceView(boolean shouldCapture)

        capture surface views when taking screenshot without using media projection based on boolean

        Parameters:
        shouldCapture - boolean to determine if surface views should be captured when capturing screenshots
      • captureScreenshot

         static void captureScreenshot()

        Capture a screenshot manually and add it to visual user steps used with different Luciq components