some time ago I posted about my open source project: Firebase4Delphi. Well, Firebase was acquired by Google and in Google I/O 2016 was showed very interesting news and new features (more info here ). My project provide a REST facade to consume FIREBASE RealTime Database API.
The Firebase Realtime Database is a cloud-hosted database. Data is stored as JSON and synchronized in realtime to every connected client. When you build cross-platform apps with our iOS, Android, and JavaScript SDKs, all of your clients share one Realtime Database instance and automatically receive updates with the newest data. - Firebase Realtime Database DocumentationIn my project there is a sample application about a Chat messaging system. If you enjoy Firebase program (https://console.firebase.google.com/), you are able to create your first Firebase project! See the online documentation to undestand how Firebase works.
Once you create your application you can start to use the Chat Messaging sample, it's very easy if you follow these steps:
- Create a clone of Firebase4Delphi project (or download it)
- Open Firebase4DelphiChatDemo.dproj
- Deploy the app on your favorite Target Platoform (Windows, Mac, Android, iOS)
- Once application started, put in the settings tab (Fig 1) the URL provided by Firebase Realtime Database related to your project (Fig 2) , adding the demo name "chatdemo" as REST parameter
- Choose a username
- Click Start Chat button
Fig 1:
Fig 2:
And that's all! You can start to use the simple chat messaging system!
Be careful to share your project and other info because it's just a demo and I not covered Firebase Realtime Database Security and Rules so all your security rules are defined as public and anyone can read or write to your database (default).
If you are interested about this project or you want to contribute do not hesitate to contact me by the github page!
PS.
In October I will take a session in ITDevCon conference: Build Realtime application with Delphi and Firebase
HI ,
ReplyDeleteThanks for sharing , i am using XE7 and would like to ask whether is possible to use Indy to replace the System.Net.HttpClient so that can make this library to be compatible with XE7 ?
Yes it is possible... but I chose this solution because the new HTTP client libraries work across Windows, OS X, iOS and Android, and include native support for SSL, GZIP encoding, etc...
DeleteHi, Kalmen Chia! You are using Indy? It's work?
DeleteHi,
ReplyDeleteCongratulations on the article.
I have a doubt:
It is possible using the project Firebase send PUSH notification to the users?
Just as we can use Kinvey?
Hi,
Deleteit is possible but not from a Delphi client, only from a client specified in the documentation. I have been in close contact with the support of Firebase, but unfortunately for now, is not possible a third party bridge for the new features ( those added since Google has acquired Firebase ) .
Hi,
ReplyDeleteCongratulations on the article.
I have a doubt:
It is possible using the project Firebase send PUSH notification to the users?
Just as we can use Kinvey?
Hi Daniele,
ReplyDeleteGreat job ! I leave you a message in GitHub but I have another question. Is it you framework compatible with Delphi XE6 ?
Best Regards.
Adalberto Brasaca
Piracicaba - SP
Brazil
Hi,
Deleteno it's not compatible because it use the new HTTP client libraries available from XE8
Hi Daniele. The sample program works. But one node above "Server URL" and "Username" always is added a string with many strange characters, for example "-KS9cRlaIl4m1YPdVNGB" or "-KS9chSGkluCugqxOHpG". Is that right ?
ReplyDeleteRegards.
Yes, it is correct. They are unique identifiers supplied automatically by system
Deletehi, i cant run error:permisson denied. pls help
ReplyDeletethanks
you must define this in rules tab under Database menu of Firebase
Delete{
"rules": {
".read": "auth == null",
".write": "auth == null"
}
}
please this is for demo purposes only as noted above. thanks
Hi, I couldn't get it to work. I got my firebase account, put in my firebaseurl in the server textbox, put in a username which I created under authentication but when I click start chat nothing happens, even after I type a message and click send. HELP
ReplyDeleteHave you tried to debug some info? What about the server response?
DeleteHi NigeriaLNG. My code works fine ! Try it. The rar file contains source code and executable. Good luck. Link to download: https://1drv.ms/u/s!AuSTIeosjoqokDAn77hRNoKxydT3
Delete@Daniele sorry for my late response, but how or which debug info.
Delete@Adalberto I downloaded your app but did not work, just like my or app created by Daniele.
Let me know, for URL is it https://.firebaseio.com or some other url
Hi NigeriaLNG... You have to create a "database" in Firebase's site and use the URL for the create "database" in application (first field - see Fig. 1 above). And also see above the reply from Daniele to Sam Mikael (access permisson rules). Regards.
DeleteDaniele,
ReplyDeleteThe framework can be used in Delphi mobile application ?
Best regards.
Yes, of course :)
DeleteHai, can you teach me how to create remote push notification using firebase cloud messaging. please explain me how do it, or give me some example. please help me i need your help :'(
ReplyDeleteHi! remote push notification are not supported by Firebase4Delphi. You have to use the libraries specified in firebase documentation. The documentation is very simple and complete. Here the link https://firebase.google.com/features/notifications/
Deletebut, can you explain to me step by step. seriously i'm newbie, please help me
DeleteI think that the official documentation is better than me :) :)
DeleteHi Daniele. I have one doubt. How can I change the values of the same fields (2), I mean, edit the fields contents. Best regards.
ReplyDeleteHi! PUT is the command for update. Here the documentation https://firebase.google.com/docs/database/rest/save-data
DeleteHi Daniele, How can we retrieve just some data from database chat. I try with "EqualTo" in params but does not work: ... QueryParams.Add('equalTo', 'some_user_name');
ReplyDeleteRegards
Hi, I am answering my self to help someone else. The solution was add ".indexOn":"name" in RULES.
ReplyDeleteHello Daniele,
ReplyDeleteI need a consultant on this project.
I would like to include a list of users in a listview, and when clicking, open the chat, as well as having one photo per user.
That is, in the user registry can add / change a photo.
awaiting
Follow my skype loester.rodrigo.da.silva
Congratulations! And thanks for the post.
ReplyDeleteI would like to be able to send photos and videos in the chat, is it possible? How could I do it? If you could help me I would be very grateful.
Great work. From unknown reason TActionList cause freezing of the GUI. After remove TActionList Firebase4DelphiChatDemo works properly. (Delphi 10.2.2, Android SDK 25.2.5, Android 7.1.2)
ReplyDeletehotfix https://cc.embarcadero.com/item/30819
DeleteGreat work. From unknown reason TActionList cause freezing of the GUI. After remove TActionList Firebase4DelphiChatDemo works properly. (Delphi 10.2.2, Android SDK 25.2.5, Android 7.1.2)
ReplyDeleteHi, great job. Is compatible with lazarus?
ReplyDelete