MethodChannelEmbrace class
An implementation of EmbracePlatform that uses method channels.
- Inheritance
-
- Object
- PlatformInterface
- EmbracePlatform
- MethodChannelEmbrace
Constructors
- MethodChannelEmbrace({Platform? platform})
- Constructs an instance of MethodChannelEmbrace
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isStarted → bool
-
Whether the SDK has been started.
no setteroverride
- methodChannel → MethodChannel
-
The method channel used to interact with the native platform.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addBreadcrumb(
String message) → void -
Adds a breadcrumb.
override
-
addSessionProperty(
String key, String value, {required bool permanent}) → void -
Annotates the session with a property defined by a
key
andvalue
.override -
addSpanAttribute(
String spanId, String key, String value) → Future< bool> -
Add an attribute to an active span with the given
spanId
. Returns true if the attribute is added and false otherwise.override -
addSpanEvent(
String spanId, String name, {int? timestampMs, Map< String, String> ? attributes}) → Future<bool> -
Create and add a Span Event with the given parameters to an active
span with the given
spanId
. Returns false if the event cannot be added.override -
addUserPersona(
String persona) → void -
Adds the current user persona to the provided
persona
.override -
attachToHostSdk(
{required bool enableIntegrationTesting}) → Future< bool> -
Starts the Embrace SDK.
override
-
clearAllUserPersonas(
) → void -
Clears the current users personas.
override
-
clearUserAsPayer(
) → void -
Clears the current user's payer status.
override
-
clearUserEmail(
) → void -
Clears the current user email.
override
-
clearUserIdentifier(
) → void -
Clears the current user identifier.
override
-
clearUserName(
) → void -
Clears the current user name.
override
-
clearUserPersona(
String persona) → void -
Clears the current user
persona
.override -
endSession(
{bool clearUserInfo = true}) → void -
Manually forces the end of the current session and starts a new session.
override
-
endView(
String name) → void -
Signifies that a view has been unmounted.
override
-
generateW3cTraceparent(
String? traceId, String? spanId) → Future< String?> -
Generates a W3C Traceparent.
override
-
getCurrentSessionId(
) → Future< String?> -
Returns the id of the current session.
override
-
getDeviceId(
) → Future< String?> -
Query the current device identifier.
override
-
getLastRunEndState(
) → Future< LastRunEndState> -
Returns the end state of the previous run of the application.
override
-
handleMethodCall(
MethodCall call) → Future - Callback used to process incoming method calls from the native method channel.
-
logBreadcrumb(
String message) → void -
Logs a breadcrumb.
override
-
logDartError(
String? stack, String? message, String? context, String? library, {String? errorType, bool wasHandled = false}) → void -
Sends information from a Dart error/exception to the host SDK
so that a log can be delivered.
override
-
logError(
String message, Map< String, String> ? properties) → void -
Log
message
and optionalproperties
using the error log level.override -
logInfo(
String message, Map< String, String> ? properties) → void -
Log
message
and optionalproperties
using the info log level.override -
logInternalError(
String message, String details) → void -
Logs an internal error within the SDK.
override
-
logNetworkRequest(
{required String url, required HttpMethod method, required int startTime, required int endTime, required int bytesSent, required int bytesReceived, required int statusCode, String? error, String? traceId, String? w3cTraceparent}) → void -
Log a network request.
override
-
logPushNotification(
{required String? title, required String? body, required String? subtitle, required int? badge, required String? category, required String? from, required String? messageId, required int? priority, required bool hasNotification, required bool hasData}) → void -
Logs a breadcrumb that indicates that the app received a push notification
override
-
logWarning(
String message, Map< String, String> ? properties) → void -
Log
message
and optionalproperties
using the warning log level.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recordCompletedSpan(
String name, int startTimeMs, int endTimeMs, {ErrorCode? errorCode, String? parentSpanId, Map< String, String> ? attributes, List<Map< ? events}) → Future<String, dynamic> >bool> -
Record a completed span with the given parameters.
Returns true if the span is recorded and false otherwise.
override
-
removeSessionProperty(
String key) → void -
Remove an existing property from the session
override
-
setUserAsPayer(
) → void -
Sets the current user as a payer.
override
-
setUserEmail(
String email) → void -
Sets the current user email to the provided
email
.override -
setUserIdentifier(
String id) → void -
Sets the current user identifier to the provided
id
.override -
setUserName(
String name) → void -
Sets the current user name to the provided
name
.override -
startSpan(
String name, {String? parentSpanId, int? startTimeMs}) → Future< String?> -
Create and start a new span. Returns the spanId of the new span
if both operations are successful, and null if either fails.
override
-
startView(
String name) → void -
Signifies that a view has been mounted.
override
-
stopSpan(
String spanId, {ErrorCode? errorCode, int? endTimeMs}) → Future< bool> -
Stop an active span. Returns true if the span is stopped after the
method returns and false otherwise.
override
-
throwIfNotStarted(
) → void - Throws a StateError if the SDK has not been started.
-
toString(
) → String -
A string representation of this object.
inherited
-
triggerAnr(
) → void -
Triggers an ANR (Application Not Responding).
override
-
triggerMethodChannelError(
) → void -
Triggers a
MethodChannel
error.override -
triggerNativeSdkError(
) → void -
Trigger a native SDK error.
override
-
triggerRaisedSignal(
) → void -
Triggers a raised signal.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- minimumAndroidVersion → const String
- Minimum Embrace Android SDK version compatible with this version of the Embrace Flutter SDK