Android Question should i use B4X pages for a Push Notification app?

yaniv hanya

Active Member
Licensed User
I started a new app last week, which should be based on push notification (using Firebase).
It is in the first stage now. the App should be some kind of "In Company whatsapp", showing messages from the company directories to workers.

I just saw the B4X Pages toturial, and i wonder if this kind of app should build with B4X Pages? since the weight is on push notification parsing, does the B4X Pages gives any advantages?
 

yaniv hanya

Active Member
Licensed User
I tried to move the app to B4XPages, and i get few errors-

1) the firebase service is not initialized. i thought it is becuse "starter" is not called in b4XPages. but it is called. i put the service "firebase messing" in the root folder. should i put it in another place?
2) i use method setinfo2 to react to the notification arrivel and click. it allowed me to pass data to the activity. how should i open the B4xPages Mainpage from the service? can it be done? can i pass info to it? it not, should i open the activity and then, from there, to open the mainpage?

3) can't i use #BridgeLogger: true from the mainpage?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
1) It doesn't matter where you put the file.
I've prepared a small example of B4XPages with push: https://www.b4x.com/android/forum/threads/b4x-b4xpages-firebase-push-example.120523/#content

2) All the pages are inside the main activity. You should set the activity parameter to Main. You can get the notification tag in Activity_Resume in Main, and do whatever you need with it. Remember that the B4XPages are regular classes.

3) You should add it to the Main module.
 
Upvote 0

yaniv hanya

Active Member
Licensed User
Well, i couldn't find any different between your code and my own.

but i keep get error-
java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process b4a.example. Make sure to call FirebaseApp.initializeApp(Context) first.
do you have any idea?
 
Upvote 0
Top