Countly class

Properties

content → ContentBuilderInternal
no setter
deviceId → DeviceID
no setter
feedback Feedback
no setter
hashCode int
The hash code for this object.
no setterinherited
remoteConfig RemoteConfig
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sessions Sessions
no setter
userProfile UserProfile
no setter
views Views
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

deviceIDType Map<String, String>
getter/setter pair
instance Countly
final
lastUsedRCID int
getter/setter pair
messagingMode Map<String, String>
getter/setter pair

Static Methods

addCrashLog(String logs) Future<String?>
add logs to your crash report. You can leave crash breadcrumbs which would describe previous steps that were taken in your app before the crash. They will be sent together with the crash report if the app crashes. returns the error or success message
appLoadingFinished() Future<String?>
Call this function when app is loaded, so that the app launch duration can be recorded. Should be called after init. returns the error or success message
askForFeedback(String widgetId, String? closeButtonText) Future<String?>
Show feedback widget associated with provided ID. returns the error or success message
askForNotificationPermission() Future<String?>
This method will ask for permission, enables push notification and send push token to countly server. Should be call after Countly init returns the error or success message
askForStarRating() Future<String?>
display star rating to users. returns the error or success message
beginSession() Future<String?>
Starts session for manual session handling. This method needs to be called for starting a session only if manual session handling is enabled by calling the 'enableManualSessionHandling' method of 'CountlyConfig'. returns the error or success message
cancelTrace(String traceKey) Future<String?>
cancel a trace returns error or success message
changeDeviceId(String newDeviceID, bool onServer) Future<String?>
change the device ID if onServer is true, the old device ID is replaced with the new one and all data associated with the old device ID will be merged automatically. if onServer is false, the new device ID will be counted as a new device on the server. returns the error or success message
clearAllTraces() Future<String?>
cancel all traces returns error or success message
disableLocation() Future<String?>
Disable User Location tracking returns the error or success message
disablePushNotifications() Future<String?>
Disable push notifications feature, by default it is enabled. Currently implemented for iOS only Should be called before Countly init returns the error or success message
enableApm() Future<String?>
Enable APM features, which includes the recording of app start time. Should be call before Countly init returns error or success message
enableAttribution() Future<String?>
Enable campaign attribution reporting to Countly. This does not do anything returns error message
enableCrashReporting() Future<String?>
Enable crash reporting to report uncaught errors to Countly. Should be call before Countly init returns error or success message
enableParameterTamperingProtection(String salt) Future<String?>
Set the optional salt to be used for calculating the checksum of requested data which will be sent with each request, using the &checksum field Should be call before Countly init returns the error or success message
endEvent(Map<String, Object> options) Future<String?>
ends a timed event returns error or success message
endSession() Future<String?>
End session for manual session handling. This method needs to be called for ending a session only if manual session handling is enabled by calling the 'enableManualSessionHandling' method of 'CountlyConfig'. returns the error or success message
endTrace(String traceKey, Map<String, int>? customMetric) Future<String?>
end a trace returns error or success message
eventSendThreshold(int limit) Future<String?>
Events get grouped together and are sent either every minute or after the unsent event count reaches a threshold. By default it is 10 Should be call before Countly init returns the error or success message
getAvailableFeedbackWidgets() Future<FeedbackWidgetsResponse>
Get a list of available feedback widgets for this device ID returns FeedbackWidgetsResponse
getCurrentDeviceId() Future<String?>
Get currently used device Id. Should be call after Countly init returns the error message or deviceID
getDeviceIDType() Future<DeviceIdType?>
Get currently used device Id type. Should be call after Countly init returns the error message or deviceID type
getFeedbackWidgetData(CountlyPresentableFeedback widgetInfo, {dynamic onFinished(Map<String, dynamic> widgetData, String? error)?}) Future<List>
Downloads widget info and returns widgetData, error CountlyPresentableFeedback widgetInfo - identifies the specific widget for which you want to download widget data returns a List widgetData and error message if any.
getRemoteConfigValueForKey(String key, dynamic callback(String?)) Future<String?>
Clear all remote config values. returns the error message or remote config value
giveAllConsent() Future<String?>
Give consent for all features Should be call after Countly init returns the error or success message
giveConsent(List<String> consents) Future<String?>
Give consent for specific features. returns the error or success message
giveConsentInit(List<String> consents) Future<String?>
Give consent for specific features. Should be call before Countly init returns the error or success message
increment(String keyName) Future<String?>
Increment user property by 1 returns the error or success message
incrementBy(String keyName, int keyIncrement) Future<String?>
Increment user property by provided value returns the error or success message
init(String serverUrl, String appKey, [String? deviceId]) Future<String?>
Initialize the SDK This should only be called once returns the error or success message
initWithConfig(CountlyConfig config) Future<String?>
Initialize the SDK This should only be called once returns the error or success message
isInitialized() Future<bool>
returns if SDK is initialized
log(String? message, {LogLevel logLevel = LogLevel.DEBUG}) → void
logException(String exception, bool nonfatal, [Map<String, Object>? segmentation]) Future<String?>
Report a handled or unhandled exception/error to Countly.
logExceptionEx(Exception exception, bool nonfatal, {StackTrace? stacktrace, Map<String, Object>? segmentation}) Future<String?>
Report a handled or unhandled exception/error to Countly.
logExceptionManual(String message, bool nonfatal, {StackTrace? stacktrace, Map<String, Object>? segmentation}) Future<String?>
Report a handled or unhandled exception/error to Countly.
manualSessionHandling() Future<String?>
Enable manual session handling Should be called before init. Only implemented for iOS platform. returns the error or success message
multiply(String keyName, int multiplyValue) Future<String?>
Multiply user property by provided value returns the error or success message
onNotification(dynamic callback(String)) Future<String?>
Set callback to receive push notifications @param { callback listner } callback returns the error message or an empty string if there is no error
presentFeedbackWidget(CountlyPresentableFeedback widgetInfo, String closeButtonText, {VoidCallback? widgetShown, VoidCallback? widgetClosed}) Future<String?>
Present a chosen feedback widget CountlyPresentableFeedback widgetInfo - Get available list of feedback widgets by calling 'getAvailableFeedbackWidgets()' and pass the widget object as a parameter. String closeButtonText - Text for cancel/close button. VoidCallback? widgetShown Callback to be executed when feedback widget is displayed VoidCallback? widgetClosed Callback to be executed when feedback widget is closed Note: widgetClosed is only implemented for iOS returns error or success message
presentRatingWidgetWithID(String widgetId, {String? closeButtonText, dynamic ratingWidgetCallback(String? error)?}) Future<String?>
Displays the feedback widget for the given ID returns the error or success message
pullValue(String type, String pullValue) Future<String?>
remove value from array returns the error or success message
pushTokenType(String tokenType) Future<String?>
Set messaging mode for push notifications Should be call before Countly init returns the error or success message
pushUniqueValue(String type, String pushUniqueValue) Future<String?>
insert value to custom property array if value does not exist returns the error or success message
pushValue(String type, String pushValue) Future<String?>
insert value to array which can have duplicates returns the error or success message
recordAttributionID(String attributionID) Future<String?>
set attribution Id for campaign attribution reporting. If this is call for iOS then 'attributionID' is IDFA If this is call for Android then 'attributionID' is ADID returns error or success message
recordDartError(dynamic exception, StackTrace stack) Future<void>
Callback to catch and report Dart errors, enableCrashReporting() must call before initWithConfig to make it work.
recordDirectAttribution(String campaignType, String campaignData) Future<String?>
set direct attribution Id for campaign attribution reporting. returns error or success message
recordEvent(Map<String, Object> options) Future<String?>
Records an event returns the error or success message
recordIndirectAttribution(Map<String, String> attributionValues) Future<String?>
set indirect attribution Id for campaign attribution reporting. Use 'AttributionKey' to set key of IDFA and ADID returns error or success message
recordNetworkTrace(String networkTraceKey, int responseCode, int requestPayloadSize, int responsePayloadSize, int startTime, int endTime) Future<String?>
record a network trace returns error or success message
recordView(String view, [Map<String, Object>? segmentation]) Future<String?>
Record custom view to Countly.
remoteConfigClearValues(dynamic callback(String?)) Future<String?>
Clear all remote config values. returns the error or success message
remoteConfigUpdate(dynamic callback(String?)) Future<String?>
Replace all stored remote config values with new ones from the server. returns the error or success message
removeAllConsent() Future<String?>
Remove consent for all features. returns the error or success message
removeConsent(List<String> consents) Future<String?>
Remove consent for specific features. returns the error or success message
removeDifferentAppKeysFromQueue() Future<String?>
Removes all requests with a different app key in request queue. In request queue, if there are any request whose app key is different than the current app key, these requests will be removed from request queue. returns the error or success message
replaceAllAppKeysInQueueWithCurrentAppKey() Future<String?>
Replaces all requests with a different app key with the current app key. In request queue, if there are any request whose app key is different than the current app key, these requests' app key will be replaced with the current app key. returns the error or success message
reportFeedbackWidgetManually(CountlyPresentableFeedback widgetInfo, Map<String, dynamic> widgetData, Map<String, Object> widgetResult) Future<String?>
Report widget info and do data validation CountlyPresentableFeedback widgetInfo - identifies the specific widget for which the feedback is filled out Map<String, dynamic> widgetData - widget data for this specific widget Map<String, Object> widgetResult - segmentation of the filled out feedback. If this segmentation is null, it will be assumed that the survey was closed before completion and mark it appropriately returns error or success message
saveMax(String keyName, int saveMax) Future<String?>
Save max of current value and provided value returns the error or success message
saveMin(String keyName, int saveMin) Future<String?>
Save min of current value and provided value returns the error or success message
setCustomCrashSegment(Map<String, Object> segments) Future<String?>
Set optional key/value segment added for crash reports. Should be call before Countly init returns error or success message
setHttpPostForced(bool isEnabled) Future<String?>
Set to 'true' if you want HTTP POST to be used for all requests Should be call before Countly init returns the error or success message
setLocation(String latitude, String longitude) Future<String?>
set the user location. returns the error or success message
setLocationInit(String countryCode, String city, String gpsCoordinates, String ipAddress) Future<String?>
Set user initial location Should be call before init returns the error or success message
setLoggingEnabled(bool flag) Future<String?>
Set to true if you want to enable countly internal debugging logs Should be call before Countly init returns the error or success message
setOnce(String keyName, String setOnce) Future<String?>
Set value to provided value if it does not exist returns the error or success message
setOptionalParametersForInitialization(Map<String, Object> options) Future<String?>
Set user location Should be called before init. returns the error or success message
setProperty(String keyName, String keyValue) Future<String?>
Set custom user property returns the error or success message
setRemoteConfigAutomaticDownload(dynamic callback(String?)) Future<String?>
Set Automatic value download happens when the SDK is initiated or when the device ID is changed. Should be call before Countly init returns the error or success message
setRemoteConfigCallback(dynamic callback(String? error)) → void
For registering a callback that is called when a remote config download is completed
setRequiresConsent(bool flag) Future<String?>
Set that consent should be required for features to work. Should be call before Countly init returns the error or success message
setStarRatingDialogTexts(String starRatingTextTitle, String starRatingTextMessage, String starRatingTextDismiss) Future<String?>
Set's the text's for the different fields in the star rating dialog. Set value null if for some field you want to keep the old value String starRatingTextTitle - dialog's title text (Only for Android) String starRatingTextMessage - dialog's message text String starRatingTextDismiss - dialog's dismiss buttons text (Only for Android) returns the error or success message
setUserData(Map<String, Object> options) Future<String?>
Sets the user data. Should be called after init. returns the error or success message
setUserLocation({String? countryCode, String? city, String? gpsCoordinates, String? ipAddress}) Future<String?>
Set user location String country_code - ISO Country code for the user's country String city - Name of the user's city String gpsCoordinates - comma separate lat and lng values. For example, "56.42345,123.45325" String ipAddress - ip address All parameters are optional, but at least one has to be set returns the error or success message
start() Future<String?>
Starts automatic session tracking. Does nothing returns the error message
startEvent(String key) Future<String?>
starts a timed event returns error or success message
startTrace(String traceKey) Future<String?>
record duration of application processes returns error or success message
stop() Future<String?>
Stops automatic session tracking. Does nothing returns the error message
storedRequestsLimit() Future<String?>
This flag limits the number of requests that can be stored in the request queue when the Countly server is unavailable or unreachable. If the number of requests in the queue reaches the limit, the oldest requests in the queue will be dropped. Should be called before init. returns the error or success message
throwNativeException() Future<String?>
Call used for testing error handling Should not be used
updateRemoteConfigExceptKeys(List<String> keys, dynamic callback(String?)) Future<String?>
Replace remote config values (except provided keys) with new ones from the server. returns the error or success message
updateRemoteConfigForKeysOnly(List<String> keys, dynamic callback(String?)) Future<String?>
Replace specific remote config values with new ones from the server. returns the error or success message
updateSession() Future<String?>
Update session for manual session handling. This method needs to be called for updating a session only if manual session handling is enabled by calling the 'enableManualSessionHandling' method of 'CountlyConfig'. returns the error or success message
updateSessionInterval(int sessionInterval) Future<String?>
Sets the interval for the automatic session update calls min value 1 (1 second), max value 600 (10 minutes) int sessionInterval- delay in seconds returns the error or success message
updateSessionPeriod() Future<String?>
Sets the duration between session updates. Does nothing returns the error message

Constants

BUILDING_WITH_PUSH_DISABLED → const bool
ignore: constant_identifier_names
tag → const String
temporaryDeviceID → const String