Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Location based push notification FCM [closed]

I am implementing a service that will push notifications/messages to client devices(android/ios) based on the real time location. If the client is within a predefined radius, the service shall send them a custom message that is tailored towards that location. I am using firebase. The notifications should be sent when the application is active or in the background.

like image 575
Mert Avatar asked May 14 '17 11:05

Mert


People also ask

Is GCM and FCM same?

Firebase Cloud Messaging (FCM), formerly known as Google Cloud Messaging (GCM), is a cross-platform cloud solution for messages and notifications for Android, iOS, and web applications, which as of June 2022 can be used at no cost.

How does FCM push notification work?

The FCM backend receives the message request, generates a message ID and other metadata, and sends it to the platform specific transport layer. When the device is online, the message is sent via the platform-specific transport layer to the device. On the device, the client app receives the message or notification.

Does FCM guarantee delivery?

FCM does not guarantee the order of delivery. Some typical use cases of non-collapsible messages are chat messages or critical messages. For example, in an IM app, you would want to deliver every message, because every message has different content.


1 Answers

There is several aproaches :

  • use fcm topic, but you have to combine with geofencing, whenever user enter or leave certain radius from specific location, it will subscribe or unsubscribe to certain topic

  • use library called geo-fire, with that library you can query all the user that has certain radius from certain specific location. You can combine with cloud function to send center location as parameter

like image 172
faruk Avatar answered Nov 15 '22 06:11

faruk