B4A Library FirebaseNotifications - Push messages / Firebase Cloud Messaging (FCM)

Status
Not open for further replies.

mariobam

Member
Licensed User
Longtime User
I can not create bigtextstyle notifications from firebasemessagingservice, fm_MessageArrived, (when my app this closed) .. what do I do?
 

ilan

Expert
Licensed User
Longtime User

ilan

Expert
Licensed User
Longtime User

Alpandino

Member
Licensed User
Hi Erel,

I did all the steps in this tutorial and everything works fine.
However, I noticed that the device that sends the message also receive the message just sent. Is it possible to avoid this? I don't need to receive a message that I have sent.

Thanks
 

ilan

Expert
Licensed User
Longtime User

Just dont subscribe to the topic with that device.and it should not recive that notification..

B4X:
fm.SubscribeToTopic("general")
 

Alpandino

Member
Licensed User
Just dont subscribe to the topic with that device.and it should not recive that notification..

B4X:
fm.SubscribeToTopic("general")

I need to subscribe my device to this topic, because I want to receive messages from other users of this topic, but I don't want to receive messages sent from my device. In this case I think that I may find a workaround, for example: I could insert in every message a "sender" ID, so if sender == mysender_ID then ignore this message.
It's a waste of time processing and of network traffic, but it seem that is not possible to find other solutions.

Anybody have some ideas?
 

ilan

Expert
Licensed User
Longtime User
You can create a txt file with the msg u sent and when u receive a msg u check if such a file exists that contains the same text. If true dont show notification.

Thhis should be simpler to implement then create user and handle a db where all users are listed to avoid give two users the same user id....
 

Alpandino

Member
Licensed User

I must not work with ID users stored in a DB Table, because I'm using the UID provided by Firebase Authentication, so I'm sure this UID is really unique.

Anyway, thank you for the smart suggestion, it can be useful in other situations.
However it seems really strange that Firebase don't give the possibility to avoid the delivery of the message at sender.
 

VTSinLincoln

Member
Licensed User
Longtime User
I'm using FCM notification in an alarm notification app. One of the things I'm noticing though is a very inconsistent delivery time - anything from a few seconds to over 10 minutes.

I've set the messages to be delivered high priority (see https://firebase.google.com/docs/cloud-messaging/concept-options#setting-the-priority-of-a-message) which seems to help. Is there anything else I can do to ensure the notifications turn up in a more timely fashion? Any suggestions where to start looking for delays - the API end (I always get a valid ID from the FCM API when I send messages to it) or the device end?

Vaughan
 

freedom2000

Well-Known Member
Licensed User
Longtime User
Hi I have done a similar App see here, and for the moment I have quasi real time notifications.
 
Last edited:

freedom2000

Well-Known Member
Licensed User
Longtime User
Are you always getting notifications within a few seconds?

Yes they come in less than 2s
The only difficulty is when you have just switched from 4G to Wifi, then I suppose that the phone reconnects to google and they can take a few seconds more.

I will check if in "normal months" the response time remains fast. August is in full summer hollidays period in France and the networks may be not overloaded...
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…