This is a migrated thread and some comments may be shown as answers.

Badge count is gone when app is opened

1 Answer 104 Views
Push Notifications
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Brian
Top achievements
Rank 1
Brian asked on 05 Feb 2016, 11:54 AM

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

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 09 Feb 2016, 01:42 PM
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.
 
Tags
Push Notifications
Asked by
Brian
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or