Android Question Notifications stopped suddenly, any help?

Adamdam

Active Member
Licensed User
Longtime User
Dear all,
Greetings,
Notifications stopped suddenly, any help?
The keys still active/enabled.
Some of my projects totally based on notifications, any help to re-run these keys/projects ?
Best regards
 

Adamdam

Active Member
Licensed User
Longtime User
You need to replace the project id with yours, not b4a-test1.
I changed the Project id the error removed and the Jave file created, but no notification fired at all.

I even create new projects:
- First Firebase project at firebase.google.com and :
- Create B4A project as Notification receiver,
- Re-create FCMPush java project with "Project id" and "---.json" file.
but no notification created at all,
I can't catch the problem,
any help please ?

by the way if any have php script as a pusher for notification , please

best regards
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
but no notification created at all,
What is the code you use to send the notification?

Did you updated it to use the new B4J Sending tool? It is a mandatory step you have to follow.

Did you try to use the Sending Tool on your PC to test if it works?
 
Upvote 0

asales

Expert
Licensed User
Longtime User
I changed the Project id the error removed and the Jave file created, but no notification fired at all.

I even create new projects:
- First Firebase project at firebase.google.com and :
- Create B4A project as Notification receiver,
Beside to create the project, did you enabled the Firebase Cloud Messaging V1 API?
- Re-create FCMPush java project with "Project id" and "---.json" file.
but no notification created at all,
I can't catch the problem,
Did you see any error message in the log?
any help please ?

by the way if any have php script as a pusher for notification , please
 
Upvote 0

Adamdam

Active Member
Licensed User
Longtime User
Beside to create the project, did you enabled the Firebase Cloud Messaging V1 API?

Did you see any error message in the log?

Thanks sir for your attention and reply.
it seam to be what I need (php code to send a notification)

I write a separate php based on the above link with the last function :

<CODE>
<?php
function sendNotification($to, $title, $body) {
$url = 'https://fcm.googleapis.com/fcm/send';
$apiKey = 'YOUR_SERVER_KEY';
</CODE>

Sure, without function name. but how can I find YOUR_SERVER_KEY in my firebase account ?
best regards
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I write a separate php based on the above link with the last function
you can put the code into the trashbin.

The url you are using is wrong.

Look at the b4j sending tool. As suggested X times now to you....

But it to work you need to get a AccessToken first.

The code for it is in the B4J Sending tool.

The code posted for an PHP solution may work (have not testet it),
At least you need to get a fully qualified OAuth-Accesstoken.

You can NOT find the token in your Console.

And again. The code to send you can not use in Android as the required artifacts are not part of the Android-System.
 
Upvote 0

Adamdam

Active Member
Licensed User
Longtime User
What is the code you use to send the notification?

Did you updated it to use the new B4J Sending tool? It is a mandatory step you have to follow.

Did you try to use the Sending Tool on your PC to test if it works?

Thanks Mr. Manfred, for your attention and reply.
I used j4b app ( FCMPush.b4j ) as it is just after modify:
- ProjectId As String = "addplayer-12345"
- ServiceAccountFilePath As String "d:/1234/456798.json"

no error occurred in log tab, but also no notification occurred, I used multiple keys, even I re-created the B4A with "google-services.json" (with each key).

Best regards
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
It is annoying to read such long threads.
And we are no single step further.

I suggest to create a NEW THREAD posting ALL RELEVANT INFORMATION.

Otherwise i guess you´ll not reach any goal here.

For me it looks like something is wrong in your setup.
The B4J Sendingtool is working for me since WEEKS. Without issues.

But my B4A-Setup is correctly configured, i have the right json file, my SDK is up to date.

I suggest to check the basics first.
- Use the B4J-Sending tool.
If you do not get any Notification then your Appsetup (b4a) or your Google-Project is wrong configured.
If you get a Notification with the B4J-Sending tool then B4A and GoogleProject are correctly configured.

I can not further help here.

I´m out now. Do not expect more answers from me.
 
Last edited:
Upvote 0

asales

Expert
Licensed User
Longtime User
@DonManfred is right.
There are several answers for you to update the code and you are still trying to use the old (and obsolete) code.

I put this question "did you enabled the Firebase Cloud Messaging V1 API?" and you don't answer.

My final advice: follow the instructions carefully!
- enable the API
- download the json file.
- uses the B4J code.

It's work for me and will works for you.
 
Upvote 0

Adamdam

Active Member
Licensed User
Longtime User
May I ask if you have tested with B4J Sending Tool?
Have you really read the link pointed to you 6x?
I guess you have ignored them.
Yes, I used B4J sending project and add the additional libraries, and changed all requested parameters as:
- ProjectId As String = "addplayer-12345"
- ServiceAccountFilePath As String "d:/1234/456798.json"
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Yes, I used B4J sending project and add the additional libraries, and changed all requested parameters as:
- ProjectId As String = "addplayer-12345"
- ServiceAccountFilePath As String "d:/1234/456798.json"
Then?
It failed to send?
Do you rename the file name for the json file?
Do you successfully getting the token?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Do you rename the file name for the json file?
the filename doesn´t matter.

See B4J Sendingtool
B4X:
Dim GoogleCredentials As JavaObject
    GoogleCredentials.InitializeStatic("com.google.auth.oauth2.GoogleCredentials")
    Dim Credentials As JavaObject = GoogleCredentials.RunMethodJO("fromStream", Array(File.OpenInput(FilePath, ""))) _
        .RunMethod("createScoped", Array(Array As String("https://www.googleapis.com/auth/firebase.messaging")))
 
Upvote 0

Adamdam

Active Member
Licensed User
Longtime User
Really many thanks for your support.
and I'm so sorry for your times.
I still haven't any notifications until now.
- I used B4J push project and change project-id, and
- The key is active.
- I don't re-generate B4A (receiver) (I need to regenerate it ? (it worked well in the past).
- The log output (attached) and it seem worked well.

Please see the Log result from B4J push project.
1726600256768.png


If you hope to share any other things (please inform me to share it).

Best regards
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Really many thanks for your support.
and I'm so sorry for your times.
I still haven't any notifications until now.
- I used B4J push project and change project-id, and
- The key is active.
- I don't re-generate B4A (receiver) (I need to regenerate it ? (it worked well in the past).
- The log output (attached) and it seem worked well.

Please see the Log result from B4J push project.
View attachment 157051

If you hope to share any other things (please inform me to share it).

Best regards
This Logs mean the notification is successfully sent! (last value with name key)
I can't tell whether your payload is correct or not since you didn't provide the full Logs.
Again, please please please read the tutorial and change your FirebaseMessaging service to FirebaseMessaging receiver.
 
Upvote 0

Adamdam

Active Member
Licensed User
Longtime User
This Logs mean the notification is successfully sent! (last value with name key)
I can't tell whether your payload is correct or not since you didn't provide the full Logs.
Again, please please please read the tutorial and change your FirebaseMessaging service to FirebaseMessaging receiver.
Thanks Mr. Aeric.
Really I'm so sorry for your effort and time.

I read the tutorial many times, but I'll read carefully it again.
I just need to know what you meant by "and change your FirebaseMessaging service to FirebaseMessaging receiver." and how to change it?

Best regards
 
Upvote 0
Top