打开应用后,Phonegap PushPlugin重置徽章 [英] Phonegap PushPlugin reset badge after opening app

查看:92
本文介绍了打开应用后,Phonegap PushPlugin重置徽章的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从后台进入应用程序后,如何防止PushPlugin将徽章计数重置为0?

How can I prevent PushPlugin from reseting my badge count to 0 after entering the app from the background?

推荐答案

我也遇到了这个问题.

出于某种原因,这是预期的行为.这是因为在 com.phonegap.plugins.PushPlugin 中,当应用再次激活时,徽标会清除为0.

For some reason this is intended behaviour. It's because in the com.phonegap.plugins.PushPlugin, the badge get cleared to 0 when the app get active again.

我最终编辑了插件:

在文件" AppDelegate + notification.m "中,方法如下:

In the file "AppDelegate+notification.m", in the method:

"- (void)applicationDidBecomeActive:(UIApplication *)application {"

更改第90行:

//zero badge
application.applicationIconBadgeNumber = 0;

收件人:

//zero badge
//application.applicationIconBadgeNumber = 0;

(我刚刚将其注释掉了.)

(I just ended up commenting it out).

这篇关于打开应用后,Phonegap PushPlugin重置徽章的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆