Badge count is gone when app is opened

2 posts, 0 answers
  1. Brian Andersen
    Brian Andersen avatar
    5 posts
    Member since:
    Mar 2010

    Posted 05 Feb Link to this post

    I am implementing push messages with my kendo hybrid app using app builder, and it works fine on my iPhone, however my badge is not acting as I would expect.

    As adviced by telerik support I have set "{ "clearBadge", "False" }" which means the the counting is not reset when the app is opened. And that is partly true. The counting does continue but...  when I open the app the badge dissapears completely until a new notificaiton is recieved, something that I don't want to happen either. I want the badge to be shown with the number of notifications until I programmatically tell it to do otherwise.

    Does anyone know how/what setting can stop the badge from dissapearing completely when I open the app? 


    Thanks

     Brian

  2. George
    Admin
    George avatar
    500 posts

    Posted 09 Feb Link to this post

    Hi Brian,

    Thank you for posting to the Telerik Developer Forums.

    I am copying in this thread the answer provided in your private support ticket. The emphasis here is placed on the native code that is by default resetting the application badge number. In brief, you need to edit the native iOS code by removing the following line: https://github.com/Telerik-Verified-Plugins/PushNotification/blob/master/src/ios/AppDelegate%2Bnotification.m#L68. After that, you need to disable the old plugin and import the new, edited plugin.

    Here is a more detailed explanation.

    The logic that clears the bade from the app icon on app starts is part of the Cordova Push Plugin - this line. You may edit the iOS native code in the plugin to do not clear the badge at app start/resume if you need to do this explicitly.  Please, make sure to follow for any new releases of the plugin since new improvements are added on a regular basis. You may want to:

        - Disable the plugin from the project
        - Download the plugin from the repository 
        - Edit its code at the specified line (remove the line)
        - Import it as a custom plugin. 
     
     
    After that you can control the application icon badge and sync its value with the server as explained here. You can use the method to set the badge icon from the app too.

    Try these steps and let me know, should you have further questions.

    Regards,
    George
    Telerik
     
    Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
     
Back to Top