Skip to content

Badge Count Does Not Show On Icon #19

Closed

Description

@AngelaJune

I am new to adding Swift code for push notifications. I did the following and still have no badge count displaying when I send a push notification. I set the applicationIconBadgeNumber in the fetchCompletionHandler function.
Has anyone else had this issue and resolved it? Or is there something else that needs done for badge counts to work using the OneSignal push service?

Thanks so much!

Activity

  1. jkasten2 commented on Mar 15, 2016

    @jkasten2
    Contributor

    The badge count is handled for you by OneSignal, no need to add your own code to set it. Just set or increase the badge count by the value you want on our dashboard or REST API.

    Badge icons are only set when a push notification is received while the app is not in focus or closed.

    Let us know if this isn't what you're seeing.

    Thanks.

  2. AngelaJune commented on Mar 16, 2016

    @AngelaJune
    Author

    Thank you so much for the reply. This was my ignorance. I was thinking it was all set in the code.

  3. Sruthin86 commented on Nov 20, 2016

    @Sruthin86

    Is there a way to increment badge number when using OneSignal.postNotification ?

  4. Pratik9909 commented on Dec 13, 2017

    @Pratik9909

    Hi,

    [OneSignal postNotification:@{@"contents":@{@"en":text}, @"include_player_ids":oneSignalIds,@"content_available":@true,@"ios_badgeType":@"Increase",@"ios_badgeCount":@1}];

    I have set ios_badgeType and ios_badgeCount both during sending of Notification so do i need to set anything for receiver side?

    when i got notification the application badge doesn't auto incremented.

  5. Nightsd01 commented on Dec 13, 2017

    @Nightsd01
    Contributor

    Keep in mind that the badge count is only incremented when the app isn't open. So if the notification was received while the app was open, the badge count won't increase.

    You should not need to do anything on the client side (iOS)

  6. Pratik9909 commented on Dec 13, 2017

    @Pratik9909

    Hi Thanks for your reply,

    my badge count was 54. and i removed my app from background. when i got notification the sender send
    [OneSignal postNotification:@{@"contents":@{@"en":text}, @"include_player_ids":oneSignalIds,@"content_available":@true,@"ios_badgeType":@"Increase",@"ios_badgeCount":@1}];

    but when notification received it starts with 1. why it is not starting with 54?

  7. Pratik9909 commented on Dec 13, 2017

    @Pratik9909

    My simple question is

    let notificationReceivedBlock: OSHandleNotificationReceivedBlock = { notification in

    is called when application is not in background? if not then which method is called when our application is not in background and we received notification.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions