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

Status
Not open for further replies.

tufanv

Expert
Licensed User
Longtime User

We can send the notification dişrectly from firebase console. Why did Erel said that it is complicated ? does it have some weaknesses or what ?
 

aidymp

Well-Known Member
Licensed User
Longtime User
When I send a message from the firebase console it get null, null but from the b4j app it works fine? why is that?

Thanks

Aidy
 

tiziana.tinnirello

Member
Licensed User
Longtime User
How to subscribe more topics ?

executing code above has no effect.

fm.SubscribeToTopic("general") 'you can subscribe to more topics
fm.SubscribeToTopic("another") 'you can subscribe to more topics
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
We can send the notification dişrectly from firebase console. Why did Erel said that it is complicated ?
It is simple to send from Firebase console however there are several edge cases that you need to handle (go over their documentation and you will see) in order to always receive the messages.
I don't find it useful as it is very simple to send messages with the REST API.

How to subscribe more topics ?
executing code above has no effect.
Your code is correct. It should work.
 

aidymp

Well-Known Member
Licensed User
Longtime User
How to subscribe more topics ?

executing code above has no effect.

fm.SubscribeToTopic("general") 'you can subscribe to more topics
fm.SubscribeToTopic("another") 'you can subscribe to more topics

That does work for me! one point i noticed, is if your using an emulator it must have google play services installed or all the code has no effect, although adsense still works! (This may be pretty obvious but took me an hour to realise
 

dragonguy

Active Member
Licensed User
Longtime User
What the different about gcm and fcm? I have many app implement with gcm, is it worth change to fcm?
 

Leni Berry

Active Member
Licensed User
Longtime User
i hv an error around this code below :

Job.GetRequest.SetContentType("application/json;charset=UTF-8")
Job.GetRequest.SetHeader("Authorization", "key=" & API_KEY)

Note:
i already use httputil2 library by B4A v6
 

Attachments

  • error httpjob.png
    57 KB · Views: 402
Last edited:

KMatle

Expert
Licensed User
Longtime User
As far as i know no. Or, let me say, i did not found any info about restrictions.

Only the info that it is totally free (and forever).

About a month I tested one of my Apps using GCM. I must have sent thousands of messages in 8 hours or so As long as you don't spam Google's servers, everything is ok...

Even if you don't need a server here I strictly recoomend to have some logic between it (like login, check who sends messages, handling devices etc.). If someone catches your api-key (stored inside the app) then you're done . So send it to your server, check it, route it to the device (with the corresponding php).
 

ricardotm1968

Member
Licensed User
Longtime User
Hi Erel,
i'm starting to develop a new app, i use appcompat library (ver 2.0) , when i try to chenge my GCM to FCM, in the compile send me this error ,



if i inactivate the library everthig is fine, is not posible to use both library at the same time?

thanks in advance
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…