carsonwah / react-native-push-notification-popup Goto Github PK
View Code? Open in Web Editor NEWA <NotificationPopup/> component for presenting your own push notification in react-native app
License: MIT License
A <NotificationPopup/> component for presenting your own push notification in react-native app
License: MIT License
My notification popup appear in foreground state but notification popup do not appear in background and kill state of the app how can I do this? Help needed! Thanks
It is foreseeable that the current padding will not work under the new Dynamic Island design. Just to open an issue to track this first.
Supporting the new Dynamic Island animation will be quite difficult. So the current direction will be to support the new padding first at least.
BUG, On Android the pop up closes very fast after slide out
Really it's an amazing package i'm a big fan of it.
but you need to make some enhancement like:-
Hi Awesome library for showing popups when app is in foreground. When I use the latest library its not centered, rather the whole ui is aligned to the left in ios simulator.
Can you add alignSelf: 'center' to the below code? am not familiar with how to do checkin to npm library, if you can suggest how to do I can do this as well.
const getAnimatedContainerStyle = ({containerSlideOffsetY, containerDragOffsetY, containerScale}) => {
// Map 0-1 value to translateY value
const slideInAnimationStyle = {
transform: [
{translateY: containerSlideOffsetY.interpolate(slideOffsetYToTranslatePixelMapping)},
{translateY: containerDragOffsetY},
{scale: containerScale},
],
alignSelf: 'center',
};
// Combine with original container style
const animatedContainerStyle = [
styles.popupContainer,
slideInAnimationStyle,
];
return animatedContainerStyle;
};
Thanks for creating this dude π π π
Whenever I try to show the notification for the first time this error is shown up and after pressing ctrl+s the and by sending the notification again from firebase the notification will appear perfectly. I'm using functional components with hooks.
let popup = useRef();
I can't find a way to do this
this is not an issue per say bit how can we use this globally
as opposite to on a particular screen. I am using react navigation lib
and i want this to be able to triggered irrespective of the screen the user is currently on
I am new to react native , i have integrated one signal for push notification in my application and now i need to show notification when notification fired.
this is my notification function
onReceived(notification) {
console.log("Notification received: ", notification);
}
whenever i call this.popup.show() its shows me error
Hello there.
I'm having a problem with the default popup view. I was trying to push a html msg to my device but it doesn't support html in the body view. Will it becomes a feature in future?
Hello !
thank you for this nice package!
We are building a chat app and would need to be able to have action from within the pop up.
We will try to make a pull request ASAP.
If you have any advices it would be most welcomed!
Best,
In the https://www.npmjs.com/package/react-native-push-notification-popup, has customization props ready? This lib is nice if added customization. Please advise.
Hi ,
Thanks for awesome library. I am using this but i am getting " null is not an object (evaluating '_this2.popup.show')" everytime when Popup shows. Along With
Warning: Functions are not valid as a React child. This may happen if you return a Component instead of from render. Or maybe you meant to call this function rather than return it.
My App.js is
import NotificationPopup from 'react-native-push-notification-popup';
import { requestUserPermission, messagingMethods } from './src/utils/firebase'
export default class App extends Component {
constructor(props) {
super(props);
this.state = {};
}
componentDidMount() {
requestUserPermission();
messagingMethods(this.props, (remoteMessage) => {
console.log('working call back', remoteMessage)
this.popup.show({
onPress: function () { console.log('Pressed') },
appIconSource: require('./src/assets/icons/logo.png'),
appTitle: 'Some App',
timeText: 'Now',
title: 'Hello World',
body: 'This is a sample message.\nTesting emoji π',
slideOutTime: 5000
});
});
}
render() {
return (
<>
{/* <View style={{ position: 'absolute', top: -20 }}> /}
<NotificationPopup
ref={ref => this.popup = ref}
/>
{/ */}
<StatusBar backgroundColor={COLOR.BLACK} barStyle="light-content" />
</>
</ActionSheetProvider>
</Provider >
);
}
}
Thanks in advance. Please revert asap.
Shashi
Hi there,
We found that the pop-up is too low on Android if not using the translucent statusbar. In our case, we switched from managing the statusbar with the component to letting Android manage it. We then saw that the pop-up was rendered with a top margin of approx. 1x the height of the statusbar. This is caused by:
Hey!
Just found this awesome library, thank you for this!
Is there any way to display more than 1 notification popup?
Hi, thank you for your contribution of this library. It works perfect on iOS, but it seems like nothing happened in android emulator after this.pop.show()
Thank you!
So I figured using functional component with this approach, but no avail, and this is how i am doing it :
//createRef
const popup = useRef()
//componentDidMount
useEffect(() => {
popup.show({
appIconSource: require("./assets/icon.png"),
appTitle: "Some App",
timeText: "Now",
title: "Hello World",
body: "This is a sample message.\nTesting emoji π",
slideOutTime: 5000
});
}, [])
//at the bottom of Components
<NotificationPopup ref={popup} />
I don't know where I am going wrong, the error says :
undefined is not a function (near '...popup.show...')
Hi, thanks for the awesome module. My requirement is, In my app i'm using chat functionality i need to show the notification type messages by calling this.popup.show() once in screen and need to get notification message in anywhere in the Application. Can you please suggest me how to fix it.
I am using this plugin with react-navigation and the push notification from OneSignal, all is fine but the function onPress not works.
`
import NotificationPopup from 'react-native-push-notification-popup';
//**Execute when a notification is received
onReceived = notification => {
console.log("Notification received: ", notification)
//Show Push Notification Popup
const pushMessage = notification.payload.title
const link = notification.payload.additionalData.noticia
notification.isAppInFocus == true
&& this.popup.show({
onPress: () => NavigationService.navigate('NoteContainer', { link }), //With function() the same, not works
appIconSource: require('./assets/icon.png'),
appTitle: 'UNOTV',
timeText: 'Ahora',
title: pushMessage
})
}
render() {
return (
<MainContainer>
<StatusBar backgroundColor="#FAFAFA" barStyle="dark-content" />
/** The pop-pup display very well but the onPress function and Pan gestures not works
<NotificationPopup ref={ref => this.popup = ref} />
//App container with use of react native Context
<NotificationsContext.Provider value={this.state}>
<AppContainer
ref={navigatorRef => {
NavigationService.setTopLevelNavigator(navigatorRef)
}}
/>
</NotificationsContext.Provider>
</MainContainer>
)
}
`
Now the conditional rendering does not include the outer full-screen container, which blocks the screen even when the popup is not presented.
Thanks @dan-mahoney-aquicore for reporting this issue.
Hi, first of all thanks for a great module.
Is it possible to hide the popup sometimes, for example when you get a message notification while you're already on the messages screen / component?
Cheers.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.