A multi-platform, scalable push-notification engine.
Targets iOS, Android, Windows, Kindle, Baidu, etc.
Back-ends: cloud or on-premises.
Push notifications delivered through platform-specific infrastructures called Platform Notification Systems (PNSs).
To send a notification to all customers across the Android, iOS, and Windows versions of an app, the developer must work with Apple Push Notification Service (APNS), Firebase Cloud Messaging (FCM), and Windows Notification Service (WNS) separately.
var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();
var hub = new NotificationHub("[HubName]", "[DefaultListenSharedAccessSignature]");
var result = await hub.RegisterNativeAsync(channel.Uri);
// Displays the registration ID so you know it was successful
if (result.RegistrationId != null)
{
var dialog = new MessageDialog("Registration successful: " + result.RegistrationId);
dialog.Commands.Add(new UICommand("OK"));
await dialog.ShowAsync();
}
var nhClient = NotificationHubClient.CreateClientFromConnectionString("ConnectionString", "HubName");
// Register fake device - Firebase
var fcmDeviceId = Guid.NewGuid().ToString();
var fcmInstallation = new Installation
{
InstallationId = "fake-fcm-install-id",
Platform = NotificationPlatform.Fcm,
PushChannel = fcmDeviceId,
PushChannelExpired = false,
Tags = new[] { "fcm" }
};
await nhClient.CreateOrUpdateInstallationAsync(fcmInstallation);
// Broadcast
var outcomeFcm = await nhClient.SendFcmNativeNotificationAsync(FcmSampleNotificationContent);