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

Discussion in 'Additional libraries, classes and official updates' started by Erel, Jun 9, 2016.

Thread Status:
Not open for further replies.
  1. Duncan H Williamson

    Duncan H Williamson Member Licensed User

    Hi
    Fantastic to be able to use firebase, I have followed the instructions above and in the intergrating firebase services to get this running, however I cannot find where to get the API_KEY for the server example.... yet another grey moment on my part I guess.... I have registered my project and downloaded the relevent file for the B4A client but sofar cannot find the key :( could someone please point me in the right direction

    Regards

    Duncan
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. Duncan H Williamson

    Duncan H Williamson Member Licensed User

  4. tufanv

    tufanv Expert Licensed 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 ?
     
  5. aidymp

    aidymp Active Member Licensed 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
     
  6. tiziana.tinnirello

    tiziana.tinnirello Member Licensed 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
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    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.

    Your code is correct. It should work.
     
    luke2012 likes this.
  8. aidymp

    aidymp Active Member Licensed User

    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 :)
     
    gravel and fredo like this.
  9. tiziana.tinnirello

    tiziana.tinnirello Member Licensed User

    My mistake, now it works like a charm.

    Another question: is there a way to know the delivery datetime with message ID ?
     
  10. DonManfred

    DonManfred Expert Licensed User

    not with google-code.

    Write the time into a database when the message arrives and give the value back to a server app which will hold the value then...
     
  11. tiziana.tinnirello

    tiziana.tinnirello Member Licensed User

    OK, I'll try it
     
  12. Sorin Pohontu

    Sorin Pohontu Member Licensed User

    Hi Erel.

    Firebase Push Notifications will be added to B4I also ?
    If yes, there is a timeframe for B4I ?
     
  13. Erel

    Erel Administrator Staff Member Licensed User

    Probably yes. I cannot yet say when will it be available.
     
  14. dragonguy

    dragonguy Active Member Licensed User

    What the different about gcm and fcm? I have many app implement with gcm, is it worth change to fcm?
     
  15. Eme Fibonacci

    Eme Fibonacci Well-Known Member Licensed User

    Have you read it?

    https://developers.google.com/cloud-messaging/faq

    I think Firebase notification with B4A is simple and efficient.

    Maybe better create a new thread for this question.
     
    Last edited: Jun 18, 2016
    lurahxp and dragonguy like this.
  16. dragonguy

    dragonguy Active Member Licensed User

    thank ya!
     
  17. Leni Berry

    Leni Berry Active Member Licensed 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
     

    Attached Files:

    Last edited: Jun 21, 2016
  18. Erel

    Erel Administrator Staff Member Licensed User

    You should use OkHttpUtils2 and OkHttp.
     
    Daniel-White likes this.
  19. Leni Berry

    Leni Berry Active Member Licensed User

    oh. ok... i miss that...
     
    hani bassam and amir lotfi like this.
  20. KMatle

    KMatle Expert Licensed User

    About a month I tested one of my Apps using GCM. I must have sent thousands of messages in 8 hours or so :cool: 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).
     
    GabrielM, pesquera and DonManfred like this.
Thread Status:
Not open for further replies.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice