Push
Push in the .NET SDK.
| Symbol | Kind | Summary |
|---|---|---|
PushNotificationBuilder | class | Composes a transactional push notification, then sends it. |
PushResource | class | Push notifications — transactional sends to people, segments or filters. |
PushNotificationBuilder
classclass Inverge.Nexus.Builders.PushNotificationBuilderComposes a transactional push notification, then sends it.
Targeting is a union: users, segments and an ad-hoc filter combine.
ToEveryone overrides all of them.
AndroidAccentColor()
methodPushNotificationBuilder AndroidAccentColor(string color)Sets the Android accent colour.
Parameters
Prop
Type
Returns PushNotificationBuilder
AndroidBigPicture()
methodPushNotificationBuilder AndroidBigPicture(string url)Sets the Android big-picture image.
Parameters
Prop
Type
Returns PushNotificationBuilder
AndroidLargeIcon()
methodPushNotificationBuilder AndroidLargeIcon(string url)Sets the Android large icon.
Parameters
Prop
Type
Returns PushNotificationBuilder
AndroidVisibility()
methodPushNotificationBuilder AndroidVisibility(string visibility)Sets Android lock-screen visibility: public, private or secret.
Parameters
Prop
Type
Returns PushNotificationBuilder
Body()
methodPushNotificationBuilder Body(string body)The notification body.
Parameters
Prop
Type
Returns PushNotificationBuilder
Build()
methodJsonObject Build()The assembled payload, without sending. Useful in tests.
Returns JsonObject
Button()
methodPushNotificationBuilder Button(string id, string text, string? url = null, string? event = null, string? icon = null, string? style = null)Adds an action button.
Parameters
Prop
Type
Returns PushNotificationBuilder
Data()
methodPushNotificationBuilder Data(object data)Custom key/values delivered to the app rather than displayed. Merged with anything set earlier.
Parameters
Prop
Type
Returns PushNotificationBuilder
Image()
methodPushNotificationBuilder Image(string url)A large image to show in the expanded notification.
Parameters
Prop
Type
Returns PushNotificationBuilder
IosBadge()
methodPushNotificationBuilder IosBadge(int count)Sets the iOS app badge count.
Parameters
Prop
Type
Returns PushNotificationBuilder
IosInterruptionLevel()
methodPushNotificationBuilder IosInterruptionLevel(string level)Sets the iOS interruption level: passive, active,
time-sensitive or critical.
time-sensitive and critical break through Focus modes and need
an Apple entitlement; without it the notification is delivered at
active instead.
Parameters
Prop
Type
Returns PushNotificationBuilder
IosRelevanceScore()
methodPushNotificationBuilder IosRelevanceScore(double score)Sets the iOS relevance score, which orders notifications in a summary.
Parameters
Prop
Type
Returns PushNotificationBuilder
IosSubtitle()
methodPushNotificationBuilder IosSubtitle(string subtitle)Sets the iOS subtitle line.
Parameters
Prop
Type
Returns PushNotificationBuilder
Option()
methodPushNotificationBuilder Option(string key, object? value)Sets any option field directly — the escape hatch for a server option newer than this SDK.
Parameters
Prop
Type
Returns PushNotificationBuilder
Options()
methodPushNotificationBuilder Options(object options)Merges several options at once.
Parameters
Prop
Type
Returns PushNotificationBuilder
SendAsync()
methodTask<PushSendResult> SendAsync(CancellationToken cancellationToken = default)Sends the notification.
Parameters
Prop
Type
Returns Task<PushSendResult>
Title()
methodPushNotificationBuilder Title(string title)The notification title. Required.
Parameters
Prop
Type
Returns PushNotificationBuilder
ToEveryone()
methodPushNotificationBuilder ToEveryone()Targets every subscribed device, overriding the other targets.
This reaches your entire install base in one call. It is deliberately spelled out rather than implied by sending with no target.
Returns PushNotificationBuilder
ToSegment()
methodPushNotificationBuilder ToSegment(string segmentId)Targets one saved segment.
Parameters
Prop
Type
Returns PushNotificationBuilder
ToSegments()
methodPushNotificationBuilder ToSegments(IEnumerable<string> segmentIds)Targets the union of saved segments.
Parameters
Prop
Type
Returns PushNotificationBuilder
ToUser()
methodPushNotificationBuilder ToUser(string distinctId)Targets one person.
Parameters
Prop
Type
Returns PushNotificationBuilder
ToUsers()
methodPushNotificationBuilder ToUsers(IEnumerable<string> distinctIds)Targets specific people, across every device each has registered.
Parameters
Prop
Type
Returns PushNotificationBuilder
Where()
methodPushNotificationBuilder Where(object filter)Targets devices matching an ad-hoc filter: platform, lang,
osType, appVersion, lastSeenDays, tags.
Parameters
Prop
Type
Returns PushNotificationBuilder
PushResource
classclass Inverge.Nexus.Resources.PushResourcePush notifications — transactional sends to people, segments or filters.
Campaigns, provider credentials, segments and templates live in the console. This resource is for the one-off, event-driven sends your backend makes: "your order shipped", "someone replied to you".
Notification()
methodPushNotificationBuilder Notification()Starts a fluent notification — the recommended way to send.
Returns PushNotificationBuilder
OpenedAsync()
methodTask<NexusAck> OpenedAsync(string campaignId, string token, CancellationToken cancellationToken = default)Records that a notification was opened, which is what makes the console's open rates real.
Parameters
Prop
Type
Returns Task<NexusAck>
RegisterTokenAsync()
methodTask<NexusAck> RegisterTokenAsync(string token, string platform, string? provider = null, string? lang = null, IReadOnlyDictionary<string, string>? tags = null, NexusTelemetryContext? context = null, CancellationToken cancellationToken = default)Registers or refreshes a device token.
The device SDKs normally do this themselves. Use it for server-driven and bring-your-own-token flows.
Parameters
Prop
Type
Returns Task<NexusAck>
SendAsync()
methodTask<PushSendResult> SendAsync(IEnumerable<string> distinctIds, string title, string? body = null, string? imageUrl = null, object? data = null, object? options = null, CancellationToken cancellationToken = default)Sends to specific people, across every device each has registered.
Parameters
Prop
Type
Returns Task<PushSendResult>
SendRawAsync()
methodTask<PushSendResult> SendRawAsync(JsonObject payload, CancellationToken cancellationToken = default)Sends a fully assembled payload — what the builder calls, and the escape hatch for a payload shape newer than this SDK.
Parameters
Prop
Type
Returns Task<PushSendResult>
SendToSegmentsAsync()
methodTask<PushSendResult> SendToSegmentsAsync(IEnumerable<string> segmentIds, string title, string? body = null, object? data = null, CancellationToken cancellationToken = default)Sends to the union of saved segments.
Parameters
Prop
Type
Returns Task<PushSendResult>
SendToUserAsync()
methodTask<PushSendResult> SendToUserAsync(string distinctId, string title, string? body = null, string? imageUrl = null, object? data = null, object? options = null, CancellationToken cancellationToken = default)Sends to one person.
Parameters
Prop
Type
Returns Task<PushSendResult>
UnregisterAsync()
methodTask<NexusAck> UnregisterAsync(string token, CancellationToken cancellationToken = default)Stops delivering to a token — on logout or uninstall.
Parameters
Prop
Type
Returns Task<NexusAck>
