【问题标题】:how to remove push notification badge while installing an app如何在安装应用程序时删除推送通知徽章
【发布时间】:2012-06-17 07:21:03
【问题描述】:

我的应用使用推送通知。当我将应用程序安装到我的设备时,应用程序图标会显示推送通知徽章。徽章编号保持不变,不会随新通知更新。

有没有什么方法可以在安装应用后且仅在我的应用收到实际推送通知时不显示徽章?

【问题讨论】:

    标签: iphone ios push-notification


    【解决方案1】:
    func applicationDidBecomeActive(_ application: UIApplication) {
        // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
        application.applicationIconBadgeNumber = 0
    
    
    }
    

    【讨论】:

      【解决方案2】:

      由于安装后没有调用你的应用程序,你不能这样做。

      您也许可以在application:didFinishLaunchingWithOptions: 方法中做到这一点。 在这里您可以检查您的应用程序是否更新或清除图标徽章。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-01-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-08-21
        • 2012-12-24
        • 1970-01-01
        相关资源
        最近更新 更多