.NET MAUI Push Notifications in C#
C#, .NET 10. Android uses Firebase; iOS uses PushKit + CallKit directly.
🟣 .NET MAUI
C#, .NET 10. Android uses Firebase; iOS uses PushKit + CallKit directly.
The SDK is free and open source (MIT) on GitHub. Create a free account to get your App ID.
Add the SDK
Run
dotnet add package TingPush.Maui(the TingPush.Maui package on NuGet), then declare the Firebase file for Android:MyApp.csproj<!-- MyApp.csproj --> <ItemGroup> <PackageReference Include="TingPush.Maui" Version="1.1.1" /> </ItemGroup> <ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'"> <GoogleServicesJson Include="Platforms\Android\google-services.json" /> </ItemGroup>Requires .NET 10 / MAUI 10. In TingPush: upload the service account JSON (Android) and the .p8 key (iOS).
Initialize in MauiProgram
MauiProgram.csusing TingPushSdk; public static MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuilder(); builder .UseMauiApp<App>() .UseTingPush(new TingPushOptions { AppId = "YOUR_APP_ID", TextAnswer = "Answer", TextDecline = "Decline" }); return builder.Build(); }iOS: change the AppDelegate base class, enable VoIP
Platforms/iOS/AppDelegate.cs// Platforms/iOS/AppDelegate.cs [Register("AppDelegate")] public class AppDelegate : TingPushSdk.TingPushAppDelegate // instead of MauiUIApplicationDelegate { protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); }Platforms/iOS<!-- Platforms/iOS/Info.plist --> <key>UIBackgroundModes</key> <array> <string>remote-notification</string> <string>voip</string> </array> <!-- Platforms/iOS/Entitlements.plist (csproj: <CodesignEntitlements>Platforms/iOS/Entitlements.plist</CodesignEntitlements>) --> <key>aps-environment</key> <string>development</string>
Enable Push Notifications for the App ID in Apple Developer. Release builds:
aps-environment = production.Handle events & assign the user
App.xaml.csusing TingPushSdk; public partial class App : Application { public App() { InitializeComponent(); TingPush.CallEvent += (_, e) => { if (e.Action == TingPushCallAction.Accepted) { // User tapped Answer → connect the call (e.Call.Id, e.Call.Data["room"]) } }; // User tapped a notification (even when the app was closed) TingPush.NotificationOpened += (_, e) => { /* navigate using e.Data["screen"] */ }; // Notification received while the app is open TingPush.NotificationReceived += (_, e) => { /* e.Title, e.Body, e.Data */ }; } protected override void OnStart() { // Android: Answer tapped while the app was closed if (TingPush.TakeAcceptedCall() is { } call) { /* connect the call */ } } } // Assign the user await TingPush.LoginAsync("user-123"); await TingPush.LogoutAsync(); await TingPush.SetTagsAsync(new Dictionary<string, string> { ["plan"] = "vip" });Android: keep
LaunchMode = LaunchMode.SingleToponMainActivity(the template default).CanUseFullScreenIntent()andOpenBatteryOptimizationSettings()are available.
✅ After integrating, check
- Run the app on a real device with logging on: you should see
[TingPush] Device registered …. - The project's Devices tab: the device appears; iOS devices show the VoIP badge if you use calls.
- The Send tab: send a test to that device.
- Choose 📞 Call and test with the app open, closed and with the screen locked.