Search code examples
c#iosxamarin.iosalerts

Show Apple Alert Badge In APP Without APNS


I have a main menu in my monotouch app that has 4 icons which go to various other screens. I would like to put an alert badge on one of the icons when my alert criteria has been met. Is there a way to do this using applicationIconBadgeNumber or something similar?


Solution

  • If you mean a UITabBarController than this code will do what you need

    viewController.tabBarItem.badgeValue = 1;
    

    Where the viewcontroller is the UIViewController which is associated with the tab]

    If you would like to add it to a UIButton you can use this class here

    That should allow you do it.