Nexus & setup
Nexus & setup in the Flutter SDK.
import 'package:nexus_flutter/nexus.dart';| Symbol | Kind | Summary |
|---|---|---|
Nexus | class | The Nexus umbrella SDK — one entry point for every service. |
NexusDeepLinkHandler | typedef | Decide what to do with a Nexus deep link. |
NexusConfig | class | Configuration for Nexus.init. |
NexusLogLevel | enum | Verbosity of the SDK's diagnostic logging. |
NexusLogSink | typedef | A custom log sink — receive every record the SDK emits (e.g. |
NexusLog | class | Central, leveled logger for the SDK. |
NexusScope | class | Makes the initialised Nexus available through the widget tree, and — when session replay is enabled — installs the RepaintBoundary + pointer listener the recorder captures from. |
NexusBuildContext | extension | context.nexus — access the SDK from any widget. |
NexusPlatform | abstract class | The native surface of the SDK: device/app context and (native-backed) session replay capture. |
Nexus
classThe Nexus umbrella SDK — one entry point for every service. Initialise once at startup; then use any service, all correlated to the same journey session:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Nexus.init(const NexusConfig(apiKey: 'nxs_...'));
runApp(NexusScope(child: MyApp()));
}
// anywhere with a BuildContext:
context.nexus.events.track('order_placed');
context.nexus.realtime.join('orders:42');init()
static methodstatic Future<Nexus> init(NexusConfig config)Initialise the SDK once at startup. Re-calling disposes the previous instance and replaces it.
Parameters
Prop
Type
Returns Future<Nexus>
instance
static propertystatic Nexus get instanceThe app-wide instance. Throws if init hasn't run.
isInitialized
static propertystatic bool get isInitializeddistinctId
propertyString? get distinctIdsessionKey
propertyString get sessionKeypendingUploads
propertyint get pendingUploadsNumber of telemetry requests awaiting delivery (queued/offline).
View sourceconfig
fieldfinal NexusConfig configsessions
fieldfinal NexusSessions sessionsevents
fieldfinal NexusEvents eventserrors
fieldfinal NexusErrors errorslogs
fieldfinal NexusLogs logsflags
fieldfinal NexusFlags flagslinks
fieldfinal NexusLinks linksrealtime
fieldfinal NexusRealtime realtimereplay
fieldfinal NexusReplay replaysurveys
fieldfinal NexusSurveys surveysremoteConfig
fieldfinal NexusRemoteConfig remoteConfigpush
fieldfinal NexusPush pushinApp
fieldfinal NexusInApp inAppliveActivity
fieldfinal NexusLiveActivity liveActivityvoice
fieldfinal NexusVoice voiceidentify()
methodFuture<void> identify(String distinctId, {String? email, String? name, String? phone, Map<String, Object?>? traits})Identify the current end-user (shorthand for sessions.identify).
Parameters
Prop
Type
reset()
methodFuture<void> reset()Forget the current user and start a fresh session (e.g. on logout). Also clears the persisted identity so the next launch starts anonymous.
View sourcetrackScreen()
methodvoid trackScreen(String name)Record a screen/page change for session replay's Pages tab. Wire
NexusNavigatorObserver into navigatorObservers to do this automatically.
Parameters
Prop
Type
observeRouter()
methodvoid observeRouter(Listenable router, String Function() currentPath)Track navigation from a Listenable router (e.g. GoRouter's
routerDelegate) — catches shell/nested routes a root observer misses.
See NexusReplay.observeRouter.
Parameters
Prop
Type
flush()
methodFuture<void> flush()Flush all buffered telemetry into the outbox and try to deliver it now (call before the app is backgrounded/killed).
View sourcedispose()
methodvoid dispose()Tear down the instance (timers, socket, http).
View sourceNexusDeepLinkHandler
typedeftypedef NexusDeepLinkHandler = FutureOr<bool> Function(NexusDeepLink link)Decide what to do with a Nexus deep link. Return true when the app handled
the navigation itself; false lets the SDK route to NexusDeepLink.path.
NexusConfig
classConfiguration for Nexus.init.
NexusConfig
constructorconst NexusConfig({required this.apiKey, this.baseUrl = 'https://services.inverge.net', this.realtimeUrl, this.autoTrackSessions = true, this.autoCaptureErrors = true, this.autoConnectRealtime = false, this.manageRealtimeWithLifecycle = true, this.flushOnBackground = true, this.flushInterval = const Duration(seconds: 10), this.maxBatch = 50, this.logging = false, this.logLevel, this.onLog, this.replayEnabled = false, this.replayInterval = const Duration(milliseconds: 1000), this.replayPixelRatio = 1.0, this.replayMaskTextFields = true, this.replayCaptureConsole = true, this.replayCaptureNetwork = true, this.surveysEnabled = false, this.surveyAutoShow = true, this.inAppEnabled = false, this.inAppAutoShow = true, this.autoShowOverlay = true, this.liveActivityEnabled = false, this.voiceEnabled = false, this.remoteConfigEnabled = false, this.remoteConfigRealtime = false, this.remoteConfigDefaults = const {}, this.pushEnabled = false, this.pushAutoRequestPermission = true, this.pushWebVapidKey, this.pushForegroundDisplay = true, this.pushAndroidChannelId = 'nexus_default', this.pushAndroidChannelName = 'Notifications', this.linksEnabled = true, this.linkDomains = const [], this.autoRouteDeepLinks = true, this.onDeepLink, this.appVersion, this.defaultProperties = const {}})Parameters
Prop
Type
resolvedLogLevel
propertyNexusLogLevel get resolvedLogLevelEffective log level: explicit logLevel, else debug when logging is
on, else warn.
httpBase
propertyString get httpBasesocketBase
propertyString get socketBaseapiKey
fieldfinal String apiKeyTenant API key (nxs_...). Sent as x-api-key on HTTP and in the socket
handshake auth.
baseUrl
fieldfinal String baseUrlControl-plane / data-plane origin. Partner endpoints live under /partner.
realtimeUrl
fieldfinal String? realtimeUrlRealtime (Socket.IO) origin. Defaults to baseUrl when null.
autoTrackSessions
fieldfinal bool autoTrackSessionsStart (and keep alive) a journey session automatically. Default true.
autoCaptureErrors
fieldfinal bool autoCaptureErrorsInstall a Flutter error handler that reports uncaught errors. Default true.
autoConnectRealtime
fieldfinal bool autoConnectRealtimeOpen the realtime (Socket.IO) connection automatically at startup, right
after the session is established — so the user is live without a manual
nexus.realtime.connect(). Rooms are still joined via
nexus.realtime.join(...). Default false (realtime connection-minutes
are billed — opt in). Works with manageRealtimeWithLifecycle.
manageRealtimeWithLifecycle
fieldfinal bool manageRealtimeWithLifecycleGracefully disconnect realtime when the app is backgrounded and reconnect
(rejoining rooms) on foreground. This makes billed connection-minutes
accurate — the app isn't charged while suspended. Default true.
flushOnBackground
fieldfinal bool flushOnBackgroundFlush queued telemetry when the app is backgrounded (so nothing is lost if
the OS kills the app). Default true.
flushInterval
fieldfinal Duration flushIntervalHow often batched telemetry (events/logs) is flushed. Default 10s.
View sourcemaxBatch
fieldfinal int maxBatchMax items per batch flush. Default 50.
View sourcelogging
fieldfinal bool loggingShorthand for verbose logging: true maps to NexusLogLevel.debug.
Prefer logLevel for finer control. Default false.
logLevel
fieldfinal NexusLogLevel? logLevelDiagnostic log verbosity. When null, falls back to logging (debug if
on) and otherwise NexusLogLevel.warn — so failed requests and dropped
telemetry are always visible, while the happy path stays quiet.
onLog
fieldfinal NexusLogSink? onLogOptional sink to receive every log record (in addition to debugPrint),
e.g. to forward SDK diagnostics into your own logging.
replayEnabled
fieldfinal bool replayEnabledRecord session replay: periodic screenshots of the app + pointer events,
shipped as rrweb frames. Requires wrapping the app in NexusScope. Wrap
sensitive widgets in NexusMask to redact them. Default false (billed /
privacy-sensitive — opt in explicitly).
replayInterval
fieldfinal Duration replayIntervalHow often a replay frame is captured. Lower = smoother but more data/CPU. Default 1s. Identical consecutive frames are dropped automatically.
View sourcereplayPixelRatio
fieldfinal double replayPixelRatioCapture resolution as a multiple of logical pixels. 1.0 ≈ device-independent
resolution (small, fast); raise toward MediaQuery.devicePixelRatio for
crisper frames, lower (e.g. 0.75) to shrink payloads. Default 1.0.
replayMaskTextFields
fieldfinal bool replayMaskTextFieldsAutomatically redact every text input (anything backed by EditableText —
TextField, TextFormField, CupertinoTextField, SelectableText) from
replay frames, so typed content (passwords, PII) is never captured. On by
default; use NexusMask for finer control. Set false to opt out.
replayCaptureConsole
fieldfinal bool replayCaptureConsoleTee the app's debugPrint output into the replay stream so it shows in the
player's Console tab (mirrors rrweb's console plugin). SDK-internal
[Nexus] lines are skipped. On by default; set false to opt out.
replayCaptureNetwork
fieldfinal bool replayCaptureNetworkAutomatically capture HTTP requests for the player's Network tab via
HttpOverrides — covers both Dio and package:http (any dart:io
client) with no wiring. Requests to the Nexus API are excluded. On by
default (no effect on web — use a Dio interceptor there). Set false to
opt out (e.g. if the app installs its own HttpOverrides).
surveysEnabled
fieldfinal bool surveysEnabledFetch eligible in-product surveys at startup (and on foreground). Requires
NexusSurveyOverlay in your MaterialApp.builder to display them. Default
false (billed per response — opt in).
surveyAutoShow
fieldfinal bool surveyAutoShowAutomatically show eligible popover/banner surveys (and event-triggered
ones on events.track). Set false to present surveys manually via
nexus.surveys.show(...). Default true.
inAppEnabled
fieldfinal bool inAppEnabledFetch in-app messages at startup (and on foreground) and show them via the
NexusInAppOverlay. Default false — opt in.
inAppAutoShow
fieldfinal bool inAppAutoShowAutomatically show a triggered in-app message (session start / event). Set
false to present manually via nexus.inApp.show(...). Default true.
autoShowOverlay
fieldfinal bool autoShowOverlayAuto-mount the survey + in-app overlays without touching MaterialApp.builder
(the SDK inserts them into the app's root overlay). Default true. Set
false to mount NexusSurveyOverlay / NexusInAppOverlay yourself.
liveActivityEnabled
fieldfinal bool liveActivityEnabledEnable Live Activities: iOS receives ActivityKit push updates (Lock Screen /
Dynamic Island); Android renders a live ongoing notification from the
server's data message. Drive them from the dashboard/API or via
nexus.liveActivity. Default false.
voiceEnabled
fieldfinal bool voiceEnabledEnable Nexus Voice (CPaaS calling). Exposes nexus.voice — place/answer
calls, in-call controls, DTMF, quality. Register a media engine (WebRTC)
and optionally CallKit to actually carry audio / show the native call UI.
Default false.
pushEnabled
fieldfinal bool pushEnabledFetch Remote Config at startup (and on foreground). Read values via
nexus.remoteConfig.getString(...) etc. Default false (billed per fetch
— opt in). Set in-app fallbacks with remoteConfigDefaults.
Turn-key push notifications. When true, the SDK requests permission,
obtains the device's FCM token, registers it with Nexus, re-registers on
refresh, and reports notification opens — all automatically. You only need
the platform Firebase config (google-services.json / GoogleService-Info.plist).
Default false.
pushAutoRequestPermission
fieldfinal bool pushAutoRequestPermissionAsk the OS for notification permission when push is enabled. Default true;
set false to request it yourself at a better moment (then the token is
registered on the next launch, or call nexus.push.start()).
pushWebVapidKey
fieldfinal String? pushWebVapidKeyWeb only — the VAPID public key for FCM web push. Required to obtain a web token; ignored on iOS/Android.
View sourcepushForegroundDisplay
fieldfinal bool pushForegroundDisplayDisplay notifications while the app is in the foreground. FCM does not
draw a notification when the app is open — on Android nothing shows unless
the app renders it, and on iOS the banner is suppressed by default. With
this true (default) the SDK shows it for you: a native banner on iOS and
a local notification on Android, tap-attributed like a background open. Set
false if you handle FirebaseMessaging.onMessage yourself.
pushAndroidChannelId
fieldfinal String pushAndroidChannelIdAndroid channel id used for foreground notifications the SDK displays.
Match your server-side android.notification.channel_id to keep foreground
and background notifications on one channel. Default nexus_default.
pushAndroidChannelName
fieldfinal String pushAndroidChannelNameHuman-readable name for pushAndroidChannelId, shown in Android system
settings. Default Notifications.
linksEnabled
fieldfinal bool linksEnabledNexus Links, automatically: report the install on first launch (with the
Google Play install referrer on Android, for an exact match), report every
app open that came from a Nexus link, and route the user to the link's
deep-link value. No code needed. Default true.
linkDomains
fieldfinal List<String> linkDomainsExtra hosts that serve your Nexus short links (a branded domain). The
baseUrl host is always included.
autoRouteDeepLinks
fieldfinal bool autoRouteDeepLinksNavigate to a link's deep-link value when the app's router could not have
seen it itself: after an install (deferred deep link) and when the app was
opened by the short link directly (App Links / Universal Links). The SDK
delivers it as a platform deep link, so go_router, auto_route or a plain
Navigator route it exactly like one. Default true.
onDeepLink
fieldfinal NexusDeepLinkHandler? onDeepLinkCalled for every Nexus deep link before the SDK routes it — return true
to take over (e.g. hold it until after login; see
NexusLinks.consumePending).
remoteConfigEnabled
fieldfinal bool remoteConfigEnabledremoteConfigRealtime
fieldfinal bool remoteConfigRealtimeSubscribe to realtime Remote Config updates: when a new template is
published, the app re-fetches automatically (Firebase Realtime RC). Needs
a realtime connection (see autoConnectRealtime). Default false.
remoteConfigDefaults
fieldfinal Map<String, Object?> remoteConfigDefaultsIn-app default Remote Config values, used until/unless the server provides
a value for a key. Mirrors Firebase setDefaults.
appVersion
fieldfinal String? appVersionApp version reported with telemetry (e.g. from package_info). Optional.
View sourcedefaultProperties
fieldfinal Map<String, Object?> defaultPropertiesProperties merged into every event's/person's context.
View sourceNexusLogLevel
enumenum NexusLogLevelVerbosity of the SDK's diagnostic logging.
Higher levels include everything below them. The default is warn — silent
in the happy path, but surfacing dropped telemetry / failed requests so
problems (like a rejected session) never fail silently. Set
NexusConfig(logLevel: NexusLogLevel.debug) (or logging: true) to trace
every request while integrating.
| Value | Description |
|---|---|
NexusLogLevel.none | |
NexusLogLevel.error | |
NexusLogLevel.warn | |
NexusLogLevel.info | |
NexusLogLevel.debug |
NexusLogSink
typedeftypedef NexusLogSink = void Function(NexusLogLevel level, String message, [Object? error, StackTrace? stackTrace])A custom log sink — receive every record the SDK emits (e.g. to forward it
into your own logging, or into Nexus Logs). Set via NexusConfig.onLog.
NexusLog
classCentral, leveled logger for the SDK. Configured once from NexusConfig at
Nexus.init; every component logs through the static methods so output is
consistent ([Nexus] HH:mm:ss.SSS LEVEL message) and centrally gated.
Uses debugPrint (rate-limited, not stripped in profile builds) rather than
print, and additionally fans out to an optional NexusLogSink.
configure()
static methodstatic void configure({NexusLogLevel? level, NexusLogSink? sink})Apply configuration from NexusConfig. Called at the start of init.
Parameters
Prop
Type
error()
static methodstatic void error(String message, [Object? error, StackTrace? stackTrace])Parameters
Prop
Type
warn()
static methodstatic void warn(String message)Parameters
Prop
Type
info()
static methodstatic void info(String message)Parameters
Prop
Type
debug()
static methodstatic void debug(String message)Parameters
Prop
Type
mask()
static methodstatic String mask(String secret)Mask a secret for logs: keep a readable prefix + last 4 chars.
Parameters
Prop
Type
Returns String
level
static fieldstatic NexusLogLevel levelActive level. Below this, calls are cheap no-ops.
View sourcesink
static fieldstatic NexusLogSink? sinkOptional extra sink (in addition to debugPrint).
NexusScope
classclass NexusScope extends StatelessWidgetMakes the initialised Nexus available through the widget tree, and — when
session replay is enabled — installs the RepaintBoundary + pointer listener
the recorder captures from. Optional for access (context.nexus falls back
to the global Nexus.instance), but required for replay.
runApp(NexusScope(child: MyApp()));NexusScope
constructorconst NexusScope({super.key, this.nexus, required this.child})Parameters
Prop
Type
of()
static methodstatic Nexus of(BuildContext context)Parameters
Prop
Type
Returns Nexus
nexus
fieldfinal Nexus? nexusOverride instance (e.g. in tests). Defaults to Nexus.instance.
child
fieldfinal Widget childNexusBuildContext
extensionextension NexusBuildContext on BuildContextcontext.nexus — access the SDK from any widget.
nexus
propertyNexus get nexusThe app-wide Nexus instance. Use it as context.nexus.realtime,
context.nexus.events, context.nexus.errors, …
NexusPlatform
abstract classabstract class NexusPlatform extends PlatformInterfaceThe 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.
View sourceNexusPlatform
constructorNexusPlatform()instance
static propertystatic NexusPlatform get instancegetPlatformVersion()
methodFuture<String?> getPlatformVersion()Returns Future<String?>
deviceInfo()
methodFuture<Map<String, Object?>> deviceInfo()Device + OS + app context (osType, osVersion, deviceModel, appVersion, …).
Returns Future<Map<String, Object?>>
startReplay()
methodFuture<void> startReplay(String recordingId)Begin native session-replay capture for recordingId. No-op where the
native SDK isn't present (web/desktop today).
Parameters
Prop
Type
stopReplay()
methodFuture<void> stopReplay()Stop native session-replay capture.
View sourceonReplayBatch()
methodvoid onReplayBatch(void Function(String recordingId, List<Object?> events) sink)Register a sink for batches of replay events pushed up from native.
Parameters
Prop
Type
configureCrashReporting()
methodFuture<void> configureCrashReporting(bool enabled)Install (or remove) the native uncaught-exception / signal handlers that persist crashes for forwarding on the next launch. No-op where unsupported.
Parameters
Prop
Type
takePendingCrashes()
methodFuture<List<Map<String, Object?>>> takePendingCrashes()Return and clear native crashes persisted since the last launch. Each map:
{ type, message, stack (frames or string), platform, timestamp }.
Returns Future<List<Map<String, Object?>>>
showNotification()
methodFuture<bool> 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})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.
Parameters
Prop
Type
Returns Future<bool>
onNotificationTap()
methodvoid onNotificationTap(void Function(Map<String, dynamic> data) sink)Register a sink for taps on notifications posted via showNotification.
Receives the decoded payload map so the caller can attribute the open.
Parameters
Prop
Type
linksTakePending()
methodFuture<List<String>> linksTakePending()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.
Returns Future<List<String>>
onLinkOpened()
methodvoid onLinkOpened(void Function(String url) sink)Register a sink for links opened while the app is running.
Parameters
Prop
Type
linksConfigure()
methodFuture<void> linksConfigure(List<String> hosts)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.
Parameters
Prop
Type
installReferrer()
methodFuture<String?> installReferrer()Android only: the Google Play install referrer (e.g. link_click_id=…),
or null where unavailable (iOS, sideloaded, not yet installed via Play).
Returns Future<String?>
showLiveActivity()
methodFuture<bool> 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})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.
Parameters
Prop
Type
Returns Future<bool>
endLiveActivity()
methodFuture<void> endLiveActivity(int id)Remove an Android live ongoing notification (end of a live activity).
Parameters
Prop
Type
showLiveActivityTemplate()
methodFuture<bool> showLiveActivityTemplate({required int id, required Map<String, dynamic> payload})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.
Parameters
Prop
Type
Returns Future<bool>
liveActivityCacheImages()
methodFuture<void> liveActivityCacheImages(List<String> urls)iOS: download template images into the App Group so the widget can show them.
Parameters
Prop
Type
liveActivityStart()
methodFuture<void> liveActivityStart({required String activityId, required String activityType, required Map<String, dynamic> contentState, Map<String, dynamic>? attributes, Map<String, dynamic>? template})Start an iOS Live Activity (ActivityKit) with the turn-key default
attributes. The native side registers its update token via onLiveActivityToken.
Parameters
Prop
Type
liveActivityUpdate()
methodFuture<void> liveActivityUpdate({required String activityId, required Map<String, dynamic> contentState})Update a running iOS Live Activity's content state.
Parameters
Prop
Type
liveActivityEnd()
methodFuture<void> liveActivityEnd({required String activityId, Map<String, dynamic>? finalContentState})End a running iOS Live Activity.
Parameters
Prop
Type
liveActivityObservePushToStart()
methodFuture<void> liveActivityObservePushToStart(String activityType)Start observing ActivityKit: push-to-start tokens (iOS 17.2+), push-started
activities' update tokens, and diagnostics — all via onLiveActivityToken.
Parameters
Prop
Type
onLiveActivityToken()
methodvoid onLiveActivityToken(void Function(Map<String, dynamic> info) sink)Register a sink for ActivityKit tokens. info carries
{ kind: 'pushToStart'|'update', activityType?, activityId?, token } or a
diagnostic { kind: 'status', event, … }.
Parameters
Prop
Type
voiceRegisterAccount()
methodFuture<void> voiceRegisterAccount()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.
View sourcevoiceReportIncoming()
methodFuture<void> voiceReportIncoming({required String callId, required String from, String? displayName, String? avatarUrl, bool hasVideo = false})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.
Parameters
Prop
Type
voiceEndCall()
methodFuture<void> voiceEndCall(String callId)End a native call (local hangup / remote-left) so the system UI clears.
Parameters
Prop
Type
voiceMissedCall()
methodFuture<void> voiceMissedCall({required String callId, required String from, String? displayName, String? avatarUrl})The caller cancelled before we answered — clear the ring and leave a "Missed call" notification, like a native phone call.
Parameters
Prop
Type
onNativeCallEvent()
methodvoid onNativeCallEvent(void Function(String action, String callId) sink)Register a sink for native call actions the user took in the SYSTEM UI.
action is answer | reject | disconnect; callId identifies the call.
Parameters
Prop
Type
voiceReportOutgoing()
methodFuture<void> voiceReportOutgoing({required String callId, required String to, String? displayName})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).
Parameters
Prop
Type
voiceReportConnected()
methodFuture<void> voiceReportConnected(String callId)Tell the OS the call connected (starts its timer / active-call UI).
Parameters
Prop
Type
voiceVoipToken()
methodFuture<String?> voiceVoipToken()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.
Returns Future<String?>
onNativeCallControl()
methodvoid onNativeCallControl(void Function(String action, String callId, Object? value) sink)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.
Parameters
Prop
Type
onNativeCallAudioSession()
methodvoid onNativeCallAudioSession(void Function(bool active) sink)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.
Parameters
Prop
Type
onNativeVoicePush()
methodvoid onNativeVoicePush(void Function(Map<String, dynamic> data) sink)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.
Parameters
Prop
Type
onNativeVoipToken()
methodvoid onNativeVoipToken(void Function(String token) sink)Register a sink for APNs VoIP token updates (iOS PushKit).
Parameters
Prop
Type
appIsForeground()
methodFuture<bool> appIsForeground()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.
Returns Future<bool>
micPermissionStatus()
methodFuture<String?> micPermissionStatus()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".
Returns Future<String?>
micRequestPermission()
methodFuture<bool?> micRequestPermission()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.
Returns Future<bool?>
instance
static setterstatic set instance(NexusPlatform instance)Parameters
Prop
Type
