Skip to content

Firebase (iOS)

Firebase Cloud Messaging on iOS requires a separate native binding since Apple does not natively support FCM. This package provides a full iOS Firebase push provider with topic subscription support, while Android continues to use the built-in Shiny.Push Firebase support.

  • GitHub stars for shinyorg/firebase
  • NuGet package Shiny.Push.FirebaseMessaging
Shiny.Push.FirebaseMessagingNuGet package Shiny.Push.FirebaseMessaging

On Android, this package delegates to the built-in Shiny.Push Firebase support. Follow the standard Push Notifications Getting Started guide for Android Firebase setup using google-services.json.

// Auto-config from GoogleService-Info.plist (iOS) / google-services.json (Android)
services.AddPushFirebaseMessaging<MyPushDelegate>();
// Or with explicit configuration
services.AddPushFirebaseMessaging<MyPushDelegate>(new FirebaseConfiguration(
UseEmbeddedConfiguration: false,
AppId: "your-app-id",
SenderId: "your-sender-id",
ProjectId: "your-project-id",
ApiKey: "your-api-key"
));

On iOS, the Firebase provider implements IPushTagSupport, which maps tags to FCM topic subscriptions. Use the standard Shiny tag APIs:

IPushManager pushManager; // injected
if (pushManager.IsTagsSupport())
{
await pushManager.Tags.AddTag("news");
await pushManager.Tags.SetTags("premium", "sports");
await pushManager.Tags.RemoveTag("news");
await pushManager.Tags.ClearTags();
var tags = pushManager.Tags.RegisteredTags;
}

On iOS, the provider:

  1. Initializes the Firebase SDK (auto-config or manual)
  2. Swizzles the APNs token and exchanges it for an FCM registration token
  3. Provides the FCM token through the standard IPushManager.RegistrationToken property
  4. Maps tag operations to FCM topic subscribe/unsubscribe calls

On Android, it delegates to Shiny.Push’s built-in Firebase support with the same FirebaseConfiguration options.