npx claudepluginhub davidortinau/maui-skills --plugin maui-skillsThis skill uses the workspace's default tool permissions.
| Issue | Cause | Fix |
Implements local notifications in .NET MAUI apps for Android, iOS, Mac Catalyst. Covers channels, permissions, scheduling, foreground/background handling, DI registration, and platform gotchas.
Implements push notifications for iOS/Android using Firebase Cloud Messaging, APNs. Covers React Native Firebase, Swift, Kotlin, Flutter with backend token handling and best practices.
Implements push notifications for iOS, Android, React Native, and web using Firebase Cloud Messaging and native services. Handles permissions, tokens, background/foreground messages, and channels.
Share bugs, ideas, or general feedback.
| Issue | Cause | Fix |
|---|---|---|
| Token changes every debug run (Android) | Debug builds regenerate Firebase tokens | Always re-register in OnNewToken |
HttpClient requests fail silently | BaseAddress missing trailing / | Ensure endpoint ends with / |
| iOS push won't arrive on simulator | Simulators don't support APNS | Use a physical iOS device |
| No notifications on Android 13+ | POST_NOTIFICATIONS required (API 33+) | Call RequestPermissions in OnCreate |
| Notification channel missing (API 26+) | Android requires explicit channel creation | Create channel before sending |
SendNotificationAsync throws for >20 tags | Azure NH tag expression limit | Batch tags in groups of 20 |
422 on device registration | Platform string mismatch | Use "fcmv1" (not "gcm") and "apns" |
Token empty at RegisterAsync | Race condition on cold start | Guard with IsNullOrWhiteSpace check |
HttpClient.BaseAddress must end with /. Without it, relative URI resolution silently breaks.
// ❌ Relative URIs resolve incorrectly
_http = new HttpClient { BaseAddress = new Uri("https://example.com") };
// ✅ Trailing slash required
_http = new HttpClient { BaseAddress = new Uri("https://example.com/") };
Firebase tokens regenerate frequently in debug builds. If you skip OnNewToken, the backend holds a stale token and pushes silently fail.
// ❌ Only registering once at startup
// (token may change later without re-registration)
// ✅ Always re-register in OnNewToken
public override void OnNewToken(string token)
{
var svc = IPlatformApplication.Current?.Services.GetService<IPushNotificationService>();
if (svc is null) return;
svc.Token = token;
_ = svc.RegisterAsync();
}
Without explicitly requesting POST_NOTIFICATIONS on API 33+, notifications are silently dropped.
SendNotificationAsync throws if a tag expression references more than 20 tags. Batch into chunks:
// ✅ Batch tags to stay under the limit
var batches = request.Tags.Chunk(20);
foreach (var batch in batches)
{
var tagExpr = string.Join(" || ", batch);
await _hub.SendFcmV1NativeNotificationAsync(payload, tagExpr, ct);
}
The legacy "gcm" platform string causes 422 errors on device registration. Always use "fcmv1" for Android and "apns" for iOS.
APNS only works on physical iOS devices. Simulators silently ignore push registrations.
google-services.json in Platforms/Android/ with <GoogleServicesJson> in .csprojXamarin.Firebase.Messaging NuGet package added (Android-only condition)POST_NOTIFICATIONS permission requested on API 33+OnNewToken always calls RegisterAsyncFirebaseMessagingService registered in manifest with MESSAGING_EVENT intent filter.p8) uploaded to Azure Notification HubEntitlements.plist with aps-environment set to development or productionCodesignEntitlements set in .csprojRegisterForRemoteNotifications called on main thread after authorization grantBaseAddress ends with trailing /"fcmv1" and "apns" (not legacy values)MAUI app → ASP.NET Core backend → Azure Notification Hub → FCM / APNS → device
See references/push-notifications-api.md for full implementation templates.