javascript - Update applicationBadgeCounter dynamically on IOS -
i'm using react-native , i'm trying update badge counter each time new remote notification gets phone.
im using package 'react-native-push-notification' https://github.com/zo0r/react-native-push-notification
how can that?
here pushconfig file:
import react, {component} 'react'; import pushnotification 'react-native-push-notification'; export default class pushcontroller extends component{ componentdidmount(){ pushnotification.configure({ onnotification: function(notification) { console.log( 'notification:', notification ); datamio= notification console.log( 'datamio:', datamio ); }, requestpermissions: true, permissions: { alert: true, badge: true, sound: true }, onregister: function(token) { console.log( 'token:', token ); tokenmio=token }, }); pushnotification.setapplicationiconbadgenumber(20); //just know in section change badge number. } render(){ return null; } }
Comments
Post a Comment