zetavg / react-native-system-notification

Android system notifications for React Native. Supports push notifications with GCM integrated.
https://www.npmjs.com/package/react-native-system-notification
244 stars 102 forks source link

Add a way to update notification progress #77

Open jpmonettas opened 7 years ago

jpmonettas commented 7 years ago

Hello! First of all thx for the great library! Is there currently a way to update the notification progress?

Thanks

oroce commented 7 years ago

Hey,

if you follow the implementation you can see the whn you call Notification.create(), it will call the native module's rCreate method: https://github.com/neson/react-native-system-notification/blob/master/index.android.js#L18 The rCreate method does call the NotificationManager's createOrUpdate method: https://github.com/neson/react-native-system-notification/blob/3532efbe9e43f32465766732644a0ac8b02035d3/android/src/main/java/io/neson/react/notification/NotificationModule.java#L75

So if you keep using the same id for calling Notification.create() your notification will get updated.