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

Badge icon number - Count out of sync after reboot #41

Closed
jkasten2 opened this Issue Apr 26, 2016 · 9 comments

Comments

Projects
None yet
5 participants
@jkasten2
Member

jkasten2 commented Apr 26, 2016

After Android is rebooted OneSignal notifications do not reappear so the badge count value is no longer in sync with the number of notifications. Notifications should reappear or the counter should reset on boot.

May also be an issue when notifications are cleared programmatically.

@jkasten2 jkasten2 added the Bug label Apr 26, 2016

@ismly

This comment has been minimized.

ismly commented Apr 30, 2016

same here.. can we hide these cadge counts? click on app but, cant delete the count number...

@jkasten2

This comment has been minimized.

Member

jkasten2 commented May 9, 2016

You can disable the auto badge counting until a fix is created by adding the following to your AndroidManifest.xml.

<application ...>
   <meta-data android:name="com.onesignal.BadgeCount" android:value="DISABLE" />
</application>

If you still want badge support in your app but want to control it manually you can use the following library in your app.
https://github.com/leolin310148/ShortcutBadger

Thanks.

@absagar

This comment has been minimized.

absagar commented May 27, 2016

I added the metadata key but the badge still doesn't go away.

@jkasten2

This comment has been minimized.

Member

jkasten2 commented May 27, 2016

@sagar23jan The meta-data key keeps the SDK from updating the badge value. Android launchers remember the value unless you fully uninstall then reinstall the app. Android launchers seems to remember the value (tested Nova launcher) even if you fully uninstall and reinstall the app.

There are 3 possible workarounds if you have already released an app and want to clear this value.

  • Use https://github.com/leolin310148/ShortcutBadger in your app to clear it on start up / in an update event. (It is a small ~30KB library).
  • Modify our SDK by adding ShortcutBadger.applyCount(context, 0); to OneSignal.init
  • (May not compile) - Try creating your own class in the com.onesignal package in your app project and call ShortcutBadger.applyCount(context, 0); from a static method. (no SDK modification required).

@jkasten2 jkasten2 added this to the 2.4.1 milestone May 27, 2016

@absagar

This comment has been minimized.

absagar commented May 28, 2016

I simply added the ShortcutBadger.applyCount(context, 0); after I init OneSignal in my application's code, which seems to work. Thanks for the workaround.

@erhanharm

This comment has been minimized.

erhanharm commented May 28, 2016

Thanks for workaround.

I've added my application ;)

On Sat, May 28, 2016 at 3:36 PM, Abhishek Sagar notifications@github.com
wrote:

I simply added the ShortcutBadger.applyCount(context, 0); after I init
OneSignal in my application's code, which seems to work. Thanks for the
workaround.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#41 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAL1JgVkDW1ICJCJFYqUc1rYbgT4TyB-ks5qGDa7gaJpZM4IPeuV
.

Erhan Harmankaya

http://tr.linkedin.com/in/erhanharmankaya

@jkasten2 jkasten2 modified the milestones: 2.4.2, 2.4.1 Jun 2, 2016

@jkasten2 jkasten2 modified the milestones: 2.4.2, 2.4.3 Jun 17, 2016

@jkasten2

This comment has been minimized.

Member

jkasten2 commented Jun 28, 2016

Fixed in Release 2.5.0.

@jkasten2 jkasten2 closed this Jun 28, 2016

@jkasten2 jkasten2 removed this from the 2.4.3 milestone Jun 28, 2016

@shahzadiqbal

This comment has been minimized.

shahzadiqbal commented Aug 9, 2017

How to get Badge count? if we want to use Badge count in our app.

@jkasten2

This comment has been minimized.

Member

jkasten2 commented Aug 9, 2017

@shahzadiqbal Please see issue #87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment