Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase chat Push Notifications

I am developing a chat app using Firebase as backend. It is required that on every new message receiver gets a push notification saying that he got a new message. This is first time I am doing something like this so I have a question:

Since we do not use our own server for this, do we need a 3rd party provider (like Batch for example) for handling push notifications? If I am not mistaken I think Firebase does not support sending push notifications like this but only ones you send from console.

Any help would be great.

like image 676
ZassX Avatar asked May 27 '16 11:05

ZassX


People also ask

Can Firebase send push notification?

Firebase Cloud Messaging (FCM) provides a reliable and battery-efficient connection between your server and devices that allows you to deliver and receive messages and notifications on iOS, Android, and the web at no cost.

Can I use Firebase for push notification to iOS?

For Apple client apps, you can receive notification and data payloads up to 4000 bytes over the Firebase Cloud Messaging APNs interface. To write your client code in Objective-C or Swift, we recommend that you use the FIRMessaging API.

Can Firebase send SMS?

You can send SMS Verification using Firebase and you cannot send ordinary SMS through Firebase. You can send using Twilio instead.


2 Answers

Hope someone finds this useful, it helped in my case.

Currently sending push notifications from device to device isn't possible with solution Firebase offers. If you want that type of thing, you should try OneSignal which is free and very easy to implement.

like image 117
ZassX Avatar answered Oct 05 '22 23:10

ZassX


(iOS) A little late; but perhaps can help anyone in the future with this.

I recently had this issue, and my solution was to utilize the device group method.

Ergo:

  1. Would create a device group with the registration_ids (or array of device ids for the push)

  2. Would then send the push to said device group

  3. Delete device group

See: https://firebase.google.com/docs/cloud-messaging/ios/device-group

like image 24
Jack Rosles Avatar answered Oct 05 '22 23:10

Jack Rosles