Reputation: 29
I must push notification from my own socket side server when the application is closed or application is in the background. Where do I need to write a typescript code in my project to solve this problem?
Upvotes: 2
Views: 3051
Reputation: 1899
The push notifications require registration between your mobile device (the app) and the Push Notification services (Google GCM/FCM or Apple APNS).
Registering your application via a unique identifier will allow your application to receive notifications (actually the OS will handle them) anytime, even if the application is closed, in background or foreground.
If you want to send data (represented as notifications) from your server via sockets you should consider implementing a background handler to listen for that data. If the app is closed, you may need to use a Plugin (native code required) to wake up your app and listen for changes.
Have a look here to understand better how the Ionic Apps are working in background with Sockets.
Upvotes: 2