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

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift