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

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -