Countly class

Properties

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?>
appLoadingFinished() Future<String?>
Call this function when app is loaded, so that the app launch duration can be recorded. Should be called after init.
askForFeedback(String widgetId, String? closeButtonText) Future<String?>
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
askForStarRating() Future<String?>
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'.
cancelTrace(String traceKey) Future<String?>
changeDeviceId(String newDeviceID, bool onServer) Future<String?>
clearAllTraces() Future<String?>
disableLocation() Future<String?>
Disable User Location tracking
disablePushNotifications() Future<String?>
Disable push notifications feature, by default it is enabled. Currently implemented for iOS only Should be called before Countly init
enableApm() Future<String?>
Enable APM features, which includes the recording of app start time. Should be call before Countly init
enableAttribution() Future<String?>
Enable campaign attribution reporting to Countly.
enableCrashReporting() Future<String?>
Enable crash reporting to report uncaught errors to Countly. Should be call before Countly init
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
endEvent(Map<String, Object> options) Future<String?>
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'.
endTrace(String traceKey, Map<String, int>? customMetric) Future<String?>
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
getAvailableFeedbackWidgets() Future<FeedbackWidgetsResponse>
Get a list of available feedback widgets for this device ID
getCurrentDeviceId() Future<String?>
Get currently used device Id. Should be call after Countly init
getDeviceIDType() Future<DeviceIdType?>
Get currently used device Id type. Should be call after Countly init
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
getRemoteConfigValueForKey(String key, dynamic callback(String?)) Future<String?>
giveAllConsent() Future<String?>
Give consent for all features Should be call after Countly init
giveConsent(List<String> consents) Future<String?>
giveConsentInit(List<String> consents) Future<String?>
Give consent for specific features. Should be call before Countly init
increment(String keyName) Future<String?>
incrementBy(String keyName, int keyIncrement) Future<String?>
init(String serverUrl, String appKey, [String? deviceId]) Future<String?>
initWithConfig(CountlyConfig config) Future<String?>
isInitialized() Future<bool>
isNullOrEmpty(String? s) bool
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?>
multiply(String keyName, int multiplyValue) Future<String?>
onNotification(dynamic callback(String)) Future<String?>
Set callback to receive push notifications @param { callback listner } callback
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
presentRatingWidgetWithID(String widgetId, {String? closeButtonText, dynamic ratingWidgetCallback(String? error)?}) Future<String?>
pullValue(String type, String pullValue) Future<String?>
pushTokenType(String tokenType) Future<String?>
Set messaging mode for push notifications Should be call before Countly init
pushUniqueValue(String type, String pushUniqueValue) Future<String?>
pushValue(String type, String pushValue) Future<String?>
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
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.
recordEvent(Map<String, Object> options) Future<String?>
recordIndirectAttribution(Map<String, String> attributionValues) Future<String?>
set indirect attribution Id for campaign attribution reporting. Use 'AttributionKey' to set key of IDFA and ADID
recordNetworkTrace(String networkTraceKey, int responseCode, int requestPayloadSize, int responsePayloadSize, int startTime, int endTime) Future<String?>
recordView(String view, [Map<String, Object>? segmentation]) Future<String?>
Record custom view to Countly.
remoteConfigClearValues(dynamic callback(String?)) Future<String?>
remoteConfigUpdate(dynamic callback(String?)) Future<String?>
removeAllConsent() Future<String?>
removeConsent(List<String> consents) Future<String?>
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.
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.
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
saveMax(String keyName, int saveMax) Future<String?>
saveMin(String keyName, int saveMin) Future<String?>
setCustomCrashSegment(Map<String, Object> segments) Future<String?>
Set optional key/value segment added for crash reports. Should be call before Countly init
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
setLocation(String latitude, String longitude) Future<String?>
setLocationInit(String countryCode, String city, String gpsCoordinates, String ipAddress) Future<String?>
Set user initial location Should be call before init
setLoggingEnabled(bool flag) Future<String?>
Set to true if you want to enable countly internal debugging logs Should be call before Countly init
setOnce(String keyName, String setOnce) Future<String?>
setOptionalParametersForInitialization(Map<String, Object> options) Future<String?>
setProperty(String keyName, String keyValue) Future<String?>
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
setRemoteConfigCallback(dynamic callback(String? error)) → void
setRequiresConsent(bool flag) Future<String?>
Set that consent should be required for features to work. Should be call before Countly init
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)
setUserData(Map<String, Object> options) Future<String?>
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
start() Future<String?>
startEvent(String key) Future<String?>
startTrace(String traceKey) Future<String?>
stop() Future<String?>
storedRequestsLimit() Future<String?>
throwNativeException() Future<String?>
Call used for testing error handling Should not be used
updateRemoteConfigExceptKeys(List<String> keys, dynamic callback(String?)) Future<String?>
updateRemoteConfigForKeysOnly(List<String> keys, dynamic callback(String?)) Future<String?>
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'.
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
updateSessionPeriod() Future<String?>

Constants

BUILDING_WITH_PUSH_DISABLED → const bool
ignore: constant_identifier_names
tag → const String