React-native-push-notification: Set badage 0/remove existing badage

Created on 7 Nov 2017  路  3Comments  路  Source: zo0r/react-native-push-notification

Well,
First of all thanks a lot for this awesome library. It's working really great.
I am having a little issue. I am sending remote notifications. After receive it, user enter into app.
I want when user leave app, badge will be 0 in app icons...

PushNotification.localNotification({
number:4,
});

this worked great...
PushNotification.localNotification({
number:0,
});

but this is not working. In short I want to make badge 0, when user leave app.

thanks for any ideas...

Most helpful comment

thanks man,
I found another way...
PushNotification.setApplicationIconBadgeNumber(0);

All 3 comments

You can use setApplicationBadgeNumber if you want. But would be better to look into the source code for Android https://github.com/zo0r/react-native-push-notification/blob/master/component/index.android.js

And API for iOS https://facebook.github.io/react-native/docs/pushnotificationios.html

thanks man,
I found another way...
PushNotification.setApplicationIconBadgeNumber(0);

@salimbutex please close the issue, if you can. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sunnyyants picture sunnyyants  路  4Comments

DanDance picture DanDance  路  3Comments

GastonEDiaz picture GastonEDiaz  路  3Comments

Kiran0791 picture Kiran0791  路  3Comments

nguyenvanphuc2203 picture nguyenvanphuc2203  路  3Comments