-
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
Inconsistent badge count #57
Comments
Small update on this, seems like we forgot one important thing when sending the request to OneSignal. We didn't set the correct So with However, this required some work in our client and if would be super nifty if one convenience method was added to the public API to be able to post this kind of request to OneSignal. I can gladly make a PR for this if you think it holds value for others. |
Feel free to close this one when you guys get to it but do consider my last comment about the feature being added to the public API. Cheers! 🍻 |
Hi, Thank you for providing this feedback. We will look into solving this inconvenience on a future update of our SDK. |
OneSignal_disable_badge_clearing is the only way that worked for us when using Parse iOS SDK with OneSignal. |
@zenangst @sidan5 Update on this issue. We considering on using a @zenangst Sorry about overlooking your request to help with a PR on this. Let me know what your thoughts are on the above implantation. I estimate I won't have time to implement this until after May. If you want to take a crack this implementation let me know and I'll provide any guidance I can. Or I'll let you know before I start working on this so we don't overlay. |
@zenangst - I'm running into a similar issue since switching over to OneSignal. I'm trying to achieve the same effect as you, and I've set the flag in my info.plist so that the badge is not cleared. However, opening the app seems to clear the count kept on the OneSignal server side. When I query my badge count using Are you manually setting the badge count on the OneSignal server when you open your app? Side note.... I'm not sure the scenario when |
@rgoldiez hey man, we never solved this is a good way so we decided to step away from OneSignal and use our own parse server. |
@zenangst - Thanks for the feedback. Been fighting with it for a couple months now thinking it was something I was doing with my app implementation. |
@rgoldiez Sorry to hear, we still plan to implement the @zenangst @rgoldiez To summarize and confirm the current issue, the badge |
@JKalash - I wouldn't describe my issue as a problem with the My setup is like @zenangst ... I am managing my "unread" counts on my own server. If a message is intended for multiple recipients, a Everything works fine except that when the app is opened, the OneSignal server gets reset to 0. The user's iOS badge count remains unchanged (with I guess what I'm wondering is why would |
@zenangst The |
@jkasten2 - Are you saying this is the intended behavior or just explain what's going on? Does this need to wait for the |
@zenangst This is current behavior, to prevent this issue or any other de-sync scenarios, increments should be handled client side. Using a It could be done today by adding your own logic to one in your app and including your increment value as additional data so it can be read from the payload. By setting |
@jkasten2 I implemented |
@mlight3 Normally you can use You will need to store the current value of the badge each time it is changed. I recommend using |
@jkasten2 I tried as your comment. It works well when app is not focused. Here is my codes.
|
Solve it myself with When I am using I think OneSignal SDK updated that notification is opened when client received notification. But notification is async, updating notification is slow than new notifications. I solved it with Hope OneSignal REST API provide sending multiple notifications with individual badge counts. |
@mlight3 could you post your code that was changed to make this work? This is something I have been struggling with as well and it looks like you have made some progress. I am not sure if this has been fixed in the API yet or not as some of these comments are older. Yours was newer so I thought I would reach out and ask. Thanks! |
Is there any movement on this one? Definitely seems to still be occurring. |
There is movement - we just implemented it yesterday in the iOS SDK. More time is needed for testing and backend changes however. But it should be ready some time soon. |
Fantastic, thanks @Nightsd01 |
Thanks, I am following this - we are seeing issues with inconsistent badge counts but also notifications being marked as read (so no longer available to view) when there are multiple to view, and the user opens only one (brings the app to the foreground). |
Hi guys. Did anyone manage to solve the inconsistent badge count on his application ? I managed to update the badge as wanted, the only thing that ain't working for me, is when the application gets killed. I receive the notification, but the badge does not get updated. |
@razvanifteme Notification displaying and badge values are set directly by iOS it self without running any code in your app. The only time you should see the badge not being set is if the notification was received while your app was in focus as the OneSignal SDK will clear badges when the app is in focus. Or if you have any of your own code setting the badge on notification receive or focus events. |
@razvanifteme in addition to what jkasten2 said, it could also be an issue with the actual push notifications you are sending. Are you sending them with the REST API? Or are you sending them using the OneSignal dashboard? Also - I would recommend checking your entire project for any usage of |
@Nightsd01 am I right in saying that v2.8.2 was possibly addressing this issue with "The SDK now handles badge count logic on the device itself instead of relying on the backend" |
Has anyone had success managing the badge count using v2.8.2? Our badge count will increment correctly until we open the app and kill it. The badge count will still show correctly until the next push notification, when it will reset back to 1. I assume it must still be getting the count from the server. Does something specific need to be changed in the OneSignalNotificationServiceExtension to get the device to start handling the badge count? Alternatively: is it possible to send the request to reset the server count on demand (eg. when the user opens the chat screen) instead of automatically on app open? |
@Nightsd01 Any update on this? |
This is seriously a huge problem and causes a lot of challenges in managing the badge count. Can we get any updates on this? |
To anyone having this problem, client-side badge count logic fixes this issue. However, it only applies to apps created after mid June. It requires adding the Extension Service to your app. We don't have a switch right now in the dashboard to enable this, so currently you would want to contact OneSignal support and we can enable client side badge logic for your app. |
Closing issue. |
Hi, I'm facing exact the same problem, badge number is not reset at OneSignal. I wonder what might went wrong... Also, I don't know if that matters but do I have to name my appGroup following this naming rule : |
@chenkuanhuaian , |
Please follow https://documentation.onesignal.com/docs/ios-sdk-app-groups-setup in detail.
|
Ohai,
We are having some issues with keeping the badge counter in sync with the application content. We have disabled the clearing of the badge counter using
OneSignal_disable_badge_clearing
in our application plist. This solves one part of the problem, now it will keep the correct badge count when you open and leave the application.The problem arises when we get a new push notification that updates the badge count
using
Increment
. It always defaults back to1
the first time, then it starts incrementing the value as expected, as in1
,2
. As soon as you re-enter the application it will then use the application data to set the application badge counter again which is correct but when you receive another push notification you are back to step 1 and value 1.We tried to manually set the badge count for the
player
using the API but thatdoesn't seem to have any positive effect (the response comes back as 200 successful).
The thing we are trying to achieve is more of a Mail approach, that the badge counter represents the unread content and not how many notifications that you haven't seen yet.
We contacted support and got some short tid-bits that we could achieve this behavior with
OneSignal_disable_badge_clearing
enabled so we tried to enable the badge clearing again but we ended up with the same result as with it the badge clearing disabled.When we used Parse, we achieved this behavior by updating the current installation;
This is what we used with Parse;
We thought we could do the same by manually sending a request to
players/:id
and setting the badge count to the value that the application has.As seen in OneSignalTracker.m
https://github.com/OneSignal/OneSignal-iOS-SDK/blob/master/iOS_SDK/OneSignalTracker.m#L106-L116
Any ideas on how to solve this?
The text was updated successfully, but these errors were encountered: