Notifications

Wisej.NET Hybrid applications can display notifications to users in several ways.

Remote Push Notifications

Remote push notifications are messages sent by a server to a user's device through a network, typically to inform, alert, or engage the user when they are not actively using the respective application.

pageRemote Push Notifications

Local Push Notifications

Local push notifications are similar to remote push notifications in their purpose, which is to inform or alert users, but they differ significantly in their source and mechanism. Unlike remote push notifications that are sent from a server, local push notifications are scheduled and triggered by the application itself on the user's device.

Mechanism of Local Push Notifications

  1. Scheduling: The application schedules a local notification by specifying the content of the notification (like title, message, sound) and the time when it should be displayed. This is typically done using APIs provided by the mobile operating system.

  2. No Server Interaction: Local notifications do not require any interaction with a remote server. All information about the notification is contained within the app, and the scheduling is managed by the device's operating system.

  3. Triggering: When the specified time arrives, or the triggering condition is met (such as entering a specific location, if location-based triggers are used), the operating system delivers the notification to the user's device.

  4. Display: The notification is displayed to the user, similar to how remote push notifications are displayed. This can happen even if the app is not actively running.

  5. User Interaction: Upon receiving the notification, the user can interact with it, for instance, by tapping on it to open the app, or performing a specific action directly from the notification if it's actionable.

Setup

private void button1_Click(object sender, EventArgs e)
{
	// schedules a notification 5 seconds from now with the given title and message.
	Device.LocalNotification.Schedule("title", "body", DateTime.Now.AddSeconds(5), 5);
}

Result

Last updated