How can we send message notification for ios using node js socket io while the chat app is closed?
In fact, when a simple message is sent, you will catch it with socket.io and you will send notification via push.js using it.
Push.js: https://pushjs.org/.
It is also explained in detail how it is done on the site.
But if you still want a simple one, here it is:
Push.create(data.user_name + " | Chat", {
body: data.desc,
icon: "https://pushjs.org/images/icon.png",
tag: "chat",
link: "http://localhost:8080/chat",
timeout: 5000,
onClick: function () {
window.focus();
this.close();
}
});
This can be achieved by push notification integration in iOS app.
There are many third parties available which can be integrated into the iOS app and on back end server.
FCM
APNS(Apple's native push notification service)
Pusher
One Signal, etc.
The above are the some name of the push notification services that can be integrated into app and backend server.
You need to more dig into "How to integrated push notification in iOS app with Node JS backed?" so just google it you will get the may tutorial on the internet.
Personally saying, we have integrated push in one of your iOS app with Node backed with FCM.
Fundamentally iOS supports Push Notifications via APNs (Apple Push Notification service). It’s possible to directly interface with APNs and send messages, however it can often be simpler to instead use a third party service to handle the complexity.
Ably, FCM, PubNub and Pusher are all common solutions which work well in combining an existing messaging system with Push Notifications where needed. If you’re in need of just a notification system, and have no other communication systems, a library for just notifications such as Push.js will work well.
Related
I've set up an app to send motion data from one device to another using websockets (Starscream library). Now I need to send push notifications when a critical event happens (when app is minimized), does it have anything to do with websockets or I just need to use something like Pusher?
As you said, I think you should use Pusher or any other external service (Pushwoosh, Onesignal, among others) to send push notifications to the users. You can't do this with websockets.
I recommend you to use OneSignal (it is free and some big companies like Uber or Zillow are using it)
EDIT:
I think you can't send a push notification from one device to the other one. One device (let's say Kid.app) should notify the server of an event, and then the server will send the push notification to the other (Parent.app).
Check this link, it will be useful for you.
In Parse I know you can send push notification from one device to another, but since it is shutting down soon I have looked at a lot of push notification services. But I could not find one service which allows you to push to other users. i.e. Firebase, you send out notifications from the computer. Basically I need a service when a function is called in the code it goes to certain people automatically. Any service suggestions?
If you have an own server, connect it with FCM. Then create an API using PHP to receive message and forward it to another device. You may implement a system to store the FCM token of the devices in the server.
You have 2 options:
Create you own app server that will send a push notification to either APNS/GCM according to the user device type and device token id
Use push provider. I recommend you to use OneSignal because its 100% free, support in all devices and have an SDK to any client/server side technology so if you will use OneSignal you will not need any server in-between your app and the push server.
this is the onesignal home page: https://onesignal.com/
and this is the SDK docs page: https://documentation.onesignal.com/
BTW! if you want to can also continue to use parse services because they release their service as an open source which called parse-server
so you can take and deploy parse-server to any cloud platform that run NodeJS and then you can continue to work as usual
I was wondering if its possible, using PubNub to route a message as a push notification, even if the app is running in the foreground?
One way that I can think to do this is to:
Handle any specific routing and events that need to happen first.
Check the push note portion of the message and send a local device notification. Alternatively any custom UI, etc could be done here.
PubNub does send the push notification when the app is in the foreground. In fact, PubNub (the mobile push notification server) does not know if the device is foreground, background or not running at all. So the push notification is always sent to the device either way.
See the following PubNub Developer Community article, Sending APNS and GCM Messages to Subscribers and Mobile Push Notification Services in One API Call, for more details.
Also refer to the PubNub iOS Mobile Push Gateway Tutorial for Realtime Apps. These docs are about to get a major upgrade in terms of completeness.
I am create a firebase based chat application for iOS. One of the features is to send push notification to the users in the same chat room (if they are offline).
I can't find a firebase function (for iOS) that can be used to send push notifications to the user.
Is it possible?
Displaying alert badges and notifications on iPhone applications is accomplished through Apple's Push Notification system. Since the application is not running on the user's phone when they receive notifications, the APN will have to be triggered from your server-side code.
You'll probably want to create a server-side module that listens for changes to your chat Firebase. When a message appears for a user that is offline, you'll have to schedule a remote notification with the APN. That latter part has nothing to do with Firebase, but has extensive documentation on Apple's developer web site.
I'm not sure if a web application can display alerts or badges. Otherwise this approach will only work if you create a native wrapper for your Firebase chat application.
I'm working on app that has realtime components and I'm wondering if I can use apple's push notification service for this.
How many messages can we send? Can we use it for something like a chat service?
If not what are our alternatives?
Apple uses push notifications for their new chat service, so yes, you could use it for a chat service.
There are no good alternatives to push notifications. You'd have to manage your own socket and it would only work while your application is running.