Releases: seniv/react-native-notifier
Releases · seniv/react-native-notifier
Release 3.0.0-rc.5
3.0.0-rc.5 (2025-01-21)
Bug Fixes
Release 3.0.0-rc.4
3.0.0-rc.4 (2025-01-20)
Features
- New methods:
isNotificationVisible
,hideById
,isVisibleById
,shakeById
,updateById
(279413c)
Release 3.0.0-rc.3
3.0.0-rc.3 (2025-01-20)
Bug Fixes
- fix showing animation when "onLayout" event is delayed (old arch) (d09907e)
- notification not hiding when hideNotification is called immediately after showNotification (aed3e1b)
- fix component max width when use one of the edge positions (07d9f22)
- fix provided style priority in toast & notification components (831d844)
Features
- new "Toast" component (1a05ad0)
Release 3.0.0-rc.2
3.0.0-rc.2 (2025-01-17)
Features
- new "ignoreKeyboardHeight" parameter for more precise bottom offset configuration (457143b)
Release 3.0.0-rc.1
Release 3.0.0-rc.0
3.0.0-rc.0 (2025-01-16)
Breaking Changes
- The library now internally uses
react-native-safe-area-context
. Make sure you havereact-native-safe-area-context
installed, and thatNotifierRoot/Wrapper
is wrapped bySafeAreaProvider
. Component
is unmounted while the notification is not visible.containerStyle
now only accepts a simple style object and cannot be used to change animation. UseanimationFunction
instead.- The "Hide Timer" (
duration
param) now starts after the “appearing” animation finishes, rather than when it starts. If you use a long “appearing” animation, you may want to reduce theduration
(3 seconds by default). - The
swipeEnabled
parameter has been removed. To disable swipes, setswipeDirection: 'none'
. - The parameters
animationDuration
,showAnimationDuration
,hideAnimationDuration
,swipeAnimationDuration
,easing
,showEasing
,hideEasing
,swipeEasing
have been removed. UseshowAnimationConfig
,hideAnimationConfig
,swipeOutAnimationConfig
,resetSwipeAnimationConfig
instead. - The default
showAnimationConfig
is now set to a spring animation whenComponent != NotifierComponents.Alert
.
Features
- Support for different positions. A notification can be placed at
top
,bottom
, or any edge of the screen using theposition
parameter. - Introduced new params:
enterFrom
,exitTo
, andswipeDirection
. These control the direction of entering/exiting animations and allow swiping not only to the top but also left, right, and down. - New
animationFunction
parameter for creating custom animations. - Each notification now has its own ID. The default ID depends on the
idStrategy
parameter, and you can also assign one manually. If a notification with the same ID is already shown, the result ofshowNotification
depends onduplicateBehavior
. - New
duplicateBehavior
parameter describing how the Notifier should behave if a notification with the same ID is already shown. - New
idStrategy
parameter, which defines how a default ID is generated if none is provided. - New
updateNotification
method that updates a currently visible notification. - New
shakeNotification
method that shakes a currently visible notification to attract the user's attention and optionally resets theduration
timer. - Calling
showNotification
returnsupdate
,hide
,shake
, andisVisible
functions for manipulating the notification. - You can mount multiple instances of
NotifierWrapper
/NotifierRoot
and still control them using globalNotifier.*
methods. The most recently mounted instance is controlled first; if it unmounts, control reverts to the previously mounted instance. - It's possible to broadcast commands to all mounted instances of Notifier via
Notifier.broadcast.*
. This can be used, for example, to hide all notifications or clear the queue and hide them usingNotifier.broadcast.hideNotification()
. - Custom handling for safe area insets (based on
react-native-safe-area-context
'suseSafeAreaInsets
hook) in all built-in components, plus a simple API for using the same insets in custom components. It also handles keyboard offset when a notification is displayed at a bottomposition
. All components receive anoffsets
object and aViewWithOffsets
component as props. Related parameters:ignoreSafeAreaInsets
,ignoreKeyboard
,additionalKeyboardOffset
,additionalOffsets
. - Using new
*AnimationConfig
parameters, it is now possible to run Spring animations with fully customizable configurations. - Additional TypeScript types have been exported, such as
NotifierComponentProps
(for base props in custom components),AnimationFunction
,AnimationFunctionParams
,Position
,Offsets
,ViewWithOffsetsComponent
,Direction
,DuplicateBehavior
, andSwipeDirection
. - New built-in component:
SimpleToast
. - All components receive a
hide
function and ananimationFunctionParams
object as props.
Bug Fixes
- When you mount
NotifierWrapper
/NotifierRoot
withomitGlobalMethodsHookup={true}
and then switch it tofalse
, global methods now hook up correctly. - Fixed a jump in the appearing animation when very large notifications appear.
Known Issues
- When
useRNScreensOverlay
istrue
, the bottomposition
will not work. If you need a bottom position withuseRNScreensOverlay
, you can adjust the container style using thernScreensOverlayViewStyle
parameter, for example:
rnScreensOverlayViewStyle={{
width: '100%',
position: 'absolute',
bottom: 0,
}}
Release 2.0.0
2.0.0 (2024-07-21)
Bug Fixes
- fix the first display of notification when using
useRNScreensOverlay
.
Code Refactoring
- remove SafeContainer component (dbaf80f)
Features
- add
omitGlobalMethodsHookup
prop toNotifierWrapper
/NotifierRoot
to skip globalNotifier
methods hookup. Details. (c8e3c2b) - export
NotifierProps
type (a827354)
BREAKING CHANGES
- Built-in components will not work correctly on iOS 10. Since React Native v0.65 and above only support iOS 11 and later, this should not be a problem. If you need iOS 10 support, use
SafeAreaView
fromreact-native-safe-area-context
as the component container. - useRNScreensOverlay and rnScreensOverlayViewStyle do not work as
showNotification
params. Pass them as props toNotifierRoot
orNotifierWrapper
Touchable*
andPressable
components imported fromreact-native
will not work in custom components. They need to be replaced with equivalent components fromreact-native-gesture-handler
.
Release 1.10.0
1.10.0 (2024-07-21)
Features
- use FullWindowOverlay from react-native-screens to display notifier above native modals (e72e1e8)
- allow to pass ref into NotifierWrapper component (4bff0bb)
- export QueueMode and ShowNotificationParams types (6c598c1)
BREAKING CHANGES
Touchable*
andPressable
components imported fromreact-native
will not work in custom components. They need to be replaced with equivalent components fromreact-native-gesture-handler
.