Android Example [B4X] [B4XPages] FirebasePush + FirebaseAuth

Star-Dust

Expert
Licensed User
Today for the first time, I started messing with B4XPages and Firebase. Even though I had already watched B4XPages, I hadn't fumbled to understand better.
The hardest thing was Firebase, configuration and settings, especially with iOS. (Traumatic , certificates, profiles, keys ....)

I noticed that a B4XPages example for firebaseAuth is missing and it is not easy to adapt.

I thought of adapting FirebaseMessager instead of sending a message to users from the developer (as an advertisement or notification) I wanted to create an app that the user could send a message and all other users would receive it. A kind of chat .
This also required the ability to authenticate to identify who is sending the message ... here is the result.

I hope it will be useful to someone

NB. In order to send messages you must insert the Server_Key that you get in the Firebase site.
For ios: the specific ProvisionFile must be created. For authentication you need to get the #UrlScheme. Copy the GoogleService-Info.plist file to the special folder
For Andoird: Copy the google-services.JSON file to the project folder.

PS. I based the code on the following sources, If you have any questions, check all the links indicated where everything is described in detail step by step. Don't ask me questions, I know as much as you do and maybe a little less about Firebase or B4XPAGES

ezgif-7-96ec313502da.gif
IMG_0149.PNG
IMG_0151.PNG
 

Attachments

Last edited:

Star-Dust

Expert
Licensed User
I am carrying out the project, improving the graphics


1.png
 

Star-Dust

Expert
Licensed User
Finally thanks !!
I was requesting it here, it is very complicated to implement it.
Remember to do all the steps on the firebase site which are floppy disks in the tutorial otherwise you will go crazy
 

Star-Dust

Expert
Licensed User
I posted a similar one recently

This version of course I did it especially for this app
 

AymanA

Member
Licensed User
Thank you @Star-Dust for your awesome work, and all your help on the forum and this invaluable example!

I just have a concern with regards to having the server_key in the App, can't this be a security issue?


I am doing something similar, but I am not adding the server_key in the App side.

So for a user to send to group I am subscribing all users(sending and receiving) to specific MQTT topic (my skills are really bad with B4J so node-red was a simple solution for me), from there on the server side, I pass the topic,title,body and serverkey to FCM so everyone including the sender will receive the notification:

Again, I really appreciate all the time and effort you are spending to create such a wonderful example!
 

Attachments

Star-Dust

Expert
Licensed User
Hi @AymanA,
Safety assessment may be important in certain contexts. There are several ways to overcome this problem, but it was not the subject of this thread.

Rather, the example was intended to explain how to implement FP + FA with B4XPages.

Clearly based on the need (even the security one) we can adapt and modify the source.

I hope this source can be useful to you.
 
Top