NexusPlatform class abstract
The native surface of the SDK: device/app context and (native-backed) session replay capture. Platform implementations (Kotlin/Swift/web) provide these; the pure-Dart services (events, errors, logs, realtime, …) work without native code.
- Inheritance
-
- Object
- PlatformInterface
- NexusPlatform
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
appIsForeground(
) → Future< bool> -
Whether the app is in the foreground. Answered authoritatively on iOS
(
UIApplication.applicationState), where a VoIP push can launch the app in the BACKGROUND and no permission dialog can be presented. Defaults to true where unimplemented, preserving the caller's normal behaviour. -
configureCrashReporting(
bool enabled) → Future< void> - Install (or remove) the native uncaught-exception / signal handlers that persist crashes for forwarding on the next launch. No-op where unsupported.
-
deviceInfo(
) → Future< Map< String, Object?> > - Device + OS + app context (osType, osVersion, deviceModel, appVersion, …).
-
endLiveActivity(
int id) → Future< void> - Remove an Android live ongoing notification (end of a live activity).
-
getPlatformVersion(
) → Future< String?> -
liveActivityEnd(
{required String activityId, Map< String, dynamic> ? finalContentState}) → Future<void> - End a running iOS Live Activity.
-
liveActivityObservePushToStart(
String activityType) → Future< void> - Observe push-to-start tokens (iOS 17.2+) for an activity type; tokens are delivered via onLiveActivityToken.
-
liveActivityStart(
{required String activityId, required String activityType, required Map< String, dynamic> contentState, Map<String, dynamic> ? attributes}) → Future<void> - Start an iOS Live Activity (ActivityKit) with the turn-key default attributes. The native side registers its update token via onLiveActivityToken.
-
liveActivityUpdate(
{required String activityId, required Map< String, dynamic> contentState}) → Future<void> - Update a running iOS Live Activity's content state.
-
micPermissionStatus(
) → Future< String?> -
The OS microphone authorization:
granted|denied|restricted|undetermined. Null where unimplemented (callers then fall back topermission_handler). iOS only — and necessary there becausepermission_handlercannot distinguish "never asked" from "refused". -
micRequestPermission(
) → Future< bool?> -
Ask the OS for the microphone and return whether it was granted, using the
platform's own API rather than a permission package. Null where
unimplemented, so callers fall back to
permission_handler. iOS only. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onLiveActivityToken(
void sink(Map< String, dynamic> info)) → void -
Register a sink for ActivityKit tokens.
infocarries{ kind: 'pushToStart'|'update', activityType?, activityId?, token }. -
onNativeCallAudioSession(
void sink(bool active)) → void -
Register a sink for the external call system's audio-session window (iOS
CallKit
didActivate/didDeactivate). The media engine may only run its audio engine while this istrue. -
onNativeCallControl(
void sink(String action, String callId, Object? value)) → void -
Register a sink for in-call controls the user drove from the SYSTEM call UI
(mute / hold / DTMF keypad).
actionismute|hold|dtmf;valueis the bool or digit string. iOS/CallKit only — Android's self-managed UI has no system in-call controls. -
onNativeCallEvent(
void sink(String action, String callId)) → void -
Register a sink for native call actions the user took in the SYSTEM UI.
actionisanswer|reject|disconnect;callIdidentifies the call. -
onNativeVoicePush(
void sink(Map< String, dynamic> info)) → void - Register a sink for incoming-call payloads delivered natively (iOS APNs VoIP/PushKit). On Android the equivalent arrives as an FCM data message handled in Dart, so this never fires there.
-
onNativeVoipToken(
void sink(String token)) → void - Register a sink for APNs VoIP token updates (iOS PushKit).
-
onNotificationTap(
void sink(Map< String, dynamic> info)) → void -
Register a sink for taps on notifications posted via showNotification.
Receives the decoded
payloadmap so the caller can attribute the open. -
onReplayBatch(
void sink(String recordingId, List< Object?> events)) → void - Register a sink for batches of replay events pushed up from native.
-
showLiveActivity(
{required int id, required String channelId, required String channelName, String? title, String? body, String? subText, int? progress, bool indeterminate = false, bool ongoing = true, String? payload}) → Future< bool> -
Post or update an Android live ongoing notification (the Android equivalent
of an iOS Live Activity). Uses a promoted Live Update (ProgressStyle) on
Android 16+, a normal ongoing notification with a progress bar otherwise.
Returns
trueif shown. -
showNotification(
{required int id, String? title, String? body, required String channelId, required String channelName, String? payload, String? largeIcon, String? bigPicture, String? smallIcon, String? visibility, String? accentColor, List< Map< ? buttons}) → Future<String, String?> >bool> -
Post a notification from native code (used to render foreground pushes on
Android, since FCM does not draw one while the app is open). Returns
trueif it was shown. No-op /falsewhere unsupported.payloadis stashed on the tap intent and delivered back via onNotificationTap. -
startReplay(
String recordingId) → Future< void> -
Begin native session-replay capture for
recordingId. No-op where the native SDK isn't present (web/desktop today). -
stopReplay(
) → Future< void> - Stop native session-replay capture.
-
takePendingCrashes(
) → Future< List< Map< >String, Object?> > -
Return and clear native crashes persisted since the last launch. Each map:
{ type, message, stack (frames or string), platform, timestamp }. -
toString(
) → String -
A string representation of this object.
inherited
-
voiceEndCall(
String callId) → Future< void> - End a native call (local hangup / remote-left) so the system UI clears.
-
voiceMissedCall(
{required String callId, required String from, String? displayName, String? avatarUrl}) → Future< void> - The caller cancelled before we answered — clear the ring and leave a "Missed call" notification, like a native phone call.
-
voiceRegisterAccount(
) → Future< void> - Register the self-managed phone account so the OS routes our calls through the native call UI. Call once at startup. No-op where unsupported.
-
voiceReportConnected(
String callId) → Future< void> - Tell the OS the call connected (starts its timer / active-call UI).
-
voiceReportIncoming(
{required String callId, required String from, String? displayName, String? avatarUrl, bool hasVideo = false}) → Future< void> -
Ask the OS to ring
callIdin the SYSTEM call UI (over the lock screen). The call is answered NATIVELY — the app is never forced open. -
voiceReportOutgoing(
{required String callId, required String to, String? displayName}) → Future< void> - Start a native OUTGOING call entry. iOS only in practice: under CallKit the audio session is activated only for a call the OS knows about, so an unreported outbound call has no audio. Android deliberately skips this (a self-managed outgoing Connection can auto-end and tear down a live call).
-
voiceVoipToken(
) → Future< String?> - The device's APNs VoIP (PushKit) token, registered with the Voice control plane so a killed app can be rung. Null off iOS / before the token arrives.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ NexusPlatform
-
getter/setter pair