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

NexusPlatform()

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?>
installReferrer() → Future<String?>
Android only: the Google Play install referrer (e.g. link_click_id=…), or null where unavailable (iOS, sideloaded, not yet installed via Play).
linksConfigure(List<String> hosts) → Future<void>
Tell native which hosts serve Nexus short links, so it can consume them (keep them away from the app's router) on the NEXT cold start too.
linksTakePending() → Future<List<String>>
Deep links (Nexus links). Native code sees every URL that opens the app before Flutter does; it queues them until Dart asks, so a cold-start link is never lost to the engine starting first. Returns the queued URLs and switches native to live delivery via onLinkOpened.
liveActivityCacheImages(List<String> urls) → Future<void>
iOS: download template images into the App Group so the widget can show them.
liveActivityEnd({required String activityId, Map<String, dynamic>? finalContentState}) → Future<void>
End a running iOS Live Activity.
liveActivityObservePushToStart(String activityType) → Future<void>
Start observing ActivityKit: push-to-start tokens (iOS 17.2+), push-started activities' update tokens, and diagnostics — all via onLiveActivityToken.
liveActivityStart({required String activityId, required String activityType, required Map<String, dynamic> contentState, Map<String, dynamic>? attributes, Map<String, dynamic>? template}) → 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 to permission_handler). iOS only — and necessary there because permission_handler cannot 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
onLinkOpened(void sink(String url)) → void
Register a sink for links opened while the app is running.
onLiveActivityToken(void sink(Map<String, dynamic> info)) → void
Register a sink for ActivityKit tokens. info carries { kind: 'pushToStart'|'update', activityType?, activityId?, token } or a diagnostic { kind: 'status', event, … }.
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 is true.
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). action is mute | hold | dtmf; value is 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. action is answer | reject | disconnect; callId identifies 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 url)) → 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 payload map 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.
shieldAppAttest(Uint8List clientDataHash, {bool forceAttest = false}) → Future<Map<String, Object?>?>
iOS: attest (first time) or assert with the App Attest key over clientDataHash. Returns {keyId, attestation|assertion, mode}.
shieldAppAttestReset() → Future<void>
iOS: forget the App Attest key id (the next call attests a new key).
shieldAppAttestSupported() → Future<bool>
iOS: whether App Attest works here (false on the Simulator).
shieldDeleteKey(String alias) → Future<void>
Delete the device key (a fresh, freshly-attested one is made next time).
shieldEnsureKey(String alias, {Uint8List? attestationChallenge}) → Future<Map<String, Object?>?>
Ensure the hardware-backed device key alias exists and return its public key: {x, y} (base64url P-256 coordinates), chain (Android attestation certificates, base64 DER, leaf first; empty on iOS), hardware (strongbox|tee|secure_enclave|software) and created. A newly created Android key is certified for attestationChallenge. Null where unsupported.
shieldPlayIntegrity(String cloudProjectNumber, String requestHash) → Future<String?>
Android: a Play Integrity standard token whose request hash is requestHash.
shieldSign(String alias, Uint8List data) → Future<Uint8List?>
ECDSA-SHA256 signature (DER) of data with the device key.
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 true if shown.
showLiveActivityTemplate({required int id, required Map<String, dynamic> payload}) → Future<bool>
Render a Nexus Live Activity template on Android: a promoted Live Update (ProgressStyle — segments/points/tracker icon, status chip, ETA countdown) on Android 16+, an ongoing notification with a progress bar otherwise. payload is { event, activityId, template, data }. Returns true if 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<String, String?>>? buttons}) → Future<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 true if it was shown. No-op / false where unsupported. payload is 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 callId in 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