onNotification not fired when app is minimised
See original GitHub issueIn my project, onNotification function works fine when the app is in foreground. It even gets fired when the app has been closed and user opens the app by clicking on the notification. But when the app is minimised, on receiving notification and clicking it, the app opens but onNotification function is not being called. Here is my app.js:
export default class App extends Component{
constructor(props) {
super(props);
this.state = {
senderId: appConfig.senderID,
notiType: 'default'
};
this.notif = new NotifService(
this.onRegister.bind(this),
this.onNotif.bind(this),
);
}
onRegister(token) {
this.setState({registerToken: token.token, fcmRegistered: true});
}
onNotif(notif) {
console.log(notif);
if(notif.type != undefined) this.setState({notiType: notif.type});
}
componentDidMount(){
this.notif.configure(
this.onRegister.bind(this),
this.onNotif.bind(this),
this.state.senderId,
);
}
render(){
return (
<NavigationContainer>
{StackScreen(this.state.notiType)}
</NavigationContainer>
);
}
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:15
Top Results From Across the Web
onNotification() is not fired when app is killed - Stack Overflow
I am not positive but when I remember correctly killing (alias force closing) an app disables the onNotification functionality in Android ...
Read more >Events | Notifee
The application is running & is in not in view (minimized). ... DELIVERED event is not fired for trigger notifications when the app...
Read more >awesome_notifications | Flutter Package - Pub.dev
A complete solution to create Local and Push Notifications, customizing buttons, images, sounds, emoticons and applying many different layouts for Flutter ...
Read more >Receive messages in a JavaScript client - Firebase - Google
Handle messages when your web app is in the foreground ... or in the background, hidden behind other tabs, or completely closed. ......
Read more >Handling click on notification when app is closed/minimized ...
So when the app is open and in the foreground, there is no push notifications ... The event is triggered, though the notification...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok thanks a lot! Atleast this one got fixed automatically. 😅 I will close this issue.
Same issue happen to me as well. When app is minimized, onnotification is not triggered.