-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting badge amount correctly #10
Comments
To increment the badge count when a notification is received you can set You can set Thanks. |
That's not what I'm experiencing. When I enter the app, the increment count is not reset. It might be that it's reset if you open the app by clicking the notification, but not if you open the app like normal. All the best Holger Sindbaek · UI/UX Designer & Web/iOS Programmer · HolgerSindbaek.com On Fri, Feb 12, 2016 at 2:07 PM -0800, "Josh Kasten" notifications@github.com wrote: To increment the badge count when a notification is received you can set ios_badgeType to "Increase" and ios_badgeCount to 1. Our SDK should be resetting the badge count back to 0 each time the app is opened / resumed automatically. I haven't seen any bugs with this is it is more likely another plugin / SDK code be interfering. Can you try to reproduce the issue in a new project? Let us know the steps to reproduce the issue if you're still seeing it. You can set content_available to true on OneSignal to wake up your app in the background. It will fire the application:didReceiveRemoteNotification:fetchCompletionHandler: selector in your app's code. Thanks. — |
The only issue I can see where the badge counter would not be cleared is if you were not calling initWithLaunchOptions from the application:didFinishLaunchingWithOptions: selector in your app or there is another plugin / SDK or code changing the value. We have a clearBadgeCount internal function that is called in a number of locations to make sure the badge is cleared. It includes the follow events.
Can you post a project reproducing the issue along with the iOS version you're testing on with step by step instructions reproducing the issue? Thanks. |
I was setting "applicationIconBadgeNumber" manually different places. I think that had some unexpected consequences. I've taken that away now and it's working perfectly. |
@AmirDaliri There is another issue open related to syncing badge counts you can follow bellow. |
I want to increment badge count by 1 for every notification the user receives and when the user enters the app, I want the badge count to reset to 0.
Right now, I'm using your system to keep track of badge count, but your system doesn't reset the badge count to 0 once the user enters the app. Is there any way I can reset the badge count to 0 for a user using the iOS library?
If not, is there any way I can receive a message in the background? Right now, I have a callback for "initWithLaunchOptions", but that only gets called if the user is currently in the app and not if the app is running in the background.
Any of these 2 solutions would work nicely.
The text was updated successfully, but these errors were encountered: