InvergeDocs
.NETAPI reference

Push

Push in the .NET SDK.

SymbolKindSummary
PushNotificationBuilderclassComposes a transactional push notification, then sends it.
PushResourceclassPush notifications — transactional sends to people, segments or filters.

PushNotificationBuilder

class
class Inverge.Nexus.Builders.PushNotificationBuilder

Composes 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()

method
PushNotificationBuilder AndroidAccentColor(string color)

Sets the Android accent colour.

Parameters

Prop

Type

Returns PushNotificationBuilder

AndroidBigPicture()

method
PushNotificationBuilder AndroidBigPicture(string url)

Sets the Android big-picture image.

Parameters

Prop

Type

Returns PushNotificationBuilder

AndroidLargeIcon()

method
PushNotificationBuilder AndroidLargeIcon(string url)

Sets the Android large icon.

Parameters

Prop

Type

Returns PushNotificationBuilder

AndroidVisibility()

method
PushNotificationBuilder AndroidVisibility(string visibility)

Sets Android lock-screen visibility: public, private or secret.

Parameters

Prop

Type

Returns PushNotificationBuilder

Body()

method
PushNotificationBuilder Body(string body)

The notification body.

Parameters

Prop

Type

Returns PushNotificationBuilder

Build()

method
JsonObject Build()

The assembled payload, without sending. Useful in tests.

Returns JsonObject

Button()

method
PushNotificationBuilder 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()

method
PushNotificationBuilder Data(object data)

Custom key/values delivered to the app rather than displayed. Merged with anything set earlier.

Parameters

Prop

Type

Returns PushNotificationBuilder

Image()

method
PushNotificationBuilder Image(string url)

A large image to show in the expanded notification.

Parameters

Prop

Type

Returns PushNotificationBuilder

IosBadge()

method
PushNotificationBuilder IosBadge(int count)

Sets the iOS app badge count.

Parameters

Prop

Type

Returns PushNotificationBuilder

IosInterruptionLevel()

method
PushNotificationBuilder 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()

method
PushNotificationBuilder IosRelevanceScore(double score)

Sets the iOS relevance score, which orders notifications in a summary.

Parameters

Prop

Type

Returns PushNotificationBuilder

IosSubtitle()

method
PushNotificationBuilder IosSubtitle(string subtitle)

Sets the iOS subtitle line.

Parameters

Prop

Type

Returns PushNotificationBuilder

Option()

method
PushNotificationBuilder 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()

method
PushNotificationBuilder Options(object options)

Merges several options at once.

Parameters

Prop

Type

Returns PushNotificationBuilder

SendAsync()

method
Task<PushSendResult> SendAsync(CancellationToken cancellationToken = default)

Sends the notification.

Parameters

Prop

Type

Returns Task<PushSendResult>

Title()

method
PushNotificationBuilder Title(string title)

The notification title. Required.

Parameters

Prop

Type

Returns PushNotificationBuilder

ToEveryone()

method
PushNotificationBuilder 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()

method
PushNotificationBuilder ToSegment(string segmentId)

Targets one saved segment.

Parameters

Prop

Type

Returns PushNotificationBuilder

ToSegments()

method
PushNotificationBuilder ToSegments(IEnumerable<string> segmentIds)

Targets the union of saved segments.

Parameters

Prop

Type

Returns PushNotificationBuilder

ToUser()

method
PushNotificationBuilder ToUser(string distinctId)

Targets one person.

Parameters

Prop

Type

Returns PushNotificationBuilder

ToUsers()

method
PushNotificationBuilder ToUsers(IEnumerable<string> distinctIds)

Targets specific people, across every device each has registered.

Parameters

Prop

Type

Returns PushNotificationBuilder

Where()

method
PushNotificationBuilder Where(object filter)

Targets devices matching an ad-hoc filter: platform, lang, osType, appVersion, lastSeenDays, tags.

Parameters

Prop

Type

Returns PushNotificationBuilder

PushResource

class
class Inverge.Nexus.Resources.PushResource

Push 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()

method
PushNotificationBuilder Notification()

Starts a fluent notification — the recommended way to send.

Returns PushNotificationBuilder

OpenedAsync()

method
Task<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()

method
Task<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()

method
Task<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()

method
Task<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()

method
Task<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()

method
Task<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()

method
Task<NexusAck> UnregisterAsync(string token, CancellationToken cancellationToken = default)

Stops delivering to a token — on logout or uninstall.

Parameters

Prop

Type

Returns Task<NexusAck>

On this page