Remote Push Notifications
This functionality and page is not yet complete.
Wisej.NET Hybrid Applications can use Apple Push Notification Service (APNS) for iOS and Firebase Cloud Messaging (FCM) for Android to send and process push notifications within a Hybrid project.
How Remote Push Notifications Work
Registration for Notifications: When a user installs and opens a mobile or web application for the first time, the application requests to register for push notifications. This is often seen as a prompt asking the user if they want to allow notifications.
Device Token or Identifier: Upon granting permission, the application receives a unique token or identifier from the push notification service of the device's operating system (like Apple Push Notification Service for iOS or Firebase Cloud Messaging for Android).
Sending the Token to Server: The application sends this token to the application server. This token is used to identify the device and send messages to it.
Server Sends a Notification Request: When the server decides to send a notification (which could be triggered by various events), it sends a request to the push notification service, including the message and the device token.
Push Notification Service: The push notification service (like APNS for iOS or FCM for Android) receives the request and sends the notification to the correct device using the provided token.
Receiving the Notification: The user's device receives the notification and displays it, even if the application is not currently open.
Setup
NuGet Packages
Add Wisej-3-Hybrid-PushNotifications to your Wisej.NET Hybrid Local Application or Wisej.NET Hybrid Remote Application project.
Add Wisej-3-Hybrid-PushNotifications-Native to your Wisej.NET Hybrid Client Application project.
Register Client Extension
After adding the required NuGet packages to the projects, register the push notifications extension in the Hybrid Client Application project startup file:
Registering for Push Notifications
To use push notifications on Android or iOS, you must request a remote notification token. Within a Wisej.NET Hybrid application this can be achieved using the following lines of code:
Processing Push Notifications
There are multiple scenarios where push notifications can be handled within the application.
Last updated