.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.
Download the SDK from the dashboard (Integration guide) after you create a free account.
Add the SDK to your solution
Unzip the download into your solution folder (this creates
PushConsoleSDK/), reference the project and declare the Firebase file for Android:MyApp.csproj<!-- MyApp.csproj --> <ItemGroup> <ProjectReference Include="PushConsoleSDK\maui\PushConsole.Maui\PushConsole.Maui.csproj" /> </ItemGroup> <ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'"> <GoogleServicesJson Include="Platforms\Android\google-services.json" /> </ItemGroup>Requires .NET 10 / MAUI 10. For .NET 9 apps, change
TargetFrameworksinPushConsole.Maui.csproj. In TingPush: upload the service account JSON (Android) and the .p8 key (iOS).Initialize in MauiProgram
MauiProgram.csusing PushConsoleSdk; public static MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuilder(); builder .UseMauiApp<App>() .UsePushConsole(new PushConsoleOptions { AppId = "YOUR_APP_ID", ServerUrl = "https://tingpush.com", 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 : PushConsoleSdk.PushConsoleAppDelegate // 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 PushConsoleSdk; public partial class App : Application { public App() { InitializeComponent(); PushConsole.CallEvent += (_, e) => { if (e.Action == PushConsoleCallAction.Accepted) { // User tapped Answer → connect the call (e.Call.Id, e.Call.Data["room"]) } }; PushConsole.NotificationOpened += (_, e) => { /* navigate using e.Data */ }; } protected override void OnStart() { // Android: Answer tapped while the app was closed if (PushConsole.TakeAcceptedCall() is { } call) { /* connect the call */ } } } // Assign the user await PushConsole.LoginAsync("user-123"); await PushConsole.LogoutAsync(); await PushConsole.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
[PushConsole] 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.