Class Luciq
-
- All Implemented Interfaces:
public class LuciqThe 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classLuciq.Builder
-
Method Summary
Modifier and Type Method Description static voidsetSdkDebugLogsLevel(int level)Sets the printed logs priority filter to one of the following levels: - NONE disables all SDK console logs. static intgetPrimaryColor()Get the primary color that the SDK will use to tint certain UI elements in the SDK static LuciqColorThemegetTheme()static voidaddFileAttachment(@NonNull() Uri fileUri, @NonNull() String fileNameWithExtension)Adds extra file attachment to be uploaded along with upcoming reports. static voidaddFileAttachment(@NonNull() Array<byte> data, @NonNull() String fileNameWithExtension)Adds extra data as a file attachment to be uploaded along with upcoming reports. static voidclearFileAttachment()Clears all Uris of the attached files. static StringgetUserData()static voidsetUserData(@NonNull() String userData)Adds specific user data that you need to be added to the reports static StringgetUserEmail()static voidgetUserUUID(@NonNull() OnUserUUIDReadyCallback callback)static StringgetAppToken()static voididentifyUser(@Nullable() String userName, @Nullable() String email, @Nullable() String id)Set the user identity. static ContextgetApplicationContext()static voidlogoutUser()Logout user. static booleanisBuilt()static booleanisEnabled()static voidenable()Enables all Luciq functionality static voiddisable()Disables all Luciq functionality static voidpauseSdk()Internal Use Only Pauses all Luciq functionality temp. static voidresumeSdk()Internal Use Only Resume luciq state. static voidsetLocale(@NonNull() Locale locale)Change Locale of Luciq UI elements static LocalegetLocale(@Nullable() Context context)Get currently used Locale of Luciq static voidaddTags(@NonNull() Array<String> tags)Adds tag(s) to issues before sending them static ArrayList<String>getTags()static voidresetTags()Reset ALL tags added using addTags static voidsetCustomTextPlaceHolders(@NonNull() LuciqCustomTextPlaceHolder luciqCustomTextPlaceHolder)Allows replacing all the text displayed in luciq with a custom text static HashMap<String, String>getAllUserAttributes()Gets all saved user attributes. static voidsetUserAttribute(@NonNull() String key, @NonNull() String value)Sets user attribute to overwrite it's value or create a new one if it doesn't exist. static StringgetUserAttribute(@NonNull() String key)Gets specific user attribute. static voidremoveUserAttribute(@NonNull() String key)Removes user attribute if exists. static voidclearAllUserAttributes()Clears all user attributes if exists. static DategetFirstRunAt()static booleanisAppOnForeground()static voidsetWelcomeMessageState(@NonNull() WelcomeMessage.State welcomeMessageState)Sets the welcome message mode to live, beta or disabled. static voidshowWelcomeMessage(@NonNull() WelcomeMessage.State welcomeMessageState)Shows the welcome message in a specific mode. static voidsetSessionProfilerState(@NonNull() Feature.State state)Enable/disable session profiler static voidsetTrackingUserStepsState(@NonNull() Feature.State state)Enable/disable automatic user steps tracking static voidsetReproConfigurations(ReproConfigurations configurations)Sets a ReproConfigurations controlling repro steps with each type of report static voidsetColorTheme(@NonNull() LuciqColorTheme luciqTheme)Set which color theme to use for the SDK's UI static voidsetCustomBrandingImage(@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. static voidlogUserEvent(@NonNull() String eventIdentifier)log @UserEvent associated with the current user static voidonReportSubmitHandler(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. static voidshow()Shows Luciq Prompt Options. static voidaddPrivateViews(@NonNull() Array<View> views)Marks sensitive views as private. static voidremovePrivateViews(@NonNull() Array<View> views)static voidremoveAllPrivateViews()Removes all added private views static booleanisBuilding()static voidsetScreenshotProvider(@NonNull() Callable<Bitmap> provider)Provides a Callable<Bitmap> to capture screenshots externally. static voidsetAutoMaskScreenshotsTypes(Array<int> types)an API to auto-mask screenshots. static voidsetFullscreen(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 static voidwillRedirectToStore()API to be called from the app when it navigates the user to the play store for app rating. static voidsetCodePushVersion(@Nullable() String codePushVersion)Sets Code Push version to be used for all reports. static voidsetOverAirVersion(@Nullable() String version, int overAirVersionType)Sets over Air version to be used for all reports. static voidsetTheme(@Nullable() LuciqTheme theme)Sets a LuciqTheme used to customize Luciq's ui elements static voidsetNetworkAutoMaskingState(Feature.State state)Enable/Disable network logs auto masking static voidsetNetworkLogBodyEnabled(boolean shouldEnableBody)Enable/Disable network Body logs static voidsetScreenshotCaptureDelay(int delay)Delay capture screenshot static voidsetAppVariant(@Nullable() String appVariant)Sets App Variant to be used for all reports. static voidaddFeatureFlag(LuciqFeatureFlag featureFlag)Adds feature flag to sent with reports to BR / CR / SV3 static voidaddFeatureFlags(List<LuciqFeatureFlag> featureFlagsList)Adds features flags to sent with reports to BR / CR / SV3 static voidremoveFeatureFlag(List<String> keys)remove features flags from features flags table on database based on specific keys static voidremoveAllFeatureFlags()remove all features flags from features flags table on database based on specific keys static voidremoveFeatureFlag(String key)remove feature flag from features flags table on database based on specific key static voidshouldCaptureDialogs(boolean shouldCapture)capture dialogs when taking screenshot based on boolean static voidshouldCaptureSurfaceView(boolean shouldCapture)capture surface views when taking screenshot without using media projection based on boolean static voidcaptureScreenshot()Capture a screenshot manually and add it to visual user steps used with different Luciq components static voidsetNetworkLogListener(@Nullable() NetworkLogListener listener)Set a network logs listener to modify and filter network logs captured by the SDK static URLConnectionopenMonitoredConnection(@Nullable() URL url)Open a URLConnection from a URL which will be monitored by Luciq -
-
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 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
-
getTheme
@Nullable() static LuciqColorTheme getTheme()
- Returns:
current SDK LuciqColorTheme
- Since:
3.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 ignoredfileNameWithExtension- 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 ignoredfileNameWithExtension- 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.
-
getUserData
static String getUserData()
- Returns:
user data added before using setUserData
-
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
-
getUserEmail
static String getUserEmail()
- Returns:
user's email entered using identifyUser or in Luciq Feedback form
-
getUserUUID
static void getUserUUID(@NonNull() OnUserUUIDReadyCallback callback)
- Parameters:
callback- OnUserUUIDReadyCallback will be called after getting the uuid with the user UUID it will be called in main thread UUID will be null if the SDK wasn't built or SDK is disabled
-
getAppToken
@Nullable() static String getAppToken()
- Returns:
application token entered using Builder
-
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)
-
getApplicationContext
@Nullable() static Context getApplicationContext()
- Returns:
Holder application of Luciq SDK
-
logoutUser
static void logoutUser()
Logout user.
- Since:
4.0.0
-
isBuilt
static boolean isBuilt()
- Returns:
trueif Luciq.Builder().build() was called Luciq,falseif not
-
isEnabled
static boolean isEnabled()
- Returns:
trueif Luciq is enabled,falseif 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)
-
getLocale
static Locale getLocale(@Nullable() Context context)
Get currently used Locale of Luciq
- Returns:
locale used in Luciq
-
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
-
setCustomTextPlaceHolders
static void setCustomTextPlaceHolders(@NonNull() LuciqCustomTextPlaceHolder luciqCustomTextPlaceHolder)
Allows replacing all the text displayed in luciq with a custom text
- Parameters:
luciqCustomTextPlaceHolder- LuciqCustomTextPlaceHolder- Since:
v3
-
getAllUserAttributes
@Nullable() static HashMap<String, String> getAllUserAttributes()
Gets all saved user attributes.
- Returns:
all user attributes as HashMap
- Since:
3.2.0
-
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 attributevalue- the value- Since:
3.2.0
-
getUserAttribute
@Nullable() static String getUserAttribute(@NonNull() String key)
Gets specific user attribute.
- Parameters:
key- the attribute key as string- Returns:
the desired user attribute
- 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
-
getFirstRunAt
static Date getFirstRunAt()
-
isAppOnForeground
static boolean isAppOnForeground()
-
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
-
setSessionProfilerState
static void setSessionProfilerState(@NonNull() Feature.State state)
Enable/disable session profiler
- Parameters:
state- desired state of the session profiler feature
-
setTrackingUserStepsState
static void setTrackingUserStepsState(@NonNull() Feature.State state)
Enable/disable automatic user steps tracking
- Parameters:
state- desired state of automatic user step tracking feature
-
setReproConfigurations
static void setReproConfigurations(ReproConfigurations configurations)
Sets a ReproConfigurations controlling repro steps with each type of report
- Parameters:
configurations- the configurations object to be set and used by Luciq.
-
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
-
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.
-
removePrivateViews
static void removePrivateViews(@NonNull() Array<View> views)
-
removeAllPrivateViews
static void removeAllPrivateViews()
Removes all added private views
-
isBuilding
static boolean isBuilding()
-
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 masking type is MASK_NOTHING
-
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 usedoverAirVersionType- to Determine whatever the type is Expo or code push
-
setTheme
static void setTheme(@Nullable() LuciqTheme theme)
Sets a LuciqTheme used to customize Luciq's ui elements
- Parameters:
theme- the theme to be set and used by Luciq.
-
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
-
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.
-
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
-
setNetworkLogListener
static void setNetworkLogListener(@Nullable() NetworkLogListener listener)
Set a network logs listener to modify and filter network logs captured by the SDK
-
openMonitoredConnection
@Nullable() static URLConnection openMonitoredConnection(@Nullable() URL url)
Open a URLConnection from a URL which will be monitored by Luciq
-
-
-
-