applicationdidbecomeactive not called iOS swift

 Problem:

I want to remove the badge number to 0 while launch.I tried in applicationdidbecomeactive method.But it was not called in my app while launch.


Solution:

    func sceneWillEnterForeground(_ scene: UIScene) {

        DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {

            

                UIApplication.shared.applicationIconBadgeNumber = 0


        }

    }

In scene delegate class you have to call the above function and you can achieve that.

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift