Close Menu
  • Home
  • AI
  • Big Data
  • Cloud Computing
  • iOS Development
  • IoT
  • IT/ Cybersecurity
  • Tech
    • Nanotechnology
    • Green Technology
    • Apple
    • Software Development
    • Software Engineering

Subscribe to Updates

Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

    What's Hot

    New data sources and spark_apply() capabilities, better interfaces for sparklyr extensions, and more!

    February 8, 2026

    Fake Dubai Crown Prince tracked to Nigerian mansion after $2.5M romance scam

    February 8, 2026

    Nanotoxicology Advances to Integrated Safety Frameworks

    February 8, 2026
    Facebook X (Twitter) Instagram
    Facebook X (Twitter) Instagram
    Big Tee Tech Hub
    • Home
    • AI
    • Big Data
    • Cloud Computing
    • iOS Development
    • IoT
    • IT/ Cybersecurity
    • Tech
      • Nanotechnology
      • Green Technology
      • Apple
      • Software Development
      • Software Engineering
    Big Tee Tech Hub
    Home»iOS Development»Badge count is not incrementing in Push Notification using OneSignal in iOS MAUI app
    iOS Development

    Badge count is not incrementing in Push Notification using OneSignal in iOS MAUI app

    big tee tech hubBy big tee tech hubFebruary 7, 2026004 Mins Read
    Share Facebook Twitter Pinterest Copy Link LinkedIn Tumblr Email Telegram WhatsApp
    Follow Us
    Google News Flipboard
    Badge count is not incrementing in Push Notification using OneSignal in iOS MAUI app
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link


    I have developed MAUI app using Visual Studio 2022 v 17.14.16 and .NET 9. I have already developed Android app and it is on Google Play Store.

    Now I am developing iOS MAUI app so I have enabled iOS as a target Platform. Target .Net runtime as .Net 9 and Minimum target iOS framework is 16.0.

    enter image description here

    I have implemented Push Notification functionality by adding Notification Service Extension (NSE) Project in Visual Studio Windows.

    For both Main app and NSE, I have created App Id. For Main App, App Id I have enabled Push Notification and App Group capabilities and for NSE project I have enabled App Group capability in Apple developer portal. I have created App group (group.com.company.id.name) and configured to App Id of both Main App and NSE project.

    In App.xaml.cs file, I have initialized OneSignal like below:

    OneSignal.Initialize("OneSignal_App_Id");
    OneSignal.Notifications.RequestPermissionAsync(true);
    

    In Main app’s Info.plist, I have added below keys for Push notification-

    Main app Info.plist

    
    
    
    
    LSRequiresIPhoneOS
    
    UIDeviceFamily
    
        1
    
    UIRequiredDeviceCapabilities
    
        arm64
    
    UISupportedInterfaceOrientations
    
        UIInterfaceOrientationPortrait
        UIInterfaceOrientationLandscapeLeft
        UIInterfaceOrientationLandscapeRight
    
    UISupportedInterfaceOrientations~ipad
    
        UIInterfaceOrientationPortrait
        UIInterfaceOrientationPortraitUpsideDown
        UIInterfaceOrientationLandscapeLeft
        UIInterfaceOrientationLandscapeRight
    
    XSAppIconAssets
    Assets.xcassets/appicon.appiconset
    CFBundleShortVersionString
    0.1
    CFBundleVersion
    1.0.0
    CFBundleIdentifier
    com.company.id.name
    CFBundleDisplayName
    Mobile app
    CFBundleName
    Mobile app
    MinimumOSVersion
    16.0
    NSCameraUsageDescription
    We need camera access to capture images.
    CFBundleURLTypes
    
        
            CFBundleURLSchemes
        
            com.googleusercontent.apps.reverseClientId
        
            
    
    UIBackgroundModes
    
        fetch
        remote-notification
    
    OneSignal_app_groups_key
    group.com.company.id.name.onesignal
    

    Main app’s Entitlements.plist

     
    
    
    
    aps-environment
    development
    com.apple.security.application-groups
    
        group.com.company.id.name.onesignal
    
    

    Main App .csproj Configuration

    
      net9.0-android35.0;net9.0-ios18.0
      Exe
      true
      true
      enable
    
    16.0
    
    
    true
    false
    None
    Platforms\iOS\Entitlements.plist
    
    
        
    
    
      
          true
      
    
    

    NSE Info.plist

    
    
    
    
    CFBundleDisplayName
    OneSignalNotificationServiceExtension
    CFBundleName
    OneSignalNotificationServiceExtension
    CFBundleIdentifier
    com.company.id.name.OneSignalNotificationServiceExtension
    CFBundlePackageType
    XPC!
    CFBundleShortVersionString
    0.1
    CFBundleVersion
    1.0.0
    NSExtension
    
        NSExtensionPointIdentifier
        com.apple.usernotifications.service
        NSExtensionPrincipalClass
        NotificationService
    
    UIBackgroundModes
    
        remote-notification
    
    MinimumOSVersion
    16.0
    OneSignal_app_groups_key
    group.com.company.id.name.onesignal
    
    
    

    NSE Entitlements.plist

     
    
    
    
    com.apple.security.application-groups
    
        group.com.company.id.name.onesignal
    
    
    
    

    NSE configuration

    
    
    net9.0-ios18.0
    Library
    enable
    true
    16.0
    True
    ios-arm64
    com.company.id.name.OneSignalNotificationServiceExtension
    
    
    Entitlements.plist
    
    
    Entitlements.plist
    
    
    
    
    
    

    NotificationServiceClass

    using System;
    using Foundation;
    using OneSignalSDK.DotNet;
    using OneSignalSDK.DotNet.iOS;
    using UIKit;
    using UserNotifications;
    
    namespace OneSignalNotificationServiceExtension
    {
    [Register("NotificationService")]
    public class NotificationService : UNNotificationServiceExtension
    {
        Action ContentHandler { get; set; }
        UNMutableNotificationContent BestAttemptContent { get; set; }
        UNNotificationRequest ReceivedRequest { get; set; }
        protected NotificationService(IntPtr handle) : base(handle)
        {
            // Note: this .ctor should not contain any initialization logic,
            // it only exists so that the OS can instantiate an instance of this class.
        }
    
        public override void DidReceiveNotificationRequest(UNNotificationRequest request, Action contentHandler)
        {
            Console.WriteLine("DidReceive**********************");
            ReceivedRequest = request;
            ContentHandler = contentHandler;
            BestAttemptContent = (UNMutableNotificationContent)request.Content.MutableCopy();
    
            NotificationServiceExtension.DidReceiveNotificationExtensionRequest(request, BestAttemptContent, contentHandler);
        }
    
        public override void TimeWillExpire()
        {
            NotificationServiceExtension.ServiceExtensionTimeWillExpireRequest(ReceivedRequest, BestAttemptContent);
    
            ContentHandler(BestAttemptContent);
        }
    
    }
    }
    

    Below is my payload of notification I am passing via API:

    var notification = new Notification(appId: _AppId)
    {
     Contents = new StringMap(en: message),
     IncludeExternalUserIds = externalUserId,
     IosBadgeType = "Increase",
     IosBadgeCount = 1,
     MutableContent = true 
    };
    

    In both Main app and NSE project properties iOS Bundle signing, I have selected Manual Provisioning and selected Signing Identity and Provisioning Profile resp. for Main App and NSE

    I have paired Visual Studio Windows with Mac. I am getting Push notifications on my app. On Notification Center it is showing correct count but issue is on app icon badge count is not increasing, it is stuck at 1 only.

    I think NSE is not working because if I add any prefix to body in DidReceiveNotification method, then it is not showing.

    I am getting below error:

    INFO: An error occurred while forwarding HotReload local tunnel: System.IO.IOException: USB connect timeout (ENODATA), likely because the app failed to launch. Please review device logs and/or crash reports for more information.
       at Xamarin.MacDev.AggregateAsyncResult.CheckError(Boolean cancelled)
       at Xamarin.MacDev.IPhoneDevice.EndConnectStream(IAsyncResult result)
       at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
    --- End of stack trace from previous location ---
       at Xamarin.Messaging.IDB.IPhoneUsbLocalTunnelConnection.StartLocalTunnelAsync()
       at Xamarin.Messaging.IDB.LaunchAppMessageHandler.ForwardLocalTunnelsAsync(LaunchAppMessage, IPhoneDevice)
    ERROR: [iOS HotReload] Failed to connect to "iPhone" over USB on port 11000.
    

    For this error- I have disabled / unchecked .NET Hot Reload and uncheck Enable Hot Reload but same error persists.

    Is there anything I am missing because of which badge count is not increasing? If there is no communication happens between Main app and NSE then what needs to be done?



    Source link

    app Badge count incrementing iOS Maui notification OneSignal push
    Follow on Google News Follow on Flipboard
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Copy Link
    tonirufai
    big tee tech hub
    • Website

    Related Posts

    ios – How to make overlapping physics bodies to resolve collision more “gently” in RealityKit (like in SceneKit)

    February 8, 2026

    Top Stories: iOS 26.3 and 26.4 Features, Foldable iPhone Details, and More

    February 7, 2026

    ios – VSCode on Mac no longer recognizes connected apple devices. (.NET MAUI)

    February 6, 2026
    Add A Comment
    Leave A Reply Cancel Reply

    Editors Picks

    New data sources and spark_apply() capabilities, better interfaces for sparklyr extensions, and more!

    February 8, 2026

    Fake Dubai Crown Prince tracked to Nigerian mansion after $2.5M romance scam

    February 8, 2026

    Nanotoxicology Advances to Integrated Safety Frameworks

    February 8, 2026

    Scaling connectivity pilots into global production networks

    February 8, 2026
    About Us
    About Us

    Welcome To big tee tech hub. Big tee tech hub is a Professional seo tools Platform. Here we will provide you only interesting content, which you will like very much. We’re dedicated to providing you the best of seo tools, with a focus on dependability and tools. We’re working to turn our passion for seo tools into a booming online website. We hope you enjoy our seo tools as much as we enjoy offering them to you.

    Don't Miss!

    New data sources and spark_apply() capabilities, better interfaces for sparklyr extensions, and more!

    February 8, 2026

    Fake Dubai Crown Prince tracked to Nigerian mansion after $2.5M romance scam

    February 8, 2026

    Subscribe to Updates

    Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

      • About Us
      • Contact Us
      • Disclaimer
      • Privacy Policy
      • Terms and Conditions
      © 2026 bigteetechhub.All Right Reserved

      Type above and press Enter to search. Press Esc to cancel.