-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Badge is shown on iOS even though it was not configured #1141
Comments
@macdonst According to your API doc, badge on iOS is disabled by default (badge attribute). Is that correct? Or will I have to disable it somehow through config? #1143 Also initializes ios with no parameters and expects the badge to show up. Who is right here? |
Try this.
|
I don't need an extra plugin to accomplish these things, this plugin supports setting the badge number. In the API Docs for ios, there is an optional attribute "ios.badge", that is false by default and it's functionality is specified like that:
So either the doc is incorrect or there is a bug in the plugin. My payload does not include anything related to "badge" as well. |
Hello, Has this been fixed on later versions than 1.8.3? (I don't want to try before I know if it has been fixed because I have to update cordova and I'm afraid it may cause my build to fail). Thanks in advance. |
I am having the same problem. It has always have a badge number(1) even installing/reinstalling the app. Any fix to this? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Expected Behaviour
Push Notifications are received, no badge is set.
Actual Behaviour
Push Notifications are received, Badge is always set to 1. Even after reinstalling the app, the badge is still there.
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
iPhone 6, iOS 9.3.3
Cordova CLI version and cordova platform version
Cordova 6.2.0
cordova-ios 4.1.1
Plugin version
1.7.0
Sample Code that illustrates the problem
I've configured the plugin like that:
window.push = window.PushNotification.init({ android: { senderID: ENV.gcmId, icon: 'noticon', clearNotifications: false, forceShow: true, clearBadge: true, }, ios: {} });
So through debugging i found some very strange behaviour.
In the didRegisterForRemoteNotificationsWithDeviceToken callback in PushPlugin.m the enabledRemoteNotificationTypes are checked. For me with this configuration (no badge, alert and sound configured), i get a 1 for rntypes, which ends up evaluating true with UIRemoteNotificationTypeBadge, even though UIRemoteNotificationTypeBadge was never registered for. I am fairly certain, that this is the cause for the badge number being set.
Unfortunately I didn't understand the code entirely (I'm no iOS/Obj-C developer), so it's hard for me to see what side effects this could have or what this could break.
Thanks a lot
Alex
The text was updated successfully, but these errors were encountered: