简体   繁体   English

在 ios 中接收通知时禁用应用程序徽章图标

[英]Disable application badge icon on receiving notification in ios

I am using react-native-applozic-chat for handling chats in my react-native app.我正在使用 react-native-applozic-chat 在我的 react-native 应用程序中处理聊天。 My question is there any way to prevent the app badge icon from appearing on app icon after receiving any chat notification?我的问题是,在收到任何聊天通知后,有什么方法可以防止应用程序徽章图标出现在应用程序图标上? I want to disable it specifically in ios because it does not appear in android.我想在 ios 中专门禁用它,因为它没有出现在 android 中。

You can use this你可以用这个

application.applicationIconBadgeNumber = 0;

in AppDelegate didfinishLaunched to get the the result.在 AppDelegate didfinishLaunched 中得到结果。

If you want to disable the app badge count completely.如果您想完全禁用应用程序徽章计数。

You can use the below setting in ALChatmanager.m file inside the method ALDefaultChatViewSettings .您可以在方法ALDefaultChatViewSettings内的ALChatmanager.m文件中使用以下设置。

[ALUserDefaultsHandler setUnreadCountType:0];

Make sure this setting is added only once in ALChatmanager.m file确保此设置仅在ALChatmanager.m文件中添加一次

For more information on this disabling, you can refer to the docs here有关此禁用的更多信息,您可以参考此处的文档

Badge number is a good option for this:徽章编号是一个不错的选择:

app.applicationIconBadgeNumber = 0;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM